Derivation Steps and Traces #
Ordered derivation tracking for Minimalist syntax: the sequence of
Merge/Move operations that produces a SyntacticObject tree.
Key definitions #
SyntacticObject.replace— substitute a subtree, used to leave tracesStep— a single derivation step (External or Internal Merge)Derivation— an ordered list of steps applied to an initial SODerivation.final— the tree produced by applying all stepsDerivation.stageAt— intermediate tree afternstepsDerivation.movedItems— which subtrees underwent Internal Merge
Replace all occurrences of target in so with replacement.
In well-formed derivations with unique LIToken IDs, each subtree
appears exactly once, so this replaces at most one position.
Equations
- (Minimalism.SyntacticObject.leaf a).replace target replacement = if (Minimalism.SyntacticObject.leaf a == target) = true then replacement else Minimalism.SyntacticObject.leaf a
- (l.node r).replace target replacement = if (l.node r == target) = true then replacement else (l.replace target replacement).node (r.replace target replacement)
Instances For
A single derivation step.
- emL
(item : SyntacticObject)
: Step
External Merge: new item becomes left daughter.
- emR
(item : SyntacticObject)
: Step
External Merge: new item becomes right daughter.
- im
(mover : SyntacticObject)
(traceId : ℕ)
: Step
Internal Merge: move
moverto left edge, leaving a trace withtraceId.
Instances For
Equations
- Minimalism.instReprStep = { reprPrec := Minimalism.instReprStep.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply a derivation step to the current tree.
emL: new item merges as left daughter (head/specifier above current)emR: new item merges as right daughter (complement of current)im: mover is extracted (replaced by trace) then re-merged at the left edge
Equations
- (Minimalism.Step.emL a).apply current = a.node current
- (Minimalism.Step.emR a).apply current = current.node a
- (Minimalism.Step.im a a_1).apply current = a.node (current.replace a (Minimalism.mkTrace a_1))
Instances For
An ordered derivation: an initial SO plus a sequence of steps.
- initial : SyntacticObject
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
The final tree produced by applying all derivation steps.
Equations
- d.final = List.foldl (fun (so : Minimalism.SyntacticObject) (step : Minimalism.Step) => step.apply so) d.initial d.steps
Instances For
The intermediate tree after the first n steps.
Equations
- d.stageAt n = List.foldl (fun (so : Minimalism.SyntacticObject) (step : Minimalism.Step) => step.apply so) d.initial (List.take n d.steps)
Instances For
Number of derivation steps.
Instances For
The subtrees that underwent Internal Merge (movement).
Equations
- d.movedItems = List.filterMap (fun (x : Minimalism.Step) => match x with | Minimalism.Step.im mover traceId => some mover | x => none) d.steps
Instances For
Stage 0 is the initial tree (no steps applied).
Stage at full length equals the final tree.
Replacing so when it is the root returns the replacement.