Pattern for one fixed AC leaf and one rest variable.
Equations
- MeTTaIL.AC.acRestPattern l fixed restVar = MeTTaIL.AST.sexp l [fixed, MeTTaIL.AST.var (MeTTaIL.DottedPath.base restVar)]
Instances For
Search loop for one AC collection. preRev stores leaves already skipped, in reverse order.
Equations
- One or more equations did not get rendered due to their size.
- MeTTaIL.AC.matchACRestLoop l fixed restVar bnds preRev [] = none
Instances For
Search one AC collection for a fixed leaf and bind the rest variable to the rebuilt remainder.
Equations
- One or more equations did not get rendered due to their size.
- MeTTaIL.AC.matchACRest l fixed restVar subject bnds = none
Instances For
A successful AC-rest search returns a syntactic representative that the ordinary matcher accepts.
If a chosen split of the flattened leaves has a matching fixed leaf and a bindable rebuilt rest, the AC-rest search succeeds. This is completeness for the linear search shape, not uniqueness of the returned bindings.
Completeness for one binary AC subject, stated over a split of its flattened leaves.
The AC-rest search witness is AC-equivalent to the rebuilt leaves being searched, provided the collection still has at least two leaves. That invariant is true for binary AC subjects.
A successful AC-rest match returns a representative AC-equivalent to the subject.
AC-aware first-order matching. The AC-specific case is linear: one fixed subpattern and one rest variable under an AC binary collection.
Equations
- One or more equations did not get rendered due to their size.
- MeTTaIL.AC.matchPatACRaw acOp (MeTTaIL.AST.sexp l [fixed, MeTTaIL.AST.var (MeTTaIL.DottedPath.base restVar)]) x✝¹ x✝ = if acOp l = true then MeTTaIL.AC.matchACRest l fixed restVar x✝¹ x✝ else none
- MeTTaIL.AC.matchPatACRaw acOp x✝² x✝¹ x✝ = if (x✝² == x✝¹) = true then some { bnds := x✝, witness := x✝¹ } else none
Instances For
Pointwise AC-aware matching for argument lists.
Equations
Instances For
Public AC-aware matcher.
Equations
- MeTTaIL.AC.matchPatAC acOp pat t bnds = Option.map (fun (r : MeTTaIL.AC.ACMatch) => r.bnds) (MeTTaIL.AC.matchPatACRaw acOp pat t bnds)
Instances For
A successful linear AC-rest match has an AC-equivalent syntactic representative accepted by the ordinary matcher.
A successful linear AC-rest match has a syntactic representative accepted by the ordinary matcher.
Lift a public AC-rest match back to the raw matcher result it erased.
Public soundness bridge for the linear AC-rest fragment used by Cordial Miners.
Public witness theorem for the linear AC-rest fragment used by Cordial Miners.
Public completeness theorem for the linear AC-rest fragment. If the flattened binary AC subject has a split whose selected leaf matches the fixed subpattern and whose remaining leaves bind to the rest variable, the AC-aware matcher returns some bindings.
Public completeness theorem for the common linear AC-rest case. If a selected flattened leaf matches the fixed subpattern and the rest variable is fresh after that match, the AC-aware matcher succeeds. This is the Cordial Miners rule shape: one observed fact or event, and one variable for the rest of the collection.
Apply one premise-free rewrite using AC-aware matching.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every top-level AC-aware base reduct of a term.
Equations
- MeTTaIL.AC.baseReductsAC acOp p t = List.filterMap (fun (rd : MeTTaIL.RewriteDecl) => MeTTaIL.AC.applyBaseRewriteAC acOp rd t) p.rewrites
Instances For
Every AC-aware base rewrite has an AC-equivalent ordinary-rewrite witness.
Every member of baseReductsAC has an AC-equivalent ordinary-rewrite witness.
A top-level executable AC-aware reduct is a genuine rewrite modulo AC.
Lift a rewrite modulo AC through one sexp argument context.
Lift a rewrite modulo AC through the body of a subst node.
Lift a rewrite modulo AC through the replacement of a subst node.
One leftmost-outermost step using AC-aware matching at every visited node.
Equations
- One or more equations did not get rendered due to their size.
- MeTTaIL.AC.oneStepAC' acOp p (MeTTaIL.AST.var x_1) = match MeTTaIL.AC.baseReductsAC acOp p (MeTTaIL.AST.var x_1) with | r :: tail => some r | [] => none
Instances For
One AC-aware step inside the first reducible list element.
Equations
- One or more equations did not get rendered due to their size.
- MeTTaIL.AC.oneStepACList' acOp p [] = none
Instances For
Fuel-bounded evaluation using the AC-aware stepper.
Equations
- MeTTaIL.AC.evalAC' acOp p 0 x✝ = x✝
- MeTTaIL.AC.evalAC' acOp p n.succ x✝ = match MeTTaIL.AC.oneStepAC' acOp p x✝ with | some t' => MeTTaIL.AC.evalAC' acOp p n t' | none => x✝
Instances For
Soundness: every executable AC-aware one-step reduct is a genuine rewrite modulo AC.
Soundness for the AC-aware list stepper.
Soundness of fuel-bounded AC-aware evaluation.