What a traversal does next #
The answers a traversal's pre and post functions give, shared by everything that folds or walks:
the terms of both layers (Cvc.Untyped.Term.fold, Cvc.Typed.Term.walk, …) and proofs
(Cvc.Untyped.Solver.Proof.fold, …). Each carries the new state, and says whether to descend,
skip, stop, or — for a walk — replace the node.
What a walk does on reaching a node, before its kids. R is what replaces the node.
- descend
{σ R : Type}
(s : σ)
: WalkPre σ R
Visit the kids.
- skip
{σ R : Type}
(s : σ)
: WalkPre σ R
Do not visit the kids; the node is still left,
postand all. - replace
{σ R : Type}
(t : R)
(s : σ)
: WalkPre σ R
Replace the node, without visiting the replacement; it is then left.
- replaceAndRevisit
{σ R : Type}
(t : R)
(s : σ)
: WalkPre σ R
Replace the node and visit the replacement, from
pre. - stop
{σ R : Type}
(s : σ)
: WalkPre σ R
End the walk, keeping every replacement made.
Instances For
What a walk does on leaving a node, after its kids. R is what replaces the node.
- continue
{σ R : Type}
(s : σ)
: WalkPost σ R
Carry on.
- replace
{σ R : Type}
(t : R)
(s : σ)
: WalkPost σ R
Replace the node, and carry on.
- replaceAndRevisit
{σ R : Type}
(t : R)
(s : σ)
: WalkPost σ R
Replace the node and visit the replacement, from
pre. - stop
{σ R : Type}
(s : σ)
: WalkPost σ R
End the walk, keeping every replacement made.
Instances For
The same step, its replacement mapped.
Equations
- Cvc.WalkPre.map f (Cvc.WalkPre.descend s) = Cvc.WalkPre.descend s
- Cvc.WalkPre.map f (Cvc.WalkPre.skip s) = Cvc.WalkPre.skip s
- Cvc.WalkPre.map f (Cvc.WalkPre.replace t s) = Cvc.WalkPre.replace (f t) s
- Cvc.WalkPre.map f (Cvc.WalkPre.replaceAndRevisit t s) = Cvc.WalkPre.replaceAndRevisit (f t) s
- Cvc.WalkPre.map f (Cvc.WalkPre.stop s) = Cvc.WalkPre.stop s
Instances For
The same step, its replacement mapped.
Equations
- Cvc.WalkPost.map f (Cvc.WalkPost.continue s) = Cvc.WalkPost.continue s
- Cvc.WalkPost.map f (Cvc.WalkPost.replace t s) = Cvc.WalkPost.replace (f t) s
- Cvc.WalkPost.map f (Cvc.WalkPost.replaceAndRevisit t s) = Cvc.WalkPost.replaceAndRevisit (f t) s
- Cvc.WalkPost.map f (Cvc.WalkPost.stop s) = Cvc.WalkPost.stop s