MCPcopy Create free account
hub / github.com/argumentcomputer/ix / dispatch_branch

Function dispatch_branch

crates/aiur/src/trace.rs:174–191  ·  view source on GitHub ↗

Dispatch a match: look up the value in the cases map, or fall through to the default (pushing inverse witnesses for each case to prove inequality).

(
  val: G,
  cases: &'a FxIndexMap<G, Block>,
  def: &'a Option<Box<Block>>,
  index: &mut ColumnIndex,
  slice: &mut ColumnMutSlice<'_>,
)

Source from the content-addressed store, hash-verified

172 .inputs
173 .iter()
174 .enumerate()
175 .for_each(|(i, arg)| slice.inputs[i] = *arg);
176 // Push the multiplicity
177 slice.push_auxiliary(index, context.multiplicity);
178 let _ = self.body.populate_row(map, index, slice, context, io_buffer);
179 }
180}
181
182/// `Some(values)` means the block ended with `Yield` (values for the merge).
183/// `None` means the block ended with `Return` (function exited).
184type PopulateResult = Option<Vec<G>>;
185
186impl Block {
187 fn populate_row(
188 &self,
189 map: &mut Vec<(G, Degree)>,
190 index: &mut ColumnIndex,
191 slice: &mut ColumnMutSlice<'_, '_>,
192 context: TraceContext<'_>,
193 io_buffer: &IOBuffer,
194 ) -> PopulateResult {

Callers 1

populate_rowMethod · 0.85

Calls 2

push_auxiliaryMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected