aquavm/crates/air-lib/trace-handler
Mike Voronov c85b2e2fbf
feat(execution-engine): change behaviour of fold over streams (#340)
feat(execution-engine): change behaviour of fold over streams

Change behaviour of fold over streams to make it more similar to pi-calculus channels/names (for more info see #333).

Closes #333.

BREAKING CHANGE:

The new stream behaviour is not compatible with old one, such as
```
(fold $stream iterator
   (seq
       (call ...)
       (next iterator)))
```
will never end after this change (for more info again see #333).
2022-09-28 22:03:54 +03:00
..
src feat(execution-engine): change behaviour of fold over streams (#340) 2022-09-28 22:03:54 +03:00
.rustfmt.toml Decouple log targets to a separate crate (#152) 2021-10-05 16:55:04 +03:00
Cargo.toml Update all non-major Rust dependencies (#330) 2022-09-19 14:07:34 +03:00
README.md Rename subtree to subgraph (#265) 2022-05-17 15:53:33 +03:00

AIR trace handler

This crate contains implementation of the CRDT-based merging data algorithm. It exposes the TraceHandler struct that based on the visitor pattern and has public methods that should be called in certain places of AIR instructions execution. Internally TraceHandler contains several FSM and each of such public methods does state transitioning of one or more these FSMs. Below are state transition sequences for all instructions that caller must follow.

Ap instruction

Expected sequence of TraceHandler calls for the ap instruction:

meet_ap_start
    -> meet_ap_end

Call instruction

Expected sequence of TraceHandler calls for the call instruction:

meet_call_start
    -> meet_call_end

Par instruction

Expected sequence of TraceHandler calls for the par instruction:

meet_par_start
    -> meet_par_subgraph_end(..., SubgraphType::Left)
    -> meet_par_subgraph_end(..., SubgraphType::Right)

Fold instruction

Expected sequence of TraceHandler calls for the fold instruction:

meet_fold_start.1 ->
    meet_generation_start.N ->
        meet_next.M ->
        meet_prev.M ->
    meet_generation_end.N ->
meet_fold_end.1

where .T means that this function should be called exactly T times.