A dotted path of identifiers, e.g. a.b.c. Mirrors BNFC DottedPath
(BaseDottedPath Ident | QualifiedDottedPath Ident DottedPath).
- base (ident : String) : DottedPath
- qualified (ident : String) (rest : DottedPath) : DottedPath
Instances For
Equations
Equations
- MeTTaIL.instBEqDottedPath.beq (MeTTaIL.DottedPath.base a) (MeTTaIL.DottedPath.base b) = (a == b)
- MeTTaIL.instBEqDottedPath.beq (MeTTaIL.DottedPath.qualified a a_1) (MeTTaIL.DottedPath.qualified b b_1) = (a == b && MeTTaIL.instBEqDottedPath.beq a_1 b_1)
- MeTTaIL.instBEqDottedPath.beq x✝¹ x✝ = false
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
- MeTTaIL.instDecidableEqDottedPath.decEq (MeTTaIL.DottedPath.base a) (MeTTaIL.DottedPath.base b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- MeTTaIL.instDecidableEqDottedPath.decEq (MeTTaIL.DottedPath.base ident) (MeTTaIL.DottedPath.qualified ident_1 rest) = isFalse ⋯
- MeTTaIL.instDecidableEqDottedPath.decEq (MeTTaIL.DottedPath.qualified ident rest) (MeTTaIL.DottedPath.base ident_1) = isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- MeTTaIL.instReprDottedPath = { reprPrec := MeTTaIL.instReprDottedPath.repr }
A sort / category, i.e. an arity expression. The arity language is the generating shapes closed
under lists, exponentials (arrow), and products. Mirrors BNFC Cat
(IdCat | ListOfCat | ArrowCat | ProdCat).
- idCat (name : String) : Cat
- listOf (c : Cat) : Cat
- arrow (dom cod : Cat) : Cat
- prod (cs : List Cat) : Cat
Instances For
Equations
- MeTTaIL.instInhabitedCat = { default := MeTTaIL.instInhabitedCat.default }
Structural equality on categories, the analogue of the Scala Cat.equals. Hand-written
because Cat nests through List Cat in prod, which deriving BEq does not support.
Equations
- (MeTTaIL.Cat.idCat a).beq (MeTTaIL.Cat.idCat b) = (a == b)
- a.listOf.beq b.listOf = a.beq b
- (a.arrow b).beq (c.arrow d) = (a.beq c && b.beq d)
- (MeTTaIL.Cat.prod cs).beq (MeTTaIL.Cat.prod ds) = MeTTaIL.Cat.beqList cs ds
- x✝¹.beq x✝ = false
Instances For
Pointwise structural equality on category lists (the prod arguments).
Equations
- MeTTaIL.Cat.beqList [] [] = true
- MeTTaIL.Cat.beqList (c :: cs) (d :: ds) = (c.beq d && MeTTaIL.Cat.beqList cs ds)
- MeTTaIL.Cat.beqList x✝¹ x✝ = false
Instances For
Equations
- MeTTaIL.instBEqCat = { beq := MeTTaIL.Cat.beq }
Equations
Equations
Equations
- MeTTaIL.instBEqLabel.beq (MeTTaIL.Label.id a) (MeTTaIL.Label.id b) = (a == b)
- MeTTaIL.instBEqLabel.beq MeTTaIL.Label.wild MeTTaIL.Label.wild = true
- MeTTaIL.instBEqLabel.beq (MeTTaIL.Label.listE a) (MeTTaIL.Label.listE b) = (a == b)
- MeTTaIL.instBEqLabel.beq (MeTTaIL.Label.listCons a) (MeTTaIL.Label.listCons b) = (a == b)
- MeTTaIL.instBEqLabel.beq (MeTTaIL.Label.listOne a) (MeTTaIL.Label.listOne b) = (a == b)
- MeTTaIL.instBEqLabel.beq x✝¹ x✝ = false
Instances For
One item in a function symbol's concrete syntax. Mirrors BNFC Item. terminal is a literal;
nterminal is a sort argument; absNTerminal x it is the abstraction (x) it with x bound in
it; bindNTerminal x c is (Bind x c). The absNTerminal/bindNTerminal pair encodes a
higher-order (exponential) argument.
- terminal (s : String) : Item
- nterminal (c : Cat) : Item
- absNTerminal (x : String) (it : Item) : Item
- bindNTerminal (x : String) (c : Cat) : Item
Instances For
Equations
Equations
- MeTTaIL.instBEqItem.beq (MeTTaIL.Item.terminal a) (MeTTaIL.Item.terminal b) = (a == b)
- MeTTaIL.instBEqItem.beq (MeTTaIL.Item.nterminal a) (MeTTaIL.Item.nterminal b) = (a == b)
- MeTTaIL.instBEqItem.beq (MeTTaIL.Item.absNTerminal a a_1) (MeTTaIL.Item.absNTerminal b b_1) = (a == b && MeTTaIL.instBEqItem.beq a_1 b_1)
- MeTTaIL.instBEqItem.beq (MeTTaIL.Item.bindNTerminal a a_1) (MeTTaIL.Item.bindNTerminal b b_1) = (a == b && a_1 == b_1)
- MeTTaIL.instBEqItem.beq x✝¹ x✝ = false
Instances For
Equations
Equations
Equations
A term. Mirrors BNFC AST: var is a (possibly qualified) variable, sexp label args is an
applied constructor (label args...), and subst body repl v is the built-in capture-avoiding
substitution (Subst body repl v) that drives the COMM rule.
- var (path : DottedPath) : AST
- sexp (label : Label) (args : List AST) : AST
- subst (body repl : AST) (v : DottedPath) : AST
Instances For
Equations
- MeTTaIL.instInhabitedAST = { default := MeTTaIL.instInhabitedAST.default }
Structural equality on terms, the analogue of the Scala AST.equals. Hand-written because
AST nests through List AST in sexp.
Equations
- (MeTTaIL.AST.var p).beq (MeTTaIL.AST.var q) = (p == q)
- (MeTTaIL.AST.sexp l cs).beq (MeTTaIL.AST.sexp m ds) = (l == m && MeTTaIL.AST.beqList cs ds)
- (b.subst r v).beq (b'.subst r' v') = (b.beq b' && r.beq r' && v == v')
- x✝¹.beq x✝ = false
Instances For
Pointwise structural equality on term lists (the sexp arguments).
Equations
- MeTTaIL.AST.beqList [] [] = true
- MeTTaIL.AST.beqList (c :: cs) (d :: ds) = (c.beq d && MeTTaIL.AST.beqList cs ds)
- MeTTaIL.AST.beqList x✝¹ x✝ = false
Instances For
Equations
- MeTTaIL.instBEqAST = { beq := MeTTaIL.AST.beq }
Equations
Equations
- MeTTaIL.instBEqEquation.beq (MeTTaIL.Equation.impl a a_1) (MeTTaIL.Equation.impl b b_1) = (a == b && a_1 == b_1)
- MeTTaIL.instBEqEquation.beq (MeTTaIL.Equation.fresh a a_1 a_2) (MeTTaIL.Equation.fresh b b_1 b_2) = (a == b && (a_1 == b_1 && MeTTaIL.instBEqEquation.beq a_2 b_2))
- MeTTaIL.instBEqEquation.beq x✝¹ x✝ = false
Instances For
Equations
A rewrite premise src ~> tgt over dotted-path variables. Mirrors BNFC Hyp . Hypothesis.
- src : DottedPath
- tgt : DottedPath
Instances For
Equations
- MeTTaIL.instInhabitedHyp = { default := MeTTaIL.instInhabitedHyp.default }
Equations
- MeTTaIL.instBEqHyp = { beq := MeTTaIL.instBEqHyp.beq }
Equations
Equations
Equations
- MeTTaIL.instBEqRewrite.beq (MeTTaIL.Rewrite.base a a_1) (MeTTaIL.Rewrite.base b b_1) = (a == b && a_1 == b_1)
- MeTTaIL.instBEqRewrite.beq (MeTTaIL.Rewrite.ctx a a_1) (MeTTaIL.Rewrite.ctx b b_1) = (a == b && MeTTaIL.instBEqRewrite.beq a_1 b_1)
- MeTTaIL.instBEqRewrite.beq x✝¹ x✝ = false
Instances For
A named rewrite declaration name : rw. Mirrors BNFC RDecl . RewriteDecl.
Instances For
Equations
Equations
Instances For
Equations
A theory presentation, the in-memory BasePres: exported sorts, function symbols (terms),
equations, rewrites, and a references map (declared prefix to sub-presentation) used to validate
dotted-path prefixes in rewrites.
The references field makes the type recursive, exactly as BasePres.listmapentry_ does
(MakeMapEntry . MapEntry ::= Ident "=>" Pres). Our elaborate never populates it, so every
presentation this development produces has empty references; the field is kept to mirror BasePres
faithfully, where a literal presentation can carry references. The type is an inductive rather
than a structure because Lean structures may not be recursive; named accessors are defined just
below.
- mk (exports : List Cat) (terms : List Rule) (equations : List Equation) (rewrites : List RewriteDecl) (references : List (String × Presentation)) : Presentation
Instances For
Equations
Structural equality on presentations. Hand-written because Presentation nests through
List (String × Presentation) in references.
Equations
- (MeTTaIL.Presentation.mk e₁ t₁ q₁ r₁ m₁).beq (MeTTaIL.Presentation.mk e₂ t₂ q₂ r₂ m₂) = (e₁ == e₂ && t₁ == t₂ && q₁ == q₂ && r₁ == r₂ && MeTTaIL.Presentation.beqRefs m₁ m₂)
Instances For
Pointwise structural equality on reference maps.
Equations
Instances For
Equations
The exported sorts of a presentation (the generating shapes S).
Equations
- (MeTTaIL.Presentation.mk e terms equations rewrites references).exports = e
Instances For
The function symbols of a presentation (the set F, written as grammar rules).
Equations
- (MeTTaIL.Presentation.mk e terms equations rewrites references).terms = terms
Instances For
The equations of a presentation (the set E).
Equations
- (MeTTaIL.Presentation.mk e terms equations rewrites references).equations = equations
Instances For
The named rewrite rules of a presentation (the GSLT reduction rules).
Equations
- (MeTTaIL.Presentation.mk e terms equations rewrites references).rewrites = rewrites
Instances For
The references map of a presentation (declared prefix to sub-presentation).
Equations
- (MeTTaIL.Presentation.mk e terms equations rewrites references).references = references
Instances For
The empty presentation: no exports, terms, equations, rewrites, or references. Mirrors
BasePresOps.empty.