diff --git a/CHANGELOG.md b/CHANGELOG.md
index b70f6ae..4b592ce 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,12 +14,106 @@ versions may change the CLI, the `.lig` syntax, and the generated module API.
- a streaming parser option, `%option parseStr`. When a `%lexer` block is also present,
`
` takes the right-hand-side spans first. `ParserStartTree`,
+ `toStream` and the dependent `parse` take positioned tokens. `parse_eq_dependent`,
+ `parser_sound`, `parser_complete`, `parser_err_free` and `parser_ne_err` are stated on
+ positioned tokens with their real spans (`E.parse input`, not
+ `E.parse (input.map (⟨·, Span.dummy⟩))`); the tree value is
+ `Runtime.SpanGrammar.ptSem ⟨0⟩ tree`. `parser_unambiguous` takes a start position
+ (default byte 0) and also equates the spans. `parseStr_*` theorems state
+ `toStream ts` instead of `toStream (ts.map (·.val))`. No generated theorem takes `hspan`.
+- Breaking: the span of an empty right-hand side is the empty span at the end of the last
+ shifted token (byte 0 at the start), as in the Rust backend, instead of `Span.dummy`.
+ This changes `run` results and span values read by actions, not `parse` values of
+ span-free grammars.
+- Breaking (runtime API): `ExecTable.sem` and `FlatTable.sem` take the stack below the
+ popped cells (`Nat → Stack V → List V → V`); generated parsers define
+ `sem := Runtime.Exec.spanSem semV` with `semV : Nat → List Span → List V → V`.
+ `StackOps` has a new field `endPos` with the law `endPos_eq`; generated stacks define
+ `Stk.endPos` and `Stk.withTop`. `Runtime.Refinement.ExecRefinement` is over a
+ `SpanGrammar`, with the new fields `semV` and `sem_agrees`, and `semantic_agrees` takes a
+ span list. `Runtime.Refinement.Values` is now `Runtime.SpanGrammar.Values`.
+- Breaking: parse-tree constructors of `%option roundtrip_parser` build trees over
+ dummy-positioned words (`(w : List Tok).map Positioned.dummy`), their `_sem` lemmas are
+ stated for `SpanGrammar.ptSem pe`, and `Certificate.tree` is over
+ `(tokens ++ [EOF]).map Positioned.dummy` with `semantics : SpanGrammar.ptSem ⟨0⟩ tree = value`.
+- The dependent `parse` is evaluated by `decide +kernel` in tests; plain `decide` does not
+ finish on the derived span semantics.
+- Breaking: `parseStr_unambiguous` in ` : Stk V → Stk V` per production (as
@@ -409,9 +404,10 @@ def emitFuse (s : Surface) (e : TyEnv) (g' : IR.Grammar) (startState augProd : N
| none => s!"__s{i}"
-- A cell carries its span as two offsets `__b`/`__e`. The production
-- span starts where the first symbol starts and ends where the last one ends
- -- (`Span.merge`); an empty RHS gets the dummy span `0..0`, as in `emitSem`.
+ -- (`Span.fold`); an empty RHS gets the empty span at the end of the top cell
+ -- (`__e`, bound to `Stk.endPos __tail`), as `Runtime.Exec.spanSem` computes.
let foldSpan := fun (elems : Array Frontend.Elem) =>
- if elems.size == 0 then "⟨0⟩ ⟨0⟩"
+ if elems.size == 0 then "__e __e"
else s!"{spanName elems[0]! 0}__b {spanName elems[elems.size-1]! (elems.size-1)}__e"
let numN := g'.numNonterminals
let mut cmds : Array (TSyntax `command) := #[]
@@ -455,9 +451,14 @@ def emitFuse (s : Surface) (e : TyEnv) (g' : IR.Grammar) (startState augProd : N
lets ++
s!"Runtime.Exec.pushGotoWith gotoData {numN} {lhs} (Stk.top {startState} __tail) " ++
s!"{mk} {failv}"
+ -- An empty right-hand side reads the top state and the end of the top cell with one
+ -- match (`Stk.withTop`).
+ let pushEps :=
+ s!"Stk.withTop {startState} __tail (fun __top __e => {lets}" ++
+ s!"Runtime.Exec.pushGotoWith gotoData {numN} {lhs} __top {mk} {failv})"
let body :=
if alt.elems.isEmpty then
- s!"fun __tail => {push}"
+ s!"fun __tail => {pushEps}"
else
s!"fun stk => match stk with\n | {pat} => {push}\n | _ => .fail stk"
let name := s!"fuse{p}"
@@ -470,14 +471,15 @@ def emitFuse (s : Surface) (e : TyEnv) (g' : IR.Grammar) (startState augProd : N
-- stack, the cell, and `mk`; the remaining goals are closed by `rfl` (`hred`) or
-- `fun _ => rfl` (`hmk`, `hmkf`). `dsimp only` removes the action's `let`s.
let close := [
- s!" apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat {p}",
+ if alt.elems.isEmpty then s!" apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat {p}"
+ else s!" apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat {p}",
" all_goals first | exact fun _ => rfl | rfl"]
let proof :=
if alt.elems.isEmpty then
lines ([
s!"theorem fuseOK{p} : Runtime.Exec.FuseOKAt stackOps flat {p} fuse{p} := by",
" intro stk",
- s!" unfold fuse{p}",
+ s!" simp only [fuse{p}, Stk.withTop_eq]",
" · try dsimp only"] ++ close)
else
lines ([
@@ -719,7 +721,7 @@ def prepareGrammar (s : Surface) : Except String PreparedGrammar := do
/-- The `%option parseStr` entry points `runStream`/`parseStr` over the lexer namespace `l`,
and their theorems relating them to `runSrc`, `run`, `parse` and `Exec.run`. -/
-def emitStreamEntry (tokenType startTy startCtor l : String) (spanFree : Bool) : String :=
+def emitStreamEntry (tokenType startTy startCtor l : String) : String :=
let src := s!"(Lexer.pullSource (Lexer.pullAux {l}.cbyte input.toUTF8))\n" ++
s!" ⟨false, input.toUTF8.size + 1, 0, [{l}.cbyte.flat.base.start]⟩"
let args := s!"(ops := stackOps) flat fuse termOf {l}.cbyte {l}.fastActs"
@@ -769,21 +771,7 @@ def emitStreamEntry (tokenType startTy startCtor l : String) (spanFree : Bool) :
" · refine Or.inr ⟨ts, e, hF, fun tail => ?_⟩",
" rcases hr tail with h | h",
" · left; rw [h]",
- " · right; rw [h]" ] ++
- (if spanFree then "\n" ++ lines [
- "",
- "theorem semSpanFree : Runtime.Exec.SemSpanFree sem :=",
- " Runtime.Exec.SemSpanFree.of_split semS semV",
- "",
- "theorem parse_spanIndependent : Runtime.Exec.SpanIndependent (fun ts k => parse ts k) :=",
- " Runtime.Exec.SpanIndependent.of_run flat.toExecTable semSpanFree termOf valOf",
- s!" (fun r => match r with | .ok (.{startCtor} x) => some x | _ => none) (by",
- " intro ts k",
- " unfold parse run",
- " rw [Runtime.Exec.runFast_eq_run stackOps flat fuse termOf valOf stackLawful fuseOK]",
- " cases Runtime.Exec.run flat.toExecTable (ts.map (Runtime.Exec.decodeWith termOf valOf)) k with",
- " | ok v => obtain ⟨_, v⟩ := v; cases v <;> rfl",
- " | _ => rfl)" ] else "")
+ " · right; rw [h]" ]
/-- Render the parser backend from shared prepared construction data.
@@ -817,10 +805,7 @@ def generateFrom (s : Surface) (prepared : PreparedGrammar)
Quote.emitModule do
let valueTypeCmd ← emitValueType e
let decodeCmds ← emitDecoder s e g.numTerminals
- -- `sem` in split form, with the span-independence theorems, for a `%option parseStr` grammar
- -- whose actions read no span.
- let spanFree := s.options.parseStr && lexerModule.isSome && !actionsReadSpans s
- let semCmds ← emitSem s e augProd spanFree
+ let semCmds ← emitSem s e augProd
let (fuseCmds, fuseDispatch, fuseProofs) ← emitFuse s e g' startState augProd
let (stackDefs, stackLawful) := emitStack s e
let (tablePrefix, dataStr, tableTail) ← emitTable g' tables startState s.eof s.options.compressTables
@@ -882,7 +867,7 @@ def generateFrom (s : Surface) (prepared : PreparedGrammar)
s!" | .ok (_, .{startCtor} r) => some r",
s!" | _ => none" ]
let streamEntry := match streamLexer with
- | some l => emitStreamEntry s.tokenType startTy startCtor l spanFree
+ | some l => emitStreamEntry s.tokenType startTy startCtor l
| none => ""
-- Menhir-style diagnostics over the positioned engine: terminalName / diagnose
-- / diagnoseSpanned / errorMessage. EOF terminal index is `g.numTerminals`; the
diff --git a/LeanParserGenerator/Emit/CodegenLexer.lean b/LeanParserGenerator/Emit/CodegenLexer.lean
index b774872..2d9e5a6 100644
--- a/LeanParserGenerator/Emit/CodegenLexer.lean
+++ b/LeanParserGenerator/Emit/CodegenLexer.lean
@@ -140,6 +140,52 @@ def fastActStr (modeIdx : String → Option Nat) (r : LexerRule) : Except String
let binder := r.binder.getD "_"
return s!"⟨true, {tr}, fun ({binder} : String) => ({e})⟩"
+/-! ### Per-rule proofs -/
+
+/-- Whether a token expression is a constructor application of the token type, by its text:
+ `Tok.NAME …` or `.NAME …`. -/
+def isCtorExpr (tokTy e : String) : Bool :=
+ let e := e.trimAscii.toString
+ let e := if e.startsWith "(" then (e.drop 1).trimAscii.toString else e
+ e.startsWith (tokTy ++ ".") || e.startsWith "."
+
+/-- The leading identifier of a token expression (the helper it calls), if any. -/
+def headIdent (e : String) : String :=
+ let e := e.trimAscii.toString
+ let e := if e.startsWith "(" then (e.drop 1).trimAscii.toString else e
+ (e.takeWhile (fun c => c.isAlphanum || c == '_' || c == '.' || c == '\'')).toString
+
+/-- The proof that a rule's `FastAct` never emits the end-of-input token `eofTok`:
+ `f.emit = true → ∀ s, f.tok s ≠ eofTok`. A constructor application other than `eofTok`
+ is distinct from it by `nofun`. A call to a helper is first unfolded and split on its
+ branches, each of which must be a constructor application. If that fails, the proof
+ rewrites with the helper and every `def` of `%lexerheader` (`helpers`), splits, and closes
+ each branch with `simp_all`; this covers a helper that calls another header helper or
+ branches on a `let`. -/
+def noEofProof (tokTy : String) (helpers : List String) (r : LexerRule) : String :=
+ match r.emit with
+ | none => "(by intro h; cases h)"
+ | some e =>
+ if isCtorExpr tokTy e then "(fun _ _ => nofun)"
+ else
+ let h := headIdent e
+ let names := ", ".intercalate (h :: helpers.filter (· != h))
+ s!"(fun _ _ h => by first | (dsimp only at h; unfold {h} at h; (repeat' split at h) <;> contradiction) | (dsimp only at h; set_option linter.unusedSimpArgs false in simp [{names}] at h; (repeat' split at h) <;> simp_all))"
+
+/-- Whether every rule of a single-mode lexer stays in its mode. -/
+def singleModeStay (spec : LexerSpec) : Bool :=
+ spec.modes.size == 1 && spec.modes.all fun m => m.rules.all fun r =>
+ match r.trans with
+ | .stay => true
+ | _ => false
+
+/-- The end-of-input token constructor, when the grammar declares a valueless `%eof` token. -/
+def eofCtor (surface : Surface) : Option String :=
+ if surface.eof.isEmpty then none
+ else match surface.tokens.find? (·.name == surface.eof) with
+ | some t => if t.hasVal then none else some s!"{surface.tokenType}.{surface.eof}"
+ | none => none
+
/-! ### Module assembly -/
/-- Generate the `FooLexer.lean` source from a `.lig` surface with a `%lexer`
@@ -219,10 +265,102 @@ def generateLexerFrom (surface : Surface) (moduleName : String) :
s!" Lexer.flatValidate ({moduleName}.cflat.flats.getD {m} default)\n" ++
s!" ({moduleName}.cflat.base.dfas.getD {m} default) = true := by native_decide\n\n"))
let lexerHeaderBlock := if surface.lexerHeader.isEmpty then "" else surface.lexerHeader ++ "\n\n"
- let byteProofs := String.intercalate "" ((List.range modeData.size).map (fun m =>
- s!"theorem {moduleName}.byteValidated{m} :\n" ++
- s!" Lexer.byteValidate ({moduleName}.cbyte.bytes.getD {m} default)\n" ++
- s!" ({moduleName}.cflat.flats.getD {m} default) = true := by native_decide\n\n"))
+ -- Full-Unicode agreement of the byte tables with the flat tables, in every mode, and from it
+ -- `lexPos` = `tokenize` (docs/DESIGN.md §13).
+ let posAgree :=
+ s!"theorem {moduleName}.byteUnicodeValidated : Lexer.byteValidAll {moduleName}.cbyte = true := by\n" ++
+ s!" native_decide\n\n" ++
+ s!"/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the\n" ++
+ s!" same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/\n" ++
+ s!"theorem {moduleName}.posLexerAgrees : Lexer.PosLexerAgrees {moduleName}.cbyte {moduleName}.tokenize := by\n" ++
+ s!" intro s\n" ++
+ s!" rw [{moduleName}.tokenize_eq_flat]\n" ++
+ s!" exact Lexer.posLexerAgrees_of_byteValidAll {moduleName}.cbyte {moduleName}.byteUnicodeValidated s\n\n" ++
+ s!"/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/\n" ++
+ s!"theorem {moduleName}.tokenizeByte_toOption (s : String) :\n" ++
+ s!" ({moduleName}.tokenizeByte s).toOption = ({moduleName}.tokenize s).toOption.map (List.map (·.val)) :=\n" ++
+ s!" Lexer.tokenizeByte_toOption {moduleName}.cbyte {moduleName}.posLexerAgrees s\n\n"
+ -- No rule emits the end-of-input token: one proof per rule.
+ let helpers := Builder.headerDefs surface.lexerHeader
+ let noEof := match eofCtor surface with
+ | none => ""
+ | some eofTok =>
+ let chain := spec.modes.foldr (init := "Lexer.AllL.nil") fun mode accM =>
+ let inner := mode.rules.foldr (init := "Lexer.AllL.nil") fun r acc =>
+ s!"(Lexer.AllL.cons {noEofProof tokTy helpers r} {acc})"
+ s!"(Lexer.AllL.cons\n {inner}\n {accM})"
+ s!"/-- No rule emits the end-of-input token `{eofTok}`. -/\n" ++
+ s!"theorem {moduleName}.noEofEmit :\n" ++
+ s!" ∀ m r, ({moduleName}.fastActs.get m r).emit = true → ∀ s, ({moduleName}.fastActs.get m r).tok s ≠ {eofTok} :=\n" ++
+ s!" Lexer.FastActs.get_of_allL {moduleName}.fastActs\n" ++
+ s!" (fun f => f.emit = true → ∀ s, f.tok s ≠ {eofTok}) (by intro h; cases h)\n" ++
+ s!" {chain}\n\n"
+ -- Maximal-munch soundness of `tokenize`, for one mode whose rules all stay.
+ let soundBlock := if !singleModeStay spec then "" else
+ let mode := spec.modes[0]!
+ let stayChain := mode.rules.foldr (init := "Lexer.AllL.nil") fun _ acc =>
+ s!"(Lexer.AllL.cons rfl {acc})"
+ let textChain := mode.rules.foldr (init := "Lexer.Forall₂.nil") fun r acc =>
+ let pf := if r.binder.isSome && r.emit.isSome then "nofun" else "(fun _ _ => rfl)"
+ s!"(Lexer.Forall₂.cons {pf} {acc})"
+ s!"theorem {moduleName}.stay0 : ∀ r, ({moduleName}.fastActs.get 0 r).trans = Lexer.Trans.stay :=\n" ++
+ s!" Lexer.FastActs.get_of_allL {moduleName}.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl\n" ++
+ s!" (Lexer.AllL.cons {stayChain} Lexer.AllL.nil) 0\n\n" ++
+ s!"theorem {moduleName}.textIndep0 : ∀ r, {moduleName}.cflat.needsText 0 r = false →\n" ++
+ s!" ∀ s, ({moduleName}.fastActs.get 0 r).toAct s = ({moduleName}.fastActs.get 0 r).toAct \"\" :=\n" ++
+ s!" Lexer.FastActs.textIndep_of_forall₂ {moduleName}.fastActs ({moduleName}.cflat.textDep.getD 0 #[]) 0\n" ++
+ s!" {textChain}\n\n" ++
+ s!"/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec\n" ++
+ s!" tokenizer `Lexer.tokenize` returns the same token values. -/\n" ++
+ s!"theorem {moduleName}.tokenize_sound \{input : String} \{ts : List (Runtime.Positioned {tokTy})}\n" ++
+ s!" (h : {moduleName}.tokenize input = .ok ts) :\n" ++
+ s!" Lexer.Tokenization {moduleName}.rules0 input.toList ∧\n" ++
+ s!" Lexer.tokenize {moduleName}.lexer input = .ok (ts.map (·.val)) :=\n" ++
+ s!" Lexer.tokenizeFlatStrPos_sound {moduleName}.cflat {moduleName}.fastActs {moduleName}.fastActs_agree\n" ++
+ s!" {moduleName}.validated0 rfl {moduleName}.flatValidated0 (by decide) {moduleName}.stay0\n" ++
+ s!" {moduleName}.textIndep0 (by rw [← {moduleName}.tokenize_eq_flat]; exact h)\n\n" ++
+ s!"/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,\n" ++
+ s!" and the token values are the tokens of its steps. -/\n" ++
+ s!"theorem {moduleName}.tokenize_complete \{input : String} \{steps : List (Nat × Nat)}\n" ++
+ s!" (h : Lexer.Lexing {moduleName}.rules0 input.toList steps) :\n" ++
+ s!" ∃ ts, {moduleName}.tokenize input = .ok ts ∧\n" ++
+ s!" ts.map (·.val) = Lexer.lexingTokens {moduleName}.lexer {moduleName}.lexer.start input.toList steps := by\n" ++
+ s!" rw [{moduleName}.tokenize_eq_flat]\n" ++
+ s!" exact Lexer.tokenizeFlatStrPos_complete {moduleName}.cflat {moduleName}.fastActs {moduleName}.fastActs_agree\n" ++
+ s!" {moduleName}.validated0 rfl {moduleName}.flatValidated0 (by decide) {moduleName}.stay0\n" ++
+ s!" {moduleName}.textIndep0 h\n\n" ++
+ s!"/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each\n" ++
+ s!" token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/\n" ++
+ s!"abbrev {moduleName}.Lexes (s : String) (ts : List (Runtime.Positioned {tokTy})) : Prop :=\n" ++
+ s!" Lexer.PosLexing {moduleName}.rules0 (Lexer.modeAct {moduleName}.lexer {moduleName}.lexer.start)\n" ++
+ s!" {moduleName}.lexer.eofToken s s.startPos ts\n\n" ++
+ s!"/-- `tokenize` computes the positioned tokenization. -/\n" ++
+ s!"theorem {moduleName}.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned {tokTy})) :\n" ++
+ s!" {moduleName}.tokenize s = .ok ts ↔ {moduleName}.Lexes s ts := by\n" ++
+ s!" rw [{moduleName}.tokenize_eq_flat]\n" ++
+ s!" exact Lexer.tokenizeFlatStrPos_iff_posLexing' {moduleName}.cflat {moduleName}.fastActs\n" ++
+ s!" {moduleName}.fastActs_agree {moduleName}.validated0 rfl {moduleName}.flatValidated0 (by decide)\n" ++
+ s!" {moduleName}.stay0 {moduleName}.textIndep0 s ts\n\n" ++
+ s!"/-- The byte lexer `lexPos` computes the positioned tokenization. -/\n" ++
+ s!"theorem {moduleName}.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned {tokTy})) :\n" ++
+ s!" Lexer.lexPos {moduleName}.cbyte s = .ok ts ↔ {moduleName}.Lexes s ts :=\n" ++
+ s!" (Lexer.lexPos_ok_iff {moduleName}.posLexerAgrees s ts).trans ({moduleName}.tokenize_iff_lexes s ts)\n\n" ++
+ s!"/-- The positioned tokenization of a string is unique. -/\n" ++
+ s!"theorem {moduleName}.lexes_unique \{s : String} \{ts₁ ts₂ : List (Runtime.Positioned {tokTy})}\n" ++
+ s!" (h₁ : {moduleName}.Lexes s ts₁) (h₂ : {moduleName}.Lexes s ts₂) : ts₁ = ts₂ :=\n" ++
+ s!" Lexer.PosLexing.unique h₁ h₂\n\n" ++
+ (match eofCtor surface with
+ | none => ""
+ | some eofTok =>
+ s!"/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with\n" ++
+ s!" `{eofTok}` at the end of `s`, and no other token is `{eofTok}` (`noEofEmit`). -/\n" ++
+ s!"theorem {moduleName}.lexes_eof_last \{s : String} \{ts : List (Runtime.Positioned {tokTy})}\n" ++
+ s!" (h : {moduleName}.Lexes s ts) :\n" ++
+ s!" ∃ ts0, ts = ts0 ++ [⟨{eofTok}, Runtime.Span.point s.endPos.offset⟩] ∧\n" ++
+ s!" ∀ t ∈ ts0, t.val ≠ {eofTok} :=\n" ++
+ s!" Lexer.PosLexing.eof_last (eof := {eofTok}) (fun t => t ≠ {eofTok})\n" ++
+ s!" (Lexer.modeAct_emit_of_agrees {moduleName}.lexer {moduleName}.fastActs {moduleName}.fastActs_agree\n" ++
+ s!" _ {moduleName}.noEofEmit _) h\n\n")
let out :=
s!"module\n" ++
s!"-- Generated by leanparsergenerator from a .lig `%lexer` block. Do not edit.\n" ++
@@ -236,6 +374,9 @@ def generateLexerFrom (surface : Surface) (moduleName : String) :
"public import LeanParserGenerator.Lexer.DFA\n" ++
"public import LeanParserGenerator.Lexer.ByteScan\n" ++
"public import LeanParserGenerator.Lexer.FastAct\n" ++
+ "public import LeanParserGenerator.Lexer.ByteAgree\n" ++
+ "public import LeanParserGenerator.Lexer.LexerSound\n" ++
+ "public import LeanParserGenerator.Lexer.Lexing\n" ++
-- `native_decide` evaluates the DFA/flat/byte tables and the validators at the
-- meta phase, so the modules it reduces are also `meta`-imported. The plain
-- `public import`s above keep them available to the ordinary `cflat`/`cbyte`
@@ -245,7 +386,8 @@ def generateLexerFrom (surface : Surface) (moduleName : String) :
"meta import LeanParserGenerator.Lexer.ByteValidator\n" ++
"meta import LeanParserGenerator.Lexer.DFA\n" ++
"meta import LeanParserGenerator.Lexer.ByteScan\n" ++
- "meta import LeanParserGenerator.Lexer.FlatTokenize\n\n" ++
+ "meta import LeanParserGenerator.Lexer.FlatTokenize\n" ++
+ "meta import LeanParserGenerator.Lexer.ByteAgree\n\n" ++
Builder.publicizeImports header ++ "\n\n" ++
-- Large lexers (many-rule lexers) need a raised heartbeat/recursion budget for
-- the `native_decide` validations and the big literal certificate to elaborate.
@@ -292,9 +434,9 @@ def generateLexerFrom (surface : Surface) (moduleName : String) :
s!"theorem {moduleName}.fastActs_agree_byte :\n" ++
s!" Lexer.FastActs.Agrees {moduleName}.fastActs {moduleName}.cbyte.flat.base.acts :=\n" ++
s!" {moduleName}.fastActs_agree\n\n" ++
- byteProofs ++
s!"def {moduleName}.tokenizeByte (input : String) : Except Lexer.LexError (List {tokTy}) :=\n" ++
- s!" Lexer.tokenizeByte {moduleName}.cbyte input\n"
+ s!" Lexer.tokenizeByte {moduleName}.cbyte input\n\n" ++
+ ((posAgree ++ noEof ++ soundBlock).dropEnd 1).toString
return out
end Emit
diff --git a/LeanParserGenerator/Emit/CodegenParserRoundtrip.lean b/LeanParserGenerator/Emit/CodegenParserRoundtrip.lean
index 12ec8e0..264ebec 100644
--- a/LeanParserGenerator/Emit/CodegenParserRoundtrip.lean
+++ b/LeanParserGenerator/Emit/CodegenParserRoundtrip.lean
@@ -108,10 +108,11 @@ is unknown"
else s!"open Runtime {unparseNamespace}\n\n")
let parserPart :=
s!"/-- A parse tree certifying that `tokens` parse to `value`. The start tree\n" ++
- s!" includes the explicit EOF required by the augmented grammar. -/\n" ++
+ s!" includes the explicit EOF required by the augmented grammar. Its tokens carry\n" ++
+ s!" the dummy span, as the token generator produces no positions. -/\n" ++
s!"structure Certificate (tokens : List {tokTy}) (value : {startTy}) where\n" ++
- s!" tree : {verifiedName}.ParserStartTree (tokens ++ [{tokTy}.{surface.eof}])\n" ++
- s!" semantics : Runtime.Grammar.ptSem tree = value\n\n" ++
+ s!" tree : {verifiedName}.ParserStartTree ((tokens ++ [{tokTy}.{surface.eof}]).map Positioned.dummy)\n" ++
+ s!" semantics : Runtime.SpanGrammar.ptSem ⟨0⟩ tree = value\n\n" ++
s!"/-- Sufficient logarithmic fuel computed from the certified tree. -/\n" ++
"def Certificate.logFuel {tokens : List " ++ tokTy ++ "} {value : " ++ startTy ++ "}\n" ++
s!" (certificate : Certificate tokens value) : Nat :=\n" ++
diff --git a/LeanParserGenerator/Emit/CodegenVerified.lean b/LeanParserGenerator/Emit/CodegenVerified.lean
index ab8d64d..7abdf9e 100644
--- a/LeanParserGenerator/Emit/CodegenVerified.lean
+++ b/LeanParserGenerator/Emit/CodegenVerified.lean
@@ -37,6 +37,7 @@ instances.
public import LeanParserGenerator.Frontend.File
public import LeanParserGenerator.Construct.Annotate
public import LeanParserGenerator.Emit.Codegen
+public import LeanParserGenerator.Emit.CodegenLexer
public import LeanParserGenerator.Runtime.GrammarView
@@ -182,7 +183,7 @@ def emitVerifiedGrammarView (view : Runtime.VerifiedGrammarView) : String :=
read off one table indexed by symbol number (terminals first, then nonterminals).
Each table entry pairs the symbol's declared Lean type with its encoder into the
- executable parser's value type `VP` (or into `Unit` when no executable module is
+ executable parser's value type `V` (or into `Unit` when no executable module is
paired with this specification). Both `semT'` and the refinement's
`refinementEncodeValue` project from the same entry, so the encoder's argument
type is `semT' s` by definition, with no cast.
@@ -198,10 +199,10 @@ def emitSemTable (s : Surface) (g' : IR.Grammar) (ntNames : Array String)
let e := collectTypes s
let realStart := (s.ntIdx s.start).getD 0
let target := match execModule with
- | some m => s!"{m}.VP"
+ | some m => s!"{m}.V"
| none => "Unit"
let enc := fun (ty : String) => match execModule with
- | some _ => s!"fun v => (Runtime.Span.dummy, .{e.ctorFor ty} v)"
+ | some _ => s!"fun v => .{e.ctorFor ty} v"
| none => "fun _ => ()"
-- The ascription fixes the expected type: a bare user type name such as `And` can
-- otherwise be ambiguous with a root-namespace `Prop` connective.
@@ -237,8 +238,8 @@ def emitGrammar
let numT' := g'.numTerminals -- includes augmented `$`
let nP' := g'.prods.size
let pairTy := "NonTerminal × List (Symbol Terminal NonTerminal)"
- let sigmaTy := s!"(pr : {pairTy}) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')"
- let boxSigLeaf ← freshLeaf s!"(pr : {pairTy}) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ({sigmaTy})"
+ let sigmaTy := s!"(pr : {pairTy}) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))"
+ let boxSigLeaf ← freshLeaf s!"(pr : {pairTy}) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ({sigmaTy})"
let boxBodyLeaf ← freshLeaf "fun pr act => ⟨pr, act⟩"
let boxDef ← `(command| def $(mkIdent `box) : $boxSigLeaf := $boxBodyLeaf)
let mut cmds : Array (TSyntax `command) := #[boxDef]
@@ -275,18 +276,23 @@ def emitGrammar
let realStart := (s.ntIdx s.start).getD 0
if prod.lhs == g'.start then nontermTy s ntNames realStart
else nontermTy s ntNames prod.lhs
+ -- The action receives the right-hand-side spans first; it binds the span
+ -- variables it names (`x_span := __spans.getD i …`), as the executable `semV`.
+ let lets := Emit.spanLets elems action "__spans"
+ let spanLam := if lets.isEmpty then "fun (_ : List Runtime.Span) => "
+ else s!"fun (__spans : List Runtime.Span) => {lets}"
if binders.isEmpty then
-- Empty RHS: ascribe to the LHS type so a bare literal action (e.g. `{ 1 }`)
-- sees its real `OfNat`, not the stuck `arrowsRight (semT' NT) []` match.
- return s!"(({action}) : {lhsTy})"
+ return s!"{spanLam}(({action}) : {lhsTy})"
else
- return s!"{lam}({action})"
+ return s!"{spanLam}{lam}({action})"
else if pi == augProd then
- return "fun (_ : Unit) x => x"
+ return "fun (_ : List Runtime.Span) (_ : Unit) x => x"
else
- return "()"
+ return "fun (_ : List Runtime.Span) => ()"
let actNameId := mkIdent (Name.mkSimple actionName)
- let actSigLeaf ← freshLeaf s!"arrowsRight (semT' (.NT {lhsLit})) ({rhsLit}.map semT')"
+ let actSigLeaf ← freshLeaf s!"List Runtime.Span → arrowsRight (semT' (.NT {lhsLit})) ({rhsLit}.map semT')"
let actBodyLeaf ← freshLeaf actionExpr
cmds := cmds.push (← `(command| def $actNameId : $actSigLeaf := $actBodyLeaf))
let prodPat ← freshLeaf s!"⟨{pi}, _⟩"
@@ -305,7 +311,7 @@ def emitGrammar
let prodRhsSig ← freshLeaf "Production → List (Symbol Terminal NonTerminal)"
let prodRhsBody ← freshLeaf "fun p => (prodContents' p).1.2"
cmds := cmds.push (← `(command| def $(mkIdent `prodRhsRev') : $prodRhsSig := $prodRhsBody))
- let prodActSig ← freshLeaf "(p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT')"
+ let prodActSig ← freshLeaf "(p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT')"
let prodActBody ← freshLeaf "fun p => (prodContents' p).2"
cmds := cmds.push (← `(command| def $(mkIdent `prodAction') : $prodActSig := $prodActBody))
return cmds
@@ -578,7 +584,7 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
let numP := g'.prods.size
let realStart := (s.ntIdx s.start).getD 0
let encode := #[
- s!"def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : {execModule}.VP :=",
+ s!"def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : {execModule}.V :=",
" (semTbl.getD (symIdx s) semDefault).2 v"]
let valuesPattern := fun (length : Nat) =>
(List.range length).foldr (fun _ rest => s!".cons _ ({rest})") ".nil"
@@ -590,22 +596,22 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
let prod := s!"(⟨{p}, of_decide_eq_true rfl⟩ : Production)"
semantic := semantic ++ #[
s!"theorem refinementSemanticAgrees{p} :",
- s!" ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' {prod})),",
- s!" {execModule}.table.sem {p} (values.encode refinementEncodeValue).reverse =",
+ s!" ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' {prod})),",
+ s!" {execModule}.semV {p} spans (values.encode refinementEncodeValue).reverse =",
s!" refinementEncodeValue (.NT (prodLhs' {prod}))",
- s!" (values.apply (prodAction' {prod}))",
- s!" | {valuesPattern (g'.prods[p]!).rhs.length} => rfl",
+ s!" (values.apply (prodAction' {prod} spans))",
+ s!" | _, {valuesPattern (g'.prods[p]!).rhs.length} => rfl",
""]
semantic := semantic ++ #[
"theorem refinementSemanticAgrees :",
- " ∀ (production : Production)",
- " (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),",
- s!" {execModule}.table.sem production.val (values.encode refinementEncodeValue).reverse =",
+ " ∀ (production : Production) (spans : List Runtime.Span)",
+ " (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),",
+ s!" {execModule}.semV production.val spans (values.encode refinementEncodeValue).reverse =",
" refinementEncodeValue (.NT (prodLhs' production))",
- " (values.apply (prodAction' production))"]
+ " (values.apply (prodAction' production spans))"]
for p in [0:numP] do
- semantic := semantic.push s!" | ⟨{p}, _⟩, values => refinementSemanticAgrees{p} values"
- semantic := semantic.push s!" | ⟨n + {numP}, h⟩, _ => absurd h (by omega)"
+ semantic := semantic.push s!" | ⟨{p}, _⟩, spans, values => refinementSemanticAgrees{p} spans values"
+ semantic := semantic.push s!" | ⟨n + {numP}, h⟩, _, _ => absurd h (by omega)"
let fixed := lines [
s!"def refinementStateIndex : St → Nat",
@@ -713,17 +719,19 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
" simp only [Bool.and_eq_true] at checked",
" exact of_decide_eq_true checked.2",
"",
- "theorem refinementDecodeAgrees (token : grammarInst.Token) :",
- s!" {execModule}.decode ⟨token, Runtime.Span.dummy⟩ =",
- " (refinementTerminalIndex (tokenTerm' token),",
- " refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by",
+ s!"theorem refinementDecodeAgrees (token : Runtime.Positioned {s.tokenType}) :",
+ s!" {execModule}.decode token =",
+ " (refinementTerminalIndex (tokenTerm' token.val),",
+ " (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by",
+ " obtain ⟨token, span⟩ := token",
" cases token <;> rfl",
"",
- "def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)",
- (s!" (A := automatonInst) {execModule}.VP := " ++ "{"),
+ "def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)",
+ (s!" (A := automatonInst) {execModule}.V := " ++ "{"),
s!" table := {execModule}.table",
- s!" decode := fun t => {execModule}.decode ⟨t, Runtime.Span.dummy⟩",
- s!" eof := .{s.eof}",
+ s!" semV := {execModule}.semV",
+ s!" decode := {execModule}.decode",
+ s!" eof := ⟨.{s.eof}, Runtime.Span.dummy⟩",
" encodeValue := refinementEncodeValue",
" stateIndex := refinementStateIndex",
" terminalIndex := refinementTerminalIndex",
@@ -768,13 +776,14 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
" have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl",
" simpa [refinementProductionIndex, rhsDef] using",
" refinementProductionLengthAgrees production",
+ " sem_agrees := by rfl",
" semantic_agrees := by",
- " intro production values",
- " change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values",
- s!" change {execModule}.table.sem production.val (values.encode refinementEncodeValue).reverse =",
+ " intro production spans values",
+ " change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values",
+ s!" change {execModule}.semV production.val spans (values.encode refinementEncodeValue).reverse =",
" refinementEncodeValue (.NT (prodLhs' production))",
- " (values.apply (prodAction' production))",
- " exact refinementSemanticAgrees production values",
+ " (values.apply (prodAction' production spans))",
+ " exact refinementSemanticAgrees production spans values",
"}",
"",
"theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :",
@@ -782,21 +791,21 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
" (⟨0, of_decide_eq_true rfl⟩ : InitState)",
" (Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)",
" (Runtime.Refinement.listStream executableRefinement input) logNSteps)",
- s!" ({execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by",
- s!" have hrun : {execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps",
+ s!" ({execModule}.run input logNSteps) := by",
+ s!" have hrun : {execModule}.run input logNSteps",
s!" = Runtime.Exec.run {execModule}.table (input.map executableRefinement.decode) logNSteps := by",
s!" simp only [{execModule}.run]",
s!" rw [Runtime.Exec.runFast_eq_run {execModule}.stackOps {execModule}.flat {execModule}.fuse",
s!" {execModule}.termOf {execModule}.valOf {execModule}.stackLawful {execModule}.fuseOK]",
- s!" simp only [{execModule}.table, executableRefinement, List.map_map]",
" rfl",
" rw [hrun]",
- " simpa [executableRefinement] using",
- " Runtime.Refinement.run_refines executableRefinement safety",
- " (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps",
+ " exact Runtime.Refinement.run_refines executableRefinement safety",
+ " (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps",
"",
+ "/-- **Refinement.** The executable parser returns the value the dependent parser returns, on",
+ " the same positioned tokens. -/",
"theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :",
- s!" {execModule}.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by",
+ s!" {execModule}.parse input logNSteps = parse input logNSteps := by",
" have related := parserRunRefines input logNSteps",
s!" unfold {execModule}.parse parse",
" have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl",
@@ -804,49 +813,51 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
" generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)",
" (Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent",
" at related ⊢",
- s!" generalize hExec : {execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢",
+ s!" generalize hExec : {execModule}.run input logNSteps = executable at related ⊢",
" cases related <;> rfl",
"",
"abbrev ParserStartTree (word : List grammarInst.Token) :=",
" Grammar.ParseTree (G := grammarInst)",
" (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word",
"",
+ "/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,",
+ " at the start of the input, is the result. -/",
"theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)",
s!" (semantic : {nontermTy s s.ntNames realStart})",
- s!" (accepted : {execModule}.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :",
+ s!" (accepted : {execModule}.parse input logNSteps = some semantic) :",
" ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)",
" (rest : Runtime.NatStream grammarInst.Token),",
" toStream input = Runtime.NatStream.appList word rest ∧",
- " Grammar.ptSem tree = semantic := by",
+ " SpanGrammar.ptSem ⟨0⟩ tree = semantic := by",
" rw [parse_eq_dependent] at accepted",
" unfold parse at accepted",
+ " have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)",
+ " (S := Runtime.NatStream grammarInst.Token)",
+ " (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps",
" generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)",
- " (toStream input) logNSteps = result at accepted",
+ " (toStream input) logNSteps = result at accepted sound",
" cases result with",
" | Fail state token => cases accepted",
" | Timeout => cases accepted",
" | Err message => cases accepted",
" | Parsed value rest =>",
- " have valueEq : value = semantic := Option.some.inj accepted",
- " have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)",
- " (S := Runtime.NatStream grammarInst.Token)",
- " (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps",
- " rw [hResult] at sound",
+ " have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted",
" obtain ⟨word, tree, inputEq, semanticEq⟩ := sound",
- " exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩",
+ " refine ⟨word, tree, rest, inputEq, ?_⟩",
+ " rw [← valueEq, semanticEq]",
"",
"theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :",
- s!" Runtime.Exec.ResultErrFree ({execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by",
+ s!" Runtime.Exec.ResultErrFree ({execModule}.run input logNSteps) := by",
" have related := parserRunRefines input logNSteps",
" change Runtime.Refinement.ResultRel executableRefinement",
" (⟨0, of_decide_eq_true rfl⟩ : InitState)",
" (Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)",
- s!" ({execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related",
+ s!" ({execModule}.run input logNSteps) at related",
" have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)",
" safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps",
" generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)",
" (toStream input) logNSteps = dependent at related dependentFree",
- s!" generalize hParser : {execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢",
+ s!" generalize hParser : {execModule}.run input logNSteps = result at related ⊢",
" cases related with",
" | fail state token => trivial",
" | parsed value stream => trivial",
@@ -855,7 +866,7 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
"",
"theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)",
" (message : String) :",
- s!" {execModule}.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by",
+ s!" {execModule}.run input logNSteps ≠ .err message := by",
" intro isError",
" have errorFree := parser_err_free input logNSteps",
" rw [isError] at errorFree",
@@ -871,13 +882,15 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
" | zero => rfl",
" | succ index => exact ih index",
"",
+ "/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the",
+ " fuel covers the tree's size. -/",
"theorem parser_complete {word : List grammarInst.Token}",
" (tree : ParserStartTree word) (logNSteps : Nat)",
" (fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :",
- s!" {execModule}.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by",
+ s!" {execModule}.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by",
" rw [parse_eq_dependent]",
" unfold parse",
- " have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)",
+ " have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)",
" (S := Runtime.NatStream grammarInst.Token) completeness",
" (⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree",
" rw [← toStream_eq_appList] at complete",
@@ -887,34 +900,47 @@ def emitRefinement (s : Surface) (g' : IR.Grammar) (execModule : String) : Strin
" | Fail state token => exact complete.elim",
" | Err message => exact complete.elim",
" | Timeout => omega",
- " | Parsed semantic rest => exact congrArg some complete.1",
+ " | Parsed semantic rest =>",
+ " have h0 := complete.1 ⟨0⟩",
+ " show some (semantic ⟨0⟩).2 = _",
+ " rw [h0]",
"",
+ "/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and",
+ " value (at every start position `pe`). -/",
"theorem parser_unambiguous {word : List grammarInst.Token}",
- " (tree1 tree2 : ParserStartTree word) :",
- " Grammar.ptSem tree1 = Grammar.ptSem tree2 := by",
- s!" letI : Inhabited grammarInst.Token := ⟨.{s.eof}⟩",
- " exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)",
- " completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2"
+ " (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :",
+ " SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧",
+ " SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by",
+ s!" letI : Inhabited {s.tokenType} := ⟨.{s.eof}⟩",
+ " exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)",
+ " completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe"
+
]
paras [lines encode.toList, lines semantic.toList, fixed]
/-- Emit token leaves and one source-order parse-tree constructor per production,
with a `ptSem` equation for each production. These helpers hide terminal and
production `Fin` witnesses plus the reversed `ParseTreeList` representation
- from handwritten certificates. They are generated only when
- `%option roundtrip_parser` is enabled. -/
+ from handwritten certificates. They build trees over dummy-positioned words
+ (`(w : List Tok).map Positioned.dummy`), the words a token generator produces: a
+ production constructor takes its children over `wordᵢ.map Positioned.dummy` and
+ returns a tree over `(word₀ ++ … ++ wordₙ).map Positioned.dummy`. A terminal leaf
+ takes its span as an argument (`Span.dummy` by default). They are generated only
+ when `%option roundtrip_parser` is enabled. -/
def emitParseTreeConstructors (s : Surface) (g' : IR.Grammar) (_augProd : Nat) : String :=
if s.options.roundtripParser.isNone then "" else
let eofTerm := g'.numTerminals - 1
let tokTy := s.tokenType
+ let posTy := s!"Runtime.Positioned {tokTy}"
let tokenBlocks := s.tokens.toList.zipIdx.map fun (decl, index) =>
let term := if decl.name == s.eof then eofTerm else index
- let args := if decl.hasVal then s!"\n (value : {decl.ty})" else ""
- let token := if decl.hasVal then s!"{tokTy}.{decl.name} value" else s!"{tokTy}.{decl.name}"
+ let args := (if decl.hasVal then s!"\n (value : {decl.ty})" else "") ++
+ "\n (span : Runtime.Span := Runtime.Span.dummy)"
+ let token := if decl.hasVal then s!"⟨{tokTy}.{decl.name} value, span⟩" else s!"⟨{tokTy}.{decl.name}, span⟩"
s!"/-- Terminal parse tree for `{decl.name}` with its concrete grammar index. -/\n" ++
s!"noncomputable def parseTreeToken{decl.name}{args} :\n" ++
s!" Grammar.ParseTree (G := grammarInst)\n" ++
- s!" (.T (⟨{term}, of_decide_eq_true rfl⟩ : Terminal)) [{token}] :=\n" ++
+ s!" (.T (⟨{term}, of_decide_eq_true rfl⟩ : Terminal)) [({token} : {posTy})] :=\n" ++
s!" Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)\n" ++
s!" (.terminal (G := grammarInst) ({token}))"
let blocks := (List.range g'.prods.size).map fun pi => Id.run do
@@ -922,20 +948,26 @@ def emitParseTreeConstructors (s : Surface) (g' : IR.Grammar) (_augProd : Nat) :
let production := s!"(⟨{pi}, of_decide_eq_true rfl⟩ : Production)"
let mut args : List String := []
let mut callArgs : List String := []
+ -- `words`: the source-level words (`List Tok`); `posWords`: the words of the
+ -- children of the inner tree, as `ParseTreeList.cons` builds them.
let mut words : List String := []
+ let mut posWords : List String := []
let mut trees : List String := []
let mut semantics : List String := []
for (sym, i) in prod.rhs.zipIdx do
+ let before := s!"([] : List ({posTy}))" ++ String.join (posWords.map (" ++ " ++ ·))
+ let pe := s!"(Runtime.Positioned.wordEnd pe ({before}))"
match sym with
| .nonterm nt =>
let word := s!"word{i}"
let tree := s!"tree{i}"
args := args ++ ["{" ++ word ++ " : List " ++ tokTy ++ "}",
- s!"({tree} : Grammar.ParseTree (G := grammarInst)\n (.NT (⟨{nt}, of_decide_eq_true rfl⟩ : NonTerminal)) {word})"]
+ s!"({tree} : Grammar.ParseTree (G := grammarInst)\n (.NT (⟨{nt}, of_decide_eq_true rfl⟩ : NonTerminal)) ({word}.map Runtime.Positioned.dummy))"]
words := words ++ [word]
+ posWords := posWords ++ [s!"{word}.map Runtime.Positioned.dummy"]
trees := trees ++ [tree]
callArgs := callArgs ++ [tree]
- semantics := semantics ++ [s!"Grammar.ptSem {tree}"]
+ semantics := semantics ++ [s!"SpanGrammar.ptSem {pe} {tree}"]
| .term term =>
let tokenName := if term == eofTerm then s.eof else (s.tokens[term]!).name
let tokenDecl := if term == eofTerm then none else s.tokens[term]?
@@ -958,98 +990,86 @@ def emitParseTreeConstructors (s : Surface) (g' : IR.Grammar) (_augProd : Nat) :
| some decl => if decl.hasVal then s!" {value}" else ""
| none => "")
words := words ++ [s!"[{token}]"]
+ posWords := posWords ++ [s!"[Runtime.Positioned.dummy ({token})]"]
trees := trees ++ [s!"({tokenTree})"]
- let word := if words.isEmpty then "[]" else String.intercalate " ++ " words
+ let word := if words.isEmpty then s!"([] : List {tokTy})" else String.intercalate " ++ " words
let treeList := trees.foldl (fun rest tree => s!".cons ({rest}) ({tree})") ".nil"
let argsText := if args.isEmpty then "" else "\n " ++ String.intercalate "\n " args
+ let semArgsText := "\n " ++ String.intercalate "\n " (args ++ ["(pe : String.Pos.Raw)"])
let call := if callArgs.isEmpty then s!"parseTreeProduction{pi}"
else s!"parseTreeProduction{pi} " ++ String.intercalate " " callArgs
let actionArgs := semantics.reverse.map fun value => "(" ++ value ++ ")"
- let action := String.intercalate " " ([s!"semanticAction{pi}"] ++ actionArgs)
+ let spansArg := s!"(SpanGrammar.ptlSpans (SG := spanGrammarInst) pe ({treeList}))"
+ let action := String.intercalate " " ([s!"semanticAction{pi}", spansArg] ++ actionArgs)
let reductions := String.intercalate ", " <|
- ["Grammar.ptSem_nonTerminal"] ++
- List.replicate prod.rhs.length "Grammar.ptlSem_cons" ++
- ["Grammar.ptlSem_nil"]
+ ["SpanGrammar.ptSem_castWord", "SpanGrammar.ptSem_nonTerminal"] ++
+ List.replicate prod.rhs.length "SpanGrammar.ptlSem_cons" ++
+ ["SpanGrammar.ptlSem_nil"]
return s!"/-- Parse-tree constructor for production {pi}, in source RHS order. -/\n" ++
s!"noncomputable def parseTreeProduction{pi}{argsText} :\n" ++
s!" Grammar.ParseTree (G := grammarInst)\n" ++
s!" (.NT (⟨{prod.lhs}, of_decide_eq_true rfl⟩ : NonTerminal))\n" ++
- s!" ({word}) :=\n" ++
- s!" .nonTerminal (G := grammarInst) {production} ({treeList})\n\n" ++
- s!"@[simp] theorem parseTreeProduction{pi}_sem{argsText} :\n" ++
- s!" Grammar.ptSem ({call}) = {action} := by\n" ++
+ s!" (({word}).map Runtime.Positioned.dummy) :=\n" ++
+ s!" SpanGrammar.castWord (SG := spanGrammarInst) (by simp)\n" ++
+ s!" (.nonTerminal (G := grammarInst) {production} ({treeList}))\n\n" ++
+ s!"@[simp] theorem parseTreeProduction{pi}_sem{semArgsText} :\n" ++
+ s!" SpanGrammar.ptSem pe ({call}) = {action} := by\n" ++
s!" unfold parseTreeProduction{pi}\n" ++
s!" erw [{reductions}]\n" ++
s!" with_unfolding_all rfl"
String.intercalate "\n\n" tokenBlocks ++ "\n\n" ++
String.intercalate "\n\n" blocks ++ "\n"
-/-- The `%option parseStr` hypotheses and the theorems moving the `parse` results to the
- executable parser `E`'s `parseStr`, over the lexer namespace `l`. -/
-def emitStreamTransfer (tokenType startTy E l : String) (spanFree : Bool) : String :=
+/-- The `%option parseStr` theorems moving the `parse` results to the executable parser `E`'s
+ `parseStr`, over the lexer namespace `l`. `PosLexerAgrees` is a theorem of the lexer
+ module. `eofCtor`: the end-of-input token constructor, when the lexer module proves that no
+ rule emits it (`noEofEmit`); then the lex-failure case is closed. `tokSound`: the lexer
+ module proves `tokenize_sound` (one mode whose rules all stay). -/
+def emitStreamTransfer (tokenType startTy E l : String) (eofIdx : Nat)
+ (eofCtor : Option String) (tokSound : Bool) : String :=
let posToks := s!"List (Runtime.Positioned {tokenType})"
- let hs := lines [
- s!" have hs : {E}.parse ts k = {E}.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=",
- if spanFree then " spanIndependent ts k" else " hspan ts k" ]
- let hspanArg := if spanFree then "" else "(hspan : SpanIndependent) "
- let spanDoc := if spanFree then
- s!"/-- `{E}.parse` ignores token spans. Proved as `spanIndependent`. -/"
- else
- s!"/-- `{E}.parse` ignores token spans. Stated, not proved; false when an action reads `x_span`. -/"
- let spanProof := if spanFree then [
- "", "",
- s!"theorem spanIndependent : SpanIndependent := {E}.parse_spanIndependent",
- "",
- s!"theorem parse_eq_dependent_spans (input : {posToks}) (k : Nat) :",
- s!" {E}.parse input k = parse (input.map (·.val)) k := by",
- s!" have hs : {E}.parse input k = {E}.parse (input.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=",
- " spanIndependent input k",
- " rw [hs, ← parse_eq_dependent (input.map (·.val)) k, List.map_map]",
- " rfl" ]
- else []
let hp := lines [
- s!" have hp : Lexer.lexPos {l}.cbyte s = .ok ts := by",
- " have hagree := hlex s",
- " rw [h] at hagree",
- " revert hagree",
- s!" cases Lexer.lexPos {l}.cbyte s with",
- " | error e => intro hc; simp [Except.toOption] at hc",
- " | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]" ]
- lines [
- s!"/-- `lexPos` and `{l}.tokenize` succeed on the same inputs with the same tokens. Stated, not proved. -/",
+ s!" have hp : Lexer.lexPos {l}.cbyte s = .ok ts := lexPos_eq_of_tokenize s ts h" ]
+ let startSemR := "SpanGrammar.semR (SG := spanGrammarInst) (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState)))"
+ let base := lines [
+ s!"/-- `lexPos` and `{l}.tokenize` succeed on the same inputs with the same tokens. Proved as",
+ " `posLexerAgrees`. -/",
s!"abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees {l}.cbyte {l}.tokenize",
"",
- spanDoc,
- s!"abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => {E}.parse ts k)"] ++
- lines spanProof ++ "\n" ++ lines [
+ s!"theorem posLexerAgrees : PosLexerAgrees := {l}.posLexerAgrees",
+ "",
+ s!"theorem lexPos_eq_of_tokenize (s : String) (ts : {posToks}) (h : {l}.tokenize s = .ok ts) :",
+ s!" Lexer.lexPos {l}.cbyte s = .ok ts := by",
+ " have hagree := posLexerAgrees s",
+ " rw [h] at hagree",
+ " revert hagree",
+ s!" cases Lexer.lexPos {l}.cbyte s with",
+ " | error e => intro hc; simp [Except.toOption] at hc",
+ " | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]",
"",
- s!"theorem parseStr_eq (hlex : PosLexerAgrees) (s : String) (k : Nat) (ts : {posToks})",
+ s!"theorem parseStr_eq (s : String) (k : Nat) (ts : {posToks})",
s!" (h : {l}.tokenize s = .ok ts) : {E}.parseStr s k = {E}.parse ts k := by",
hp,
s!" exact {E}.parseStr_eq_lexPos s k ts hp",
"",
- s!"theorem parseStr_eq_dependent {hspanArg}(hlex : PosLexerAgrees) (s : String)",
+ "theorem parseStr_eq_dependent (s : String)",
s!" (k : Nat) (ts : {posToks}) (h : {l}.tokenize s = .ok ts) :",
- s!" {E}.parseStr s k = parse (ts.map (·.val)) k := by",
- hs,
- " rw [parseStr_eq hlex s k ts h, hs, ← parse_eq_dependent (ts.map (·.val)) k, List.map_map]",
- " rfl",
+ s!" {E}.parseStr s k = parse ts k := by",
+ " rw [parseStr_eq s k ts h, parse_eq_dependent]",
"",
- s!"theorem parseStr_sound {hspanArg}(hlex : PosLexerAgrees) (s : String)",
+ "theorem parseStr_sound (s : String)",
s!" (k : Nat) (ts : {posToks}) (h : {l}.tokenize s = .ok ts) (p : {startTy})",
s!" (accepted : {E}.parseStr s k = some p) :",
" ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)",
" (rest : Runtime.NatStream grammarInst.Token),",
- " toStream (ts.map (·.val)) = Runtime.NatStream.appList word rest ∧",
- " Grammar.ptSem tree = p := by",
- hs,
- " rw [parseStr_eq hlex s k ts h, hs] at accepted",
- " exact parser_sound (ts.map (·.val)) k p",
- " (by simpa [List.map_map, Function.comp_def] using accepted)",
+ " toStream ts = Runtime.NatStream.appList word rest ∧",
+ " SpanGrammar.ptSem ⟨0⟩ tree = p := by",
+ " rw [parseStr_eq s k ts h] at accepted",
+ " exact parser_sound ts k p accepted",
"",
"/-- When `tokenize` fails, the byte lexer delivers a prefix `ts` and fails, and `parseStr`",
" is `none` or `parse` of an extension of `ts`. -/",
- "theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat)",
+ "theorem parseStr_of_tokenize_error (s : String) (k : Nat)",
s!" (e : Lexer.LexError) (h : {l}.tokenize s = .error e) :",
s!" ∃ ts e', Runtime.Exec.Fails (Lexer.pullSource (Lexer.pullAux {l}.cbyte s.toUTF8))",
s!" ⟨false, s.toUTF8.size + 1, 0, [{l}.cbyte.flat.base.start]⟩ ts e' ∧",
@@ -1058,10 +1078,285 @@ def emitStreamTransfer (tokenType startTy E l : String) (spanFree : Bool) : Stri
" · exfalso",
s!" have hp : Lexer.lexPos {l}.cbyte s = .ok ts :=",
s!" Lexer.lexPosAux_of_denotes {l}.cbyte s.toUTF8 _ _ _ ts hD",
- " have hagree := hlex s",
+ " have hagree := posLexerAgrees s",
" rw [hp, h] at hagree",
" simp [Except.toOption] at hagree",
" · exact hF" ]
+ let failBlock := match eofCtor with
+ | none => ""
+ | some eof => "\n\n" ++ lines [
+ "/-- Every production of the start symbol has the end marker `$` on its right-hand side. -/",
+ "theorem startProds_end : ∀ p : Production,",
+ " prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →",
+ s!" Symbol.T (⟨{eofIdx}, of_decide_eq_true rfl⟩ : Terminal) ∈ prodRhsRev' p := by",
+ " native_decide",
+ "",
+ s!"theorem tokenTerm_eq_end (t : {tokenType})",
+ s!" (h : tokenTerm' t = (⟨{eofIdx}, of_decide_eq_true rfl⟩ : Terminal)) : t = .{eof} := by",
+ " cases t <;> first | rfl | exact absurd (congrArg Fin.val h) (Nat.ne_of_beq_eq_false rfl)",
+ "",
+ s!"/-- The dependent parser does not accept a token list with no `{eof}` that is longer than",
+ " `2^k`: it has not reached the end marker. -/",
+ s!"theorem dependent_ne_parsed_of_no_eof (input : {posToks}) (k : Nat)",
+ s!" (hin : ∀ t ∈ input, t.val ≠ .{eof}) (hlen : 2 ^ k < input.length)",
+ s!" (r : {startSemR})",
+ " (rest : Runtime.NatStream grammarInst.Token) :",
+ " Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)",
+ " (toStream input) k ≠ .Parsed r rest :=",
+ " Runtime.parse_ne_parsed_of_no_end (G := grammarInst) (A := automatonInst) _ _",
+ s!" startProds_end input ⟨.{eof}, Runtime.Span.dummy⟩ rfl",
+ " (fun t ht he => hin t ht (tokenTerm_eq_end t.val he)) k hlen r rest",
+ "",
+ s!"theorem parse_eq_none_of_no_eof (input : {posToks}) (k : Nat)",
+ s!" (hin : ∀ t ∈ input, t.val ≠ .{eof}) (hlen : 2 ^ k < input.length) : parse input k = none := by",
+ " unfold parse",
+ " cases hp : Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)",
+ " (toStream input) k with",
+ " | Parsed r rest => exact absurd hp (dependent_ne_parsed_of_no_eof input k hin hlen r rest)",
+ " | _ => rfl",
+ "",
+ s!"/-- A prefix of lexed tokens with no `{eof}`, padded with copies of its first token. -/",
+ s!"theorem no_eof_pad (t0 : Runtime.Positioned {tokenType}) (ts : {posToks})",
+ s!" (hts : ∀ t ∈ t0 :: ts, t.val ≠ .{eof}) (k : Nat) :",
+ s!" (∀ t ∈ t0 :: ts ++ List.replicate (2 ^ k + 1) t0, t.val ≠ .{eof}) ∧",
+ " 2 ^ k < (t0 :: ts ++ List.replicate (2 ^ k + 1) t0).length := by",
+ " constructor",
+ " · intro x hx",
+ " rcases List.mem_append.mp hx with hx | hx",
+ " · exact hts x hx",
+ " · rw [List.eq_of_mem_replicate hx]; exact hts t0 (List.mem_cons_self ..)",
+ " · simp only [List.length_append, List.length_replicate, List.length_cons]",
+ " omega",
+ "",
+ "/-- **Lex failure.** When the positioned byte lexer fails, `parseStr` is `none`. -/",
+ "theorem parseStr_eq_none_of_lexPos (s : String) (k : Nat)",
+ s!" (h : ∀ ts, Lexer.lexPos {l}.cbyte s ≠ .ok ts) : {E}.parseStr s k = none := by",
+ s!" rcases {E}.parseStr_total s k with ⟨ts, hD, _⟩ | ⟨ts, e, hF, hr⟩",
+ s!" · exact absurd (Lexer.lexPosAux_of_denotes {l}.cbyte s.toUTF8 _ _ _ ts hD) (h ts)",
+ s!" · have htoks : ∀ t ∈ ts, t.val ≠ .{eof} :=",
+ s!" Lexer.pullSource_fails_tokens {l}.cbyte {l}.fastActs {l}.fastActs_agree_byte",
+ s!" (fun t => t ≠ .{eof}) {l}.noEofEmit s.toUTF8 _ ts e hF",
+ " cases ts with",
+ " | nil =>",
+ " cases hF with",
+ " | err hn =>",
+ s!" unfold {E}.parseStr",
+ s!" rw [{E}.runStream_eq_runSrc]",
+ " unfold Runtime.Exec.runSrc",
+ " rw [hn]",
+ " | cons t0 rest =>",
+ " rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1",
+ " · exact h1",
+ " · rw [h1, parse_eq_dependent]",
+ " obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k",
+ " exact parse_eq_none_of_no_eof _ k hin hlen",
+ "",
+ "/-- **Lex failure.** When `tokenize` fails, `parseStr` is `none`. -/",
+ "theorem parseStr_eq_none_of_tokenize_error (s : String) (k : Nat)",
+ s!" (e : Lexer.LexError) (h : {l}.tokenize s = .error e) : {E}.parseStr s k = none :=",
+ " parseStr_eq_none_of_lexPos s k (fun ts hts => by",
+ " have hagree := posLexerAgrees s",
+ " rw [hts, h] at hagree",
+ " simp [Except.toOption] at hagree)",
+ "",
+ "/-- **Lex failure, stream engine.** When `tokenize` fails, `runStream` does not accept. It may",
+ " reject or run out of steps before it reaches the lex error, so the result need not be",
+ " `.err`. -/",
+ s!"theorem runStream_ne_ok_of_tokenize_error (s : String) (k : Nat) (e : Lexer.LexError)",
+ s!" (h : {l}.tokenize s = .error e) : ∀ v, {E}.runStream s k ≠ .ok v := by",
+ " intro v hok",
+ s!" have hlex : ∀ ts, Lexer.lexPos {l}.cbyte s ≠ .ok ts := fun ts hts => by",
+ " have hagree := posLexerAgrees s",
+ " rw [hts, h] at hagree",
+ " simp [Except.toOption] at hagree",
+ s!" unfold {E}.runStream at hok",
+ s!" rcases Lexer.runStreamFast_total (ops := {E}.stackOps) {E}.flat {E}.fuse {E}.termOf {l}.cbyte",
+ s!" {l}.fastActs {l}.fastActs_agree_byte s (2 ^ k) with ⟨ts, hD, _⟩ | ⟨ts, e', hF, hr⟩",
+ s!" · exact hlex ts (Lexer.lexPosAux_of_denotes {l}.cbyte s.toUTF8 _ _ _ ts hD)",
+ s!" · have htoks : ∀ t ∈ ts, t.val ≠ .{eof} :=",
+ s!" Lexer.pullSource_fails_tokens {l}.cbyte {l}.fastActs {l}.fastActs_agree_byte",
+ s!" (fun t => t ≠ .{eof}) {l}.noEofEmit s.toUTF8 _ ts e' hF",
+ " cases ts with",
+ " | nil =>",
+ " cases hF with",
+ " | err hn =>",
+ s!" rw [Lexer.runStreamFast_eq_runSrc (ops := {E}.stackOps) {E}.flat {E}.fuse {E}.termOf",
+ s!" {l}.cbyte {l}.fastActs {l}.fastActs_agree_byte] at hok",
+ " unfold Runtime.Exec.runSrc at hok",
+ " rw [hn] at hok",
+ " cases hok",
+ " | cons t0 rest =>",
+ " rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1",
+ " · rw [h1] at hok; cases hok",
+ " · rw [h1] at hok",
+ " obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k",
+ " have related := parserRunRefines (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k",
+ s!" have hw : {E}.run (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k = .ok v := hok",
+ " rw [hw] at related",
+ " generalize hdep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)",
+ " (Runtime.Refinement.listStream executableRefinement",
+ " (t0 :: rest ++ List.replicate (2 ^ k + 1) t0)) k = dep at related",
+ " cases related with",
+ " | parsed value stream =>",
+ " exact dependent_ne_parsed_of_no_eof _ k hin hlen value stream hdep",
+ "",
+ "/-- **End to end.** If `parseStr` accepts `s` with value `p`, then `tokenize` lexes `s` to",
+ " `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/",
+ s!"theorem parseStr_sound_tokenize (s : String) (k : Nat) (p : {startTy})",
+ s!" (accepted : {E}.parseStr s k = some p) :",
+ s!" ∃ ts, {l}.tokenize s = .ok ts ∧",
+ " ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)",
+ " (rest : Runtime.NatStream grammarInst.Token),",
+ " toStream ts = Runtime.NatStream.appList word rest ∧",
+ " SpanGrammar.ptSem ⟨0⟩ tree = p := by",
+ s!" cases ht : {l}.tokenize s with",
+ " | error e =>",
+ " rw [parseStr_eq_none_of_tokenize_error s k e ht] at accepted",
+ " cases accepted",
+ " | ok ts => exact ⟨ts, rfl, parseStr_sound s k ts ht p accepted⟩" ] ++
+ (if !tokSound then "" else "\n\n" ++ lines [
+ "/-- **End to end, with the lexer specification.** If `parseStr` accepts `s` with value `p`,",
+ " then `s` has a maximal-munch tokenization (`Lexer.Tokenization`), the spec tokenizer",
+ " returns the token values of `ts = tokenize s`, and `ts` starts with the word of a parse",
+ " tree whose value is `p`. -/",
+ s!"theorem parseStr_sound_tokenization (s : String) (k : Nat) (p : {startTy})",
+ s!" (accepted : {E}.parseStr s k = some p) :",
+ s!" ∃ ts, {l}.tokenize s = .ok ts ∧ Lexer.Tokenization {l}.rules0 s.toList ∧",
+ s!" Lexer.tokenize {l}.lexer s = .ok (ts.map (·.val)) ∧",
+ " ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)",
+ " (rest : Runtime.NatStream grammarInst.Token),",
+ " toStream ts = Runtime.NatStream.appList word rest ∧",
+ " SpanGrammar.ptSem ⟨0⟩ tree = p := by",
+ " obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted",
+ s!" obtain ⟨htok, hspec⟩ := {l}.tokenize_sound ht",
+ " exact ⟨ts, ht, htok, hspec, hp⟩"])
+ let tokParse := if !tokSound then "" else "\n\n" ++ lines [
+ "/-- **`tokenize` then `parse`.** If `tokenize` lexes `s` to `ts` and `parse` accepts `ts` with",
+ " value `p`, then `s` has a maximal-munch tokenization, the spec tokenizer returns the token",
+ " values of `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/",
+ s!"theorem tokenize_parse_sound (s : String) (k : Nat) (ts : {posToks}) (p : {startTy})",
+ s!" (h : {l}.tokenize s = .ok ts) (accepted : {E}.parse ts k = some p) :",
+ s!" Lexer.Tokenization {l}.rules0 s.toList ∧ Lexer.tokenize {l}.lexer s = .ok (ts.map (·.val)) ∧",
+ " ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)",
+ " (rest : Runtime.NatStream grammarInst.Token),",
+ " toStream ts = Runtime.NatStream.appList word rest ∧",
+ " SpanGrammar.ptSem ⟨0⟩ tree = p := by",
+ s!" obtain ⟨htok, hspec⟩ := {l}.tokenize_sound h",
+ " exact ⟨htok, hspec, parser_sound ts k p accepted⟩",
+ "",
+ "/-- **Completeness.** If `tokenize` lexes `s` to `ts` and a parse tree of the start symbol",
+ " spans exactly `ts`, within the fuel, `parseStr` returns the tree's value. -/",
+ s!"theorem parseStr_complete (s : String) (k : Nat) (ts : {posToks})",
+ s!" (h : {l}.tokenize s = .ok ts) (tree : ParserStartTree ts)",
+ " (fuel : Grammar.ptSize tree ≤ 2 ^ k) :",
+ s!" {E}.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by",
+ " rw [parseStr_eq s k ts h]",
+ " exact parser_complete tree k fuel",
+ "",
+ "/-- **Completeness from a tokenization (value level).** A maximal-munch `Lexer.Lexing` of `s`",
+ " gives the tokens `ts` of `tokenize s`, whose values are the tokens of its steps, and",
+ " `parseStr` accepts every parse tree over `ts` within the fuel, with the tree's value. -/",
+ s!"theorem parseStr_complete_lexing (s : String) (k : Nat) (steps : List (Nat × Nat))",
+ s!" (hsteps : Lexer.Lexing {l}.rules0 s.toList steps) :",
+ s!" ∃ ts, {l}.tokenize s = .ok ts ∧",
+ s!" ts.map (·.val) = Lexer.lexingTokens {l}.lexer {l}.lexer.start s.toList steps ∧",
+ " ∀ tree : ParserStartTree ts, Grammar.ptSize tree ≤ 2 ^ k →",
+ s!" {E}.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by",
+ s!" obtain ⟨ts, ht, hv⟩ := {l}.tokenize_complete hsteps",
+ " exact ⟨ts, ht, hv, fun tree fuel => parseStr_complete s k ts ht tree fuel⟩",
+ "",
+ "/-- **Unambiguity (value level).** Two derivations of `s`, each the tokens `tokenize` returns",
+ " for `s` and a parse tree over them, have the same tokens and the same value. -/",
+ s!"theorem parseStr_unambiguous (s : String) \{ts₁ ts₂ : {posToks}}",
+ s!" (h₁ : {l}.tokenize s = .ok ts₁) (h₂ : {l}.tokenize s = .ok ts₂)",
+ " (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :",
+ " ts₁ = ts₂ ∧ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by",
+ " rw [h₁] at h₂",
+ " cases h₂",
+ " exact ⟨rfl, (parser_unambiguous tree₁ tree₂).2⟩",
+ "",
+ "/-- **Completeness over positioned tokens.** If `ts` is the positioned tokenization of `s`",
+ s!" (`{l}.Lexes`) and a parse tree of the start symbol spans exactly `ts`, within the fuel,",
+ " `parseStr` returns the tree's value. -/",
+ s!"theorem parseStr_complete_lexes (s : String) (k : Nat) (ts : {posToks})",
+ s!" (h : {l}.Lexes s ts) (tree : ParserStartTree ts) (fuel : Grammar.ptSize tree ≤ 2 ^ k) :",
+ s!" {E}.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) :=",
+ s!" parseStr_complete s k ts (({l}.tokenize_iff_lexes s ts).mpr h) tree fuel",
+ "",
+ "/-- **Unambiguity over positioned tokens.** Two derivations of `s`, each a positioned",
+ " tokenization and a parse tree over it, have the same tokens, and their trees have the",
+ " same span and value. -/",
+ s!"theorem parseStr_unambiguous_lexes (s : String) \{ts₁ ts₂ : {posToks}}",
+ s!" (h₁ : {l}.Lexes s ts₁) (h₂ : {l}.Lexes s ts₂)",
+ " (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :",
+ " ts₁ = ts₂ ∧ SpanGrammar.ptSpan ⟨0⟩ tree₁ = SpanGrammar.ptSpan ⟨0⟩ tree₂ ∧",
+ " SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by",
+ s!" have he := {l}.lexes_unique h₁ h₂",
+ " subst he",
+ " exact ⟨rfl, parser_unambiguous tree₁ tree₂⟩",
+ "",
+ "/-- **Node spans as text of `s`.** In a parse tree over the positioned tokenization `ts` of",
+ s!" `s` (`{l}.Lexes`), every leaf's span is `[a, b)` for positions `a ≤ b` of `s`, and a rule's",
+ " action emits the leaf's token from the lexeme `s.extract a b` (or the leaf is the",
+ " end-of-input token at the end of `s`). Every inner node's span is `[a, b)` for positions",
+ " `a ≤ b` of `s`; `b` is the end of the lexeme of the node's last token, and `a` is the start",
+ " of the lexeme of its first token or, when its word is empty or its leftmost children",
+ " derive the empty word, the end of the token before it (`Lexer.AllNodeText`). -/",
+ s!"theorem parseStr_node_spans (s : String) (ts : {posToks}) (h : {l}.Lexes s ts)",
+ " (tree : ParserStartTree ts) :",
+ s!" Lexer.AllNodeText (Lexer.modeAct {l}.lexer {l}.lexer.start) {l}.lexer.eofToken s ⟨0⟩ tree :=",
+ " Lexer.PosLexing.allNodeText h tree" ]
+ let eofC := eofCtor.getD "EOF"
+ let lexesSound := if tokSound && eofCtor.isSome then "\n\n" ++ lines [
+ "/-- **End to end over positioned tokens.** If `parseStr` accepts `s` with value `p`, then",
+ s!" `s` has a positioned tokenization `ts` (`{l}.Lexes`), and `ts` starts with the word of a",
+ " parse tree whose value is `p`. -/",
+ s!"theorem parseStr_sound_lexes (s : String) (k : Nat) (p : {startTy})",
+ s!" (accepted : {E}.parseStr s k = some p) :",
+ s!" ∃ ts, {l}.Lexes s ts ∧",
+ " ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)",
+ " (rest : Runtime.NatStream grammarInst.Token),",
+ " toStream ts = Runtime.NatStream.appList word rest ∧",
+ " SpanGrammar.ptSem ⟨0⟩ tree = p := by",
+ " obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted",
+ s!" exact ⟨ts, ({l}.tokenize_iff_lexes s ts).mp ht, hp⟩",
+ "",
+ "/-- The end marker `$` is the last symbol of every production of the start symbol, and no",
+ " other position of a right-hand side holds `$` or the start symbol. -/",
+ "theorem endMarker_last : ∀ p : Production,",
+ " (prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →",
+ s!" (prodRhsRev' p).head? = some (Symbol.T (⟨{eofIdx}, of_decide_eq_true rfl⟩ : Terminal)) ∧",
+ s!" ∀ x ∈ (prodRhsRev' p).tail, x ≠ Symbol.T (⟨{eofIdx}, of_decide_eq_true rfl⟩ : Terminal) ∧",
+ " x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) ∧",
+ " (prodLhs' p ≠ startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →",
+ s!" ∀ x ∈ prodRhsRev' p, x ≠ Symbol.T (⟨{eofIdx}, of_decide_eq_true rfl⟩ : Terminal) ∧",
+ " x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) := by",
+ " native_decide",
+ "",
+ s!"/-- **The tree covers the tokens.** If `ts` is the positioned tokenization of `s`",
+ s!" (`{l}.Lexes`), the word of a start tree that begins the stream of `ts` is `ts`: the lexer",
+ s!" emits `{eofC}` only as its last token (`{l}.lexes_eof_last`), and a start tree's word ends",
+ " with its only `$` token (`endMarker_last`). -/",
+ s!"theorem word_eq_of_lexes (s : String) (ts : {posToks}) (h : {l}.Lexes s ts)",
+ " {word : List grammarInst.Token} (tree : ParserStartTree word)",
+ " (rest : Runtime.NatStream grammarInst.Token)",
+ " (hs : toStream ts = Runtime.NatStream.appList word rest) : word = ts := by",
+ s!" obtain ⟨ts0, rfl, hno⟩ := {l}.lexes_eof_last h",
+ " exact Runtime.start_word_eq (G := grammarInst) (A := automatonInst) _ _ endMarker_last _ ts0 _",
+ " rfl (fun t ht he => hno t ht (tokenTerm_eq_end t.val he)) tree rest hs",
+ "",
+ "/-- **End to end, over the whole input.** If `parseStr` accepts `s` with value `p`, then",
+ s!" `tokenize` lexes `s` to `ts`, `ts` is the positioned tokenization of `s` (`{l}.Lexes`),",
+ " and a parse tree over exactly `ts` has the value `p`. -/",
+ s!"theorem parseStr_sound_exact (s : String) (k : Nat) (p : {startTy})",
+ s!" (accepted : {E}.parseStr s k = some p) :",
+ s!" ∃ ts, {l}.tokenize s = .ok ts ∧ {l}.Lexes s ts ∧",
+ " ∃ tree : ParserStartTree ts, SpanGrammar.ptSem ⟨0⟩ tree = p := by",
+ " obtain ⟨ts, ht, word, tree, rest, hs, hp⟩ := parseStr_sound_tokenize s k p accepted",
+ s!" have hl := ({l}.tokenize_iff_lexes s ts).mp ht",
+ " obtain rfl := word_eq_of_lexes s ts hl tree rest hs",
+ " exact ⟨word, ht, hl, tree, hp⟩" ] else ""
+ base ++ failBlock ++ tokParse ++ lexesSound
/-- Render the dependent specification from shared prepared construction data. -/
def generateVerifiedFrom (s : Surface) (prepared : PreparedGrammar)
@@ -1095,13 +1390,18 @@ def generateVerifiedFrom (s : Surface) (prepared : PreparedGrammar)
" Production := Production",
" prodLhs := prodLhs'",
" prodRhsRev := prodRhsRev'" ]
+ -- The span grammar: actions receive the right-hand-side spans. The verified
+ -- interpreter runs on its derived grammar `grammarInst`, whose tokens are positioned
+ -- (`Runtime.SpanGrammar.toGrammar`).
let grammarWiring := lines [
- "instance grammarInst : Grammar := { sigInst with",
+ "instance spanGrammarInst : SpanGrammar := { sigInst with",
" semT := semT'",
" prodAction := prodAction'",
- " Token := " ++ s.tokenType,
+ " Tok := " ++ s.tokenType,
" tokenTerm := tokenTerm'",
- " tokenSem := tokenSem' }" ]
+ " tokenSem := tokenSem' }",
+ "",
+ "instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)" ]
let autWiring := lines [
"instance automatonInst : Automaton (G := sigInst) where",
" InitState := InitState",
@@ -1127,12 +1427,14 @@ def generateVerifiedFrom (s : Surface) (prepared : PreparedGrammar)
"",
"theorem completeness : Complete := complete_of_completeValidator completenessValidation" ]
let startTy := (s.rules.find? (·.lhs == s.start)).map (·.ty) |>.getD "Unit"
+ -- `parse` returns the value of the start symbol at the start of the input (byte 0):
+ -- the derived value `r` maps a position to a span and a value.
let parseEntry := lines [
- s!"def toStream (input : List {s.tokenType}) : Runtime.NatStream {s.tokenType} :=",
- s!" fun n => input.getD n .{s.eof}",
- s!"def parse (input : List {s.tokenType}) (logNSteps : Nat := 40) : Option {startTy} :=",
+ s!"def toStream (input : List (Runtime.Positioned {s.tokenType})) : Runtime.NatStream (Runtime.Positioned {s.tokenType}) :=",
+ s!" fun n => input.getD n ⟨.{s.eof}, Runtime.Span.dummy⟩",
+ s!"def parse (input : List (Runtime.Positioned {s.tokenType})) (logNSteps : Nat := 40) : Option {startTy} :=",
" match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with",
- " | .Parsed r _ => some r",
+ " | .Parsed r _ => some (r ⟨0⟩).2",
" | _ => none" ]
let refinementImports := match executable with
| some (importName, _) =>
@@ -1150,12 +1452,14 @@ def generateVerifiedFrom (s : Surface) (prepared : PreparedGrammar)
| some _, some m => if s.options.parseStr then some ((m.splitOn ".").getLastD m) else none
| _, _ => none
let refinementImports := refinementImports ++ (if streamLexer.isSome then
- "\npublic import LeanParserGenerator.Lexer.StreamRun" else "")
+ "\npublic import LeanParserGenerator.Lexer.StreamRun\npublic import LeanParserGenerator.Lexer.LexerSound\npublic import LeanParserGenerator.Lexer.SpanText\npublic import LeanParserGenerator.Runtime.ParseEnd" else "")
let refinementProof := match executable with
| some (_, execModule) => emitRefinement s g' execModule ++
(match streamLexer with
| some l => "\n\n" ++ emitStreamTransfer s.tokenType startTy execModule l
- (!Emit.actionsReadSpans s)
+ eofIdx
+ ((Emit.eofCtor s).map (fun _ => s.eof))
+ (s.lexer.any Emit.singleModeStay)
| none => "")
| none => ""
-- Assembled inside `EmitM`: the per-grammar semantic defs (`semT'`, actions,
@@ -1180,6 +1484,7 @@ def generateVerifiedFrom (s : Surface) (prepared : PreparedGrammar)
"public import LeanParserGenerator.Runtime.Correct",
"public import LeanParserGenerator.Runtime.Complete",
"public import LeanParserGenerator.Runtime.GrammarView",
+ "public import LeanParserGenerator.Runtime.SpanGrammar",
-- `native_decide` reduces the validators, the grammar view, and the flat
-- parser tables at the meta phase, so those modules are also `meta`-imported
-- (the plain imports above keep them available to ordinary generated defs).
@@ -1198,6 +1503,9 @@ def generateVerifiedFrom (s : Surface) (prepared : PreparedGrammar)
"open Runtime",
"set_option maxRecDepth 1000000",
"set_option maxHeartbeats 40000000",
+ -- A dependent action receives the right-hand-side spans and may ignore them or
+ -- some of its values, as the executable `semV` does.
+ "set_option linter.unusedVariables false",
"namespace " ++ moduleName,
s!"abbrev Terminal := Fin {numT'}",
s!"abbrev NonTerminal := Fin {numN'}",
diff --git a/LeanParserGenerator/Emit/Rust/Report.lean b/LeanParserGenerator/Emit/Rust/Report.lean
index e2191a0..e4cf38b 100644
--- a/LeanParserGenerator/Emit/Rust/Report.lean
+++ b/LeanParserGenerator/Emit/Rust/Report.lean
@@ -21,6 +21,7 @@ lexer rule, say whether its action can be emitted as Rust and, if not, why
(docs/RUST_PARSER.md).
-/
public import LeanParserGenerator.Emit.Rust.Domain
+public import LeanParserGenerator.Emit.Builder
public import LeanParserGenerator.Frontend.File
@@ -44,15 +45,6 @@ def headerOpens (header : String) : List String :=
((ln.drop 5).toString.splitOn " ").filter (fun w => !w.isEmpty && w != "in")
else []
-/-- Names defined with `def` (or `abbrev`) in header text. -/
-def headerDefs (header : String) : List String :=
- let ws := (header.replace "\n" " ").splitOn " " |>.filter (!·.isEmpty)
- let rec go : List String → List String
- | "def" :: n :: rest | "abbrev" :: n :: rest => n :: go rest
- | _ :: rest => go rest
- | [] => []
- go ws
-
/-- The constructors of the token type, which the lexer module (not the environment)
defines. -/
def tokenResolver (s : Surface) : Resolver where
@@ -67,7 +59,7 @@ def tokenResolver (s : Surface) : Resolver where
/-- The analysis context for the parser actions: the header's environment. -/
def parserCtx (s : Surface) (res : Resolver) : Ctx :=
{ res := res.orElse (tokenResolver s), opens := headerOpens s.header,
- headerDefs := headerDefs (s.header ++ "\n" ++ s.lexerHeader) }
+ headerDefs := Builder.headerDefs (s.header ++ "\n" ++ s.lexerHeader) }
/-- The type of the value a symbol carries. -/
def symTy (s : Surface) (sym : String) : Ty :=
diff --git a/LeanParserGenerator/Frontend/Generated/LigParser.lean b/LeanParserGenerator/Frontend/Generated/LigParser.lean
index 8f73daa..a1bcfce 100644
--- a/LeanParserGenerator/Frontend/Generated/LigParser.lean
+++ b/LeanParserGenerator/Frontend/Generated/LigParser.lean
@@ -88,36 +88,39 @@ def valOf : LigTok → V
def decode : Runtime.Positioned LigTok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def sem : Nat → List VP → VP
- | 0, [(ds_span, .v1 ds), (__s1, _), (rs_span, .v5 rs)] => (Runtime.Span.merge ds_span rs_span, .v0 (Frontend.assembleSurface ds rs))
- | 1, [(ds_span, .v1 ds), (d_span, .v2 d)] => (Runtime.Span.merge ds_span d_span, .v1 (ds.push d))
- | 2, [(d_span, .v2 d)] => (d_span, .v1 (#[d]))
- | 3, [(h_span, .v11 h)] => (h_span, .v2 (.header h))
- | 4, [(h_span, .v11 h)] => (h_span, .v2 (.lexerHeader h))
- | 5, [(__s0, _), (n_span, .v11 n)] => (Runtime.Span.merge __s0 n_span, .v2 (.tokenType n))
- | 6, [(__s0, _), (b_span, .v3 b)] => (Runtime.Span.merge __s0 b_span, .v2 (.tokens b))
- | 7, [(__s0, _), (n_span, .v11 n)] => (Runtime.Span.merge __s0 n_span, .v2 (.eof n))
- | 8, [(__s0, _), (n_span, .v11 n)] => (Runtime.Span.merge __s0 n_span, .v2 (.start n))
- | 9, [(__s0, _), (n_span, .v11 n), (v_span, .v11 v)] => (Runtime.Span.merge __s0 v_span, .v2 (.option n (some v)))
- | 10, [(__s0, _), (n_span, .v11 n)] => (Runtime.Span.merge __s0 n_span, .v2 (.option n none))
- | 11, [(l_span, .v11 l)] => (l_span, .v2 (.lexer l))
- | 12, [(ty_span, .v11 ty), (ns_span, .v4 ns)] => (Runtime.Span.merge ty_span ns_span, .v3 (ns.map (fun n => { name := n, ty := ty, hasVal := true })))
- | 13, [(ns_span, .v4 ns)] => (ns_span, .v3 (ns.map (fun n => { name := n, ty := "Unit", hasVal := false })))
- | 14, [(ns_span, .v4 ns), (n_span, .v11 n)] => (Runtime.Span.merge ns_span n_span, .v4 (ns.push n))
- | 15, [(n_span, .v11 n)] => (n_span, .v4 (#[n]))
- | 16, [(rs_span, .v5 rs), (r_span, .v6 r)] => (Runtime.Span.merge rs_span r_span, .v5 (rs.push r))
- | 17, [(r_span, .v6 r)] => (r_span, .v5 (#[r]))
- | 18, [(lhs_span, .v11 lhs), (__s1, _), (ty_span, .v11 ty), (alts_span, .v7 alts)] => (Runtime.Span.merge lhs_span alts_span, .v6 ({ lhs := lhs, ty := ty, alts := alts }))
- | 19, [(as_span, .v7 as), (a_span, .v8 a)] => (Runtime.Span.merge as_span a_span, .v7 (as.push a))
- | 20, [(a_span, .v8 a)] => (a_span, .v7 (#[a]))
- | 21, [(__s0, _), (es_span, .v9 es), (act_span, .v11 act)] => (Runtime.Span.merge __s0 act_span, .v8 ({ elems := es, action := act }))
- | 22, [(__s0, _), (act_span, .v11 act)] => (Runtime.Span.merge __s0 act_span, .v8 ({ elems := #[], action := act }))
- | 23, [(es_span, .v9 es), (e_span, .v10 e)] => (Runtime.Span.merge es_span e_span, .v9 (es.push e))
- | 24, [(e_span, .v10 e)] => (e_span, .v9 (#[e]))
- | 25, [(b_span, .v11 b), (__s1, _), (s_span, .v11 s)] => (Runtime.Span.merge b_span s_span, .v10 ({ binder := some b, sym := s }))
- | 26, [(s_span, .v11 s)] => (s_span, .v10 ({ binder := none, sym := s }))
- | 27, [x, _] => x
- | _, _ => (Runtime.Span.dummy, .unit ())
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v1 ds, _, .v5 rs] => .v0 (Frontend.assembleSurface ds rs)
+ | 1, _, [.v1 ds, .v2 d] => .v1 (ds.push d)
+ | 2, _, [.v2 d] => .v1 (#[d])
+ | 3, _, [.v11 h] => .v2 (.header h)
+ | 4, _, [.v11 h] => .v2 (.lexerHeader h)
+ | 5, _, [_, .v11 n] => .v2 (.tokenType n)
+ | 6, _, [_, .v3 b] => .v2 (.tokens b)
+ | 7, _, [_, .v11 n] => .v2 (.eof n)
+ | 8, _, [_, .v11 n] => .v2 (.start n)
+ | 9, _, [_, .v11 n, .v11 v] => .v2 (.option n (some v))
+ | 10, _, [_, .v11 n] => .v2 (.option n none)
+ | 11, _, [.v11 l] => .v2 (.lexer l)
+ | 12, _, [.v11 ty, .v4 ns] => .v3 (ns.map (fun n => { name := n, ty := ty, hasVal := true }))
+ | 13, _, [.v4 ns] => .v3 (ns.map (fun n => { name := n, ty := "Unit", hasVal := false }))
+ | 14, _, [.v4 ns, .v11 n] => .v4 (ns.push n)
+ | 15, _, [.v11 n] => .v4 (#[n])
+ | 16, _, [.v5 rs, .v6 r] => .v5 (rs.push r)
+ | 17, _, [.v6 r] => .v5 (#[r])
+ | 18, _, [.v11 lhs, _, .v11 ty, .v7 alts] => .v6 ({ lhs := lhs, ty := ty, alts := alts })
+ | 19, _, [.v7 as, .v8 a] => .v7 (as.push a)
+ | 20, _, [.v8 a] => .v7 (#[a])
+ | 21, _, [_, .v9 es, .v11 act] => .v8 ({ elems := es, action := act })
+ | 22, _, [_, .v11 act] => .v8 ({ elems := #[], action := act })
+ | 23, _, [.v9 es, .v10 e] => .v9 (es.push e)
+ | 24, _, [.v10 e] => .v9 (#[e])
+ | 25, _, [.v11 b, _, .v11 s] => .v10 ({ binder := some b, sym := s })
+ | 26, _, [.v11 s] => .v10 ({ binder := none, sym := s })
+ | 27, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -196,6 +199,48 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c10 st _ _ _ _ => st
| .c11 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+ | .c7 _ _ e _ _ => e
+ | .c8 _ _ e _ _ => e
+ | .c9 _ _ e _ _ => e
+ | .c10 _ _ e _ _ => e
+ | .c11 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+ | .c7 st _ e _ _ => k st e
+ | .c8 st _ e _ _ => k st e
+ | .c9 st _ e _ _ => k st e
+ | .c10 st _ e _ _ => k st e
+ | .c11 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -252,6 +297,7 @@ instance stackOps : Runtime.Exec.StackOps V LigTok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.shift 3, .shift 4, .shift 10, .error, .error, .error, .error, .shift 5, .shift 6, .shift 7, .shift 8, .shift 9,
@@ -526,6 +572,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
diff --git a/LeanParserGenerator/Frontend/Generated/LigVerified.lean b/LeanParserGenerator/Frontend/Generated/LigVerified.lean
index 90345ef..595e4a4 100644
--- a/LeanParserGenerator/Frontend/Generated/LigVerified.lean
+++ b/LeanParserGenerator/Frontend/Generated/LigVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -43,6 +45,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace LigVerified
abbrev Terminal := Fin 18
@@ -149,39 +153,39 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 11
augmentedProduction := 27 }
-def semTbl : List (Σ T : Type, T → LigParser.VP) := [
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Frontend.LigResult : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Array Frontend.Directive : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(Frontend.Directive : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(Array Frontend.TokenDecl : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Array String : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Array Frontend.Rule : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(Frontend.Rule : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Array Frontend.Alt : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(Frontend.Alt : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(Array Frontend.Elem : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(Frontend.Elem : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(Frontend.LigResult : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → LigParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → LigParser.V) := [
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(String : Type), fun v => .v11 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Frontend.LigResult : Type), fun v => .v0 v⟩,
+ ⟨(Array Frontend.Directive : Type), fun v => .v1 v⟩,
+ ⟨(Frontend.Directive : Type), fun v => .v2 v⟩,
+ ⟨(Array Frontend.TokenDecl : Type), fun v => .v3 v⟩,
+ ⟨(Array String : Type), fun v => .v4 v⟩,
+ ⟨(Array Frontend.Rule : Type), fun v => .v5 v⟩,
+ ⟨(Frontend.Rule : Type), fun v => .v6 v⟩,
+ ⟨(Array Frontend.Alt : Type), fun v => .v7 v⟩,
+ ⟨(Frontend.Alt : Type), fun v => .v8 v⟩,
+ ⟨(Array Frontend.Elem : Type), fun v => .v9 v⟩,
+ ⟨(Frontend.Elem : Type), fun v => .v10 v⟩,
+ ⟨(Frontend.LigResult : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → LigParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -190,94 +194,94 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (rs : Array Frontend.Rule) (_ : Unit) (ds : Array Frontend.Directive) => (Frontend.assembleSurface ds rs)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rs : Array Frontend.Rule) (_ : Unit) (ds : Array Frontend.Directive) => (Frontend.assembleSurface ds rs)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Frontend.Directive) (ds : Array Frontend.Directive) => (ds.push d)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Frontend.Directive) (ds : Array Frontend.Directive) => (ds.push d)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Frontend.Directive) => (#[d])
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Frontend.Directive) => (#[d])
-def semanticAction3 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (h : String) => (.header h)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (h : String) => (.header h)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (h : String) => (.lexerHeader h)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (h : String) => (.lexerHeader h)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (.tokenType n)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (.tokenType n)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : Array Frontend.TokenDecl) (_ : Unit) => (.tokens b)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : Array Frontend.TokenDecl) (_ : Unit) => (.tokens b)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (.eof n)
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (.eof n)
-def semanticAction8 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (.start n)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (.start n)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (v : String) (n : String) (_ : Unit) => (.option n (some v))
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (v : String) (n : String) (_ : Unit) => (.option n (some v))
-def semanticAction10 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (.option n none)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (.option n none)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (l : String) => (.lexer l)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (l : String) => (.lexer l)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (ns : Array String) (ty : String) => (ns.map (fun n => { name := n, ty := ty, hasVal := true }))
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ns : Array String) (ty : String) => (ns.map (fun n => { name := n, ty := ty, hasVal := true }))
-def semanticAction13 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (ns : Array String) => (ns.map (fun n => { name := n, ty := "Unit", hasVal := false }))
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ns : Array String) => (ns.map (fun n => { name := n, ty := "Unit", hasVal := false }))
-def semanticAction14 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (ns : Array String) => (ns.push n)
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (ns : Array String) => (ns.push n)
-def semanticAction15 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) => (#[n])
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) => (#[n])
-def semanticAction16 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Frontend.Rule) (rs : Array Frontend.Rule) => (rs.push r)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Frontend.Rule) (rs : Array Frontend.Rule) => (rs.push r)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Frontend.Rule) => (#[r])
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Frontend.Rule) => (#[r])
-def semanticAction18 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (alts : Array Frontend.Alt) (ty : String) (_ : Unit) (lhs : String) => ({ lhs := lhs, ty := ty, alts := alts })
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (alts : Array Frontend.Alt) (ty : String) (_ : Unit) (lhs : String) => ({ lhs := lhs, ty := ty, alts := alts })
-def semanticAction19 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Frontend.Alt) (as : Array Frontend.Alt) => (as.push a)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Frontend.Alt) (as : Array Frontend.Alt) => (as.push a)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Frontend.Alt) => (#[a])
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Frontend.Alt) => (#[a])
-def semanticAction21 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (act : String) (es : Array Frontend.Elem) (_ : Unit) => ({ elems := es, action := act })
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (act : String) (es : Array Frontend.Elem) (_ : Unit) => ({ elems := es, action := act })
-def semanticAction22 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (act : String) (_ : Unit) => ({ elems := #[], action := act })
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (act : String) (_ : Unit) => ({ elems := #[], action := act })
-def semanticAction23 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Frontend.Elem) (es : Array Frontend.Elem) => (es.push e)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Frontend.Elem) (es : Array Frontend.Elem) => (es.push e)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Frontend.Elem) => (#[e])
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Frontend.Elem) => (#[e])
-def semanticAction25 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : String) (_ : Unit) (b : String) => ({ binder := some b, sym := s })
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : String) (_ : Unit) (b : String) => ({ binder := some b, sym := s })
-def semanticAction26 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : String) => ({ binder := none, sym := s })
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : String) => ({ binder := none, sym := s })
-def semanticAction27 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨2, of_decide_eq_true rfl⟩]) semanticAction2
@@ -314,7 +318,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : LigTok → String
@@ -381,13 +385,15 @@ def tokenSem' : (tok : LigTok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := LigTok
+ Tok := LigTok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
abbrev lastSymb' : NonInitState → Symbol Terminal NonTerminal
| s => match s with
| ⟨0, _⟩ => Symbol.NT ⟨1, of_decide_eq_true rfl⟩
@@ -839,247 +845,247 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List LigTok) : Runtime.NatStream LigTok :=
- fun n => input.getD n .EOF
-def parse (input : List LigTok) (logNSteps : Nat := 40) : Option Frontend.LigResult :=
+def toStream (input : List (Runtime.Positioned LigTok)) : Runtime.NatStream (Runtime.Positioned LigTok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned LigTok)) (logNSteps : Nat := 40) : Option Frontend.LigResult :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : LigParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : LigParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- LigParser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ LigParser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- LigParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ LigParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨n + 28, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨n + 28, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -1186,17 +1192,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- LigParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned LigTok) :
+ LigParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) LigParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) LigParser.V := {
table := LigParser.table
- decode := fun t => LigParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := LigParser.semV
+ decode := LigParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -1241,13 +1249,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change LigParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change LigParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -1255,21 +1264,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (LigParser.run input logNSteps) := by
+ have hrun : LigParser.run input logNSteps
= Runtime.Exec.run LigParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [LigParser.run]
rw [Runtime.Exec.runFast_eq_run LigParser.stackOps LigParser.flat LigParser.fuse
LigParser.termOf LigParser.valOf LigParser.stackLawful LigParser.fuseOK]
- simp only [LigParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- LigParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ LigParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold LigParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -1277,49 +1286,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : LigParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Frontend.LigResult)
- (accepted : LigParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : LigParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (LigParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (LigParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : LigParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -1328,7 +1339,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- LigParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ LigParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -1344,13 +1355,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- LigParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ LigParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -1360,14 +1373,20 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited LigTok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
end LigVerified
diff --git a/LeanParserGenerator/Lexer/ByteAgree.lean b/LeanParserGenerator/Lexer/ByteAgree.lean
new file mode 100644
index 0000000..4e98165
--- /dev/null
+++ b/LeanParserGenerator/Lexer/ByteAgree.lean
@@ -0,0 +1,429 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+The positioned byte lexer `lexPos` equals the positioned flat lexer `tokenizeFlatStrPos`.
+
+`Lexer/ByteUnicode.lean` proves the byte tables agree with the flat tables on every
+character. This file lifts that to
+
+* one scan: `byteScan bd s.toUTF8 p.offset.byteIdx` is `flatScanStr f p` with the end
+ position written as a byte offset (`byteScan_eq_flatScanStr`), from any position `p`;
+* the tokenizer loop: `lexPosAux` from byte `p.offset.byteIdx` and `tokenizeFlatStrPosAux`
+ from `p` return the same tokens with the same spans, or both fail
+ (`lexPosAux_toOption_eq`). The lexemes agree because both are the bytes `[p, q)` of the
+ input (`String.fromUTF8!` of the byte slice and `String.extract p q`).
+
+The loop simulation holds for any mode stack: every mode's byte table is checked against that
+mode's flat table (`byteValidAll`). So `posLexerAgrees_of_byteValidAll` gives
+`PosLexerAgrees cb (tokenizeFlatStrPos cb.flat)` for multi-mode lexers too.
+-/
+public import LeanParserGenerator.Lexer.ByteUnicode
+public import LeanParserGenerator.Lexer.BytePull
+public import LeanParserGenerator.Lexer.StringScan
+
+
+@[expose] public section
+
+namespace Lexer
+
+open DFA
+open FlatDFA
+
+/-! ### Byte offsets of positions -/
+
+theorem encodeChars_append (a b : List Char) :
+ encodeChars (a ++ b) = encodeChars a ++ encodeChars b := by
+ simp [encodeChars]
+
+theorem encodeChars_length (t : String) : (encodeChars t.toList).length = t.utf8ByteSize := by
+ rw [← toUTF8_size_eq]
+ simp
+
+theorem extract_start_utf8ByteSize (s : String) (p : s.Pos) :
+ (s.extract s.startPos p).utf8ByteSize = p.offset.byteIdx := by
+ rw [← String.size_toByteArray, String.toByteArray_extract]
+ simp only [ByteArray.size_extract, String.offset_startPos, String.Pos.Raw.byteIdx_zero]
+ have := p.isValid.le_rawEndPos
+ simp only [String.Pos.Raw.le_iff, String.byteIdx_rawEndPos] at this
+ rw [String.size_toByteArray]
+ omega
+
+/-- The UTF-8 bytes from position `p` on are the encoding of the characters from `p` on. -/
+theorem encodeChars_drop_offset (s : String) (p : s.Pos) :
+ (encodeChars s.toList).drop p.offset.byteIdx = encodeChars (charsFrom p) := by
+ have hsplit := sliceFrom_copy_split s s.startPos p (by simp [String.Pos.le_iff, String.Pos.Raw.le_iff])
+ have hl : s.toList = (s.extract s.startPos p).toList ++ charsFrom p := by
+ rw [← charsFrom_startPos, charsFrom, hsplit, String.toList_append]; rfl
+ have hlen := encodeChars_length (s.extract s.startPos p)
+ rw [extract_start_utf8ByteSize] at hlen
+ rw [hl, encodeChars_append, List.drop_append, hlen, Nat.sub_self, List.drop_zero,
+ List.drop_eq_nil_of_le (by omega), List.nil_append]
+
+theorem offset_le_size (s : String) (p : s.Pos) : p.offset.byteIdx ≤ s.toUTF8.size := by
+ simp
+
+theorem eq_endPos_iff_offset (s : String) (p : s.Pos) :
+ p = s.endPos ↔ p.offset.byteIdx = s.toUTF8.size := by
+ constructor
+ · intro h; subst h; simp
+ · intro h
+ apply String.Pos.ext
+ apply String.Pos.Raw.ext
+ simpa using h
+
+/-! ### One scan -/
+
+/-- A flat scan result `(rule, len, q)` with the end written as a byte offset. -/
+@[inline] def endProj {s : String} (x : Nat × Nat × s.Pos) : Nat × Nat := (x.1, x.2.2.offset.byteIdx)
+
+/-- The byte walk over the bytes from `p` and the flat walk from `p` record the same rule and
+ the same end, the latter as a byte offset. By induction on the flat fuel, one character
+ per step (`byteScanListGo_consume`). -/
+theorem byteScanListGo_eq_flatScanStrGo {s : String} (bd : ByteDFA) (f : FlatDFA)
+ (hstepA : ByteStepAgree bd f) (haccA : ByteAcceptAgree bd f)
+ (hnomid : ByteNoMidAccept bd f) (hrange : ByteStatesInRange f) :
+ ∀ (fuelF sid : Nat) (p : s.Pos) (n fuelB : Nat) (bestF : Option (Nat × Nat × s.Pos)),
+ sid < f.nStates →
+ (encodeChars (charsFrom p)).length < fuelB → (charsFrom p).length < fuelF →
+ byteScanListGo bd fuelB sid p.offset.byteIdx (encodeChars (charsFrom p)) (bestF.map endProj)
+ = (DFA.flatScanStrGo f fuelF sid p n bestF).map endProj := by
+ intro fuelF
+ induction fuelF with
+ | zero => intro _ _ _ _ _ _ _ h; omega
+ | succ fuelF ih =>
+ intro sid p n fuelB bestF hsid hfB hfF
+ have hacc := haccA sid hsid
+ rw [DFA.flatScanStrGo]
+ by_cases hend : p = s.endPos
+ · subst hend
+ rw [charsFrom_endPos, encodeChars_nil]
+ obtain ⟨nB, rfl⟩ : ∃ nB, fuelB = nB + 1 := ⟨fuelB - 1, by
+ rw [charsFrom_endPos] at hfB; simp at hfB; omega⟩
+ simp only [byteScanListGo, dite_true]
+ rw [hacc]; cases f.acceptOf sid <;> rfl
+ · simp only [hend, dite_false]
+ have hcf := charsFrom_next p hend
+ rw [hcf, encodeChars_cons]
+ rw [hcf, encodeChars_cons, List.length_append] at hfB
+ rw [hcf, List.length_cons] at hfF
+ rw [byteScanListGo_consume bd f sid (p.get hend) (hstepA sid hsid _)
+ (fun k hk0 hk mid hmid => hnomid sid hsid _ k hk0 hk mid hmid) _ _ _ _ (by omega)]
+ have hoff : (p.next hend).offset.byteIdx
+ = p.offset.byteIdx + (String.utf8EncodeChar (p.get hend)).length := by
+ rw [String.length_utf8EncodeChar]; exact String.Pos.byteIdx_offset_next p hend
+ rw [hacc, ← hoff]
+ cases hst : FlatDFA.step f sid (p.get hend) with
+ | none => cases f.acceptOf sid <;> rfl
+ | some next =>
+ have hn := hrange sid hsid _ next hst
+ cases f.acceptOf sid with
+ | none => exact ih next (p.next hend) (n + 1) _ bestF hn (by omega) (by omega)
+ | some r => exact ih next (p.next hend) (n + 1) _ (some (r, n, p)) hn (by omega) (by omega)
+
+/-- **One scan.** With the agreements, the byte scan from byte `p.offset.byteIdx` returns the
+ flat scan from `p`, with the end as a byte offset. -/
+theorem byteScan_eq_flatScanStr {s : String} (bd : ByteDFA) (f : FlatDFA)
+ (hstepA : ByteStepAgree bd f) (haccA : ByteAcceptAgree bd f)
+ (hnomid : ByteNoMidAccept bd f) (hrange : ByteStatesInRange f) (hpos : 0 < f.nStates)
+ (p : s.Pos) :
+ DFA.byteScan bd s.toUTF8 p.offset.byteIdx = (DFA.flatScanStr f p).map endProj := by
+ rw [DFA.byteScan_eq_go, byteScanGo_eq_listGo, encodeChars_drop_offset, DFA.flatScanStr_eq_go]
+ have hlen : (encodeChars (charsFrom p)).length = s.toUTF8.size - p.offset.byteIdx := by
+ rw [← encodeChars_drop_offset, List.length_drop, ← toUTF8_size_eq]
+ have := byteScanListGo_eq_flatScanStrGo bd f hstepA haccA hnomid hrange
+ (s.utf8ByteSize + 1) 0 p 0 (s.toUTF8.size + 1 - p.offset.byteIdx) none hpos
+ (by have := offset_le_size s p; omega)
+ (by have := charsFrom_length_le_byteSize p; omega)
+ simpa using this
+
+/-! ### Properties of the flat scan result -/
+
+theorem flatScanStrGo_pos {s : String} (f : FlatDFA) (cs0 : List Char) :
+ ∀ (fuel sid : Nat) (p : s.Pos) (n : Nat) (best : Option (Nat × Nat × s.Pos)),
+ charsFrom p = cs0.drop n →
+ (∀ rb lb pb, best = some (rb, lb, pb) → charsFrom pb = cs0.drop lb) →
+ ∀ rule len p', DFA.flatScanStrGo f fuel sid p n best = some (rule, len, p') →
+ charsFrom p' = cs0.drop len := by
+ intro fuel
+ induction fuel with
+ | zero => intro sid p n best _ hbest rule len p' h; exact hbest rule len p' h
+ | succ fuel ih =>
+ intro sid p n best hp hbest rule len p' heq
+ rw [DFA.flatScanStrGo] at heq
+ have hb2 : ∀ rb lb pb,
+ (match FlatDFA.acceptOf f sid with | some rule => some (rule, n, p) | none => best)
+ = some (rb, lb, pb) → charsFrom pb = cs0.drop lb := by
+ intro rb lb pb hbeq
+ cases hacc : FlatDFA.acceptOf f sid with
+ | none => rw [hacc] at hbeq; exact hbest rb lb pb hbeq
+ | some r2 =>
+ rw [hacc] at hbeq
+ simp only [Option.some.injEq, Prod.mk.injEq] at hbeq
+ obtain ⟨_, hl, hpb⟩ := hbeq; rw [← hpb, ← hl]; exact hp
+ by_cases hend : p = s.endPos
+ · rw [dite_eq_left hend] at heq
+ exact hb2 rule len p' heq
+ · simp only [hend, dite_false] at heq
+ have hcf := charsFrom_next p hend
+ have hpnext : charsFrom (p.next hend) = cs0.drop (n + 1) := by
+ have h1 : cs0.drop n = p.get hend :: charsFrom (p.next hend) := by rw [← hp, hcf]
+ rw [List.drop_add_one_eq_tail_drop, h1]; simp
+ cases hstep : FlatDFA.step f sid (p.get hend) with
+ | none => rw [hstep] at heq; exact hb2 rule len p' heq
+ | some next =>
+ rw [hstep] at heq
+ exact ih next (p.next hend) (n + 1) _ hpnext hb2 rule len p' heq
+
+theorem flatScanStrGo_pos_le {s : String} (f : FlatDFA) (p0 : s.Pos) :
+ ∀ (fuel sid : Nat) (p : s.Pos) (n : Nat) (best : Option (Nat × Nat × s.Pos)),
+ p0 ≤ p →
+ (∀ rb lb pb, best = some (rb, lb, pb) → p0 ≤ pb) →
+ ∀ rule len p', DFA.flatScanStrGo f fuel sid p n best = some (rule, len, p') → p0 ≤ p' := by
+ intro fuel
+ induction fuel with
+ | zero => intro sid p n best _ hbest rule len p' heq; exact hbest rule len p' heq
+ | succ fuel ih =>
+ intro sid p n best hp0 hbest rule len p' heq
+ rw [DFA.flatScanStrGo] at heq
+ have hb2 : ∀ rb lb pb,
+ (match FlatDFA.acceptOf f sid with | some rule => some (rule, n, p) | none => best)
+ = some (rb, lb, pb) → p0 ≤ pb := by
+ intro rb lb pb hbeq
+ cases hacc : FlatDFA.acceptOf f sid with
+ | none => rw [hacc] at hbeq; exact hbest rb lb pb hbeq
+ | some r2 =>
+ rw [hacc] at hbeq
+ simp only [Option.some.injEq, Prod.mk.injEq] at hbeq
+ obtain ⟨_, _, hpb⟩ := hbeq; rw [← hpb]; exact hp0
+ by_cases hend : p = s.endPos
+ · rw [dite_eq_left hend] at heq
+ exact hb2 rule len p' heq
+ · simp only [hend, dite_false] at heq
+ have hp0next : p0 ≤ p.next hend :=
+ String.Pos.le_trans hp0 (String.Pos.le_of_lt String.Pos.lt_next)
+ cases hstep : FlatDFA.step f sid (p.get hend) with
+ | none => rw [hstep] at heq; exact hb2 rule len p' heq
+ | some next =>
+ rw [hstep] at heq
+ exact ih next (p.next hend) (n + 1) _ hp0next hb2 rule len p' heq
+
+/-- A flat scan from `p` that ends at `q` after `len` characters: `p ≤ q`, and the characters
+ from `q` are those from `p` without the first `len`. -/
+theorem flatScanStr_spec {s : String} (f : FlatDFA) (p : s.Pos) (rule len : Nat) (q : s.Pos)
+ (h : DFA.flatScanStr f p = some (rule, len, q)) :
+ p ≤ q ∧ charsFrom q = (charsFrom p).drop len := by
+ rw [DFA.flatScanStr_eq_go] at h
+ exact ⟨flatScanStrGo_pos_le f p _ 0 p 0 none (String.Pos.le_refl _) (by simp) rule len q h,
+ flatScanStrGo_pos f (charsFrom p) _ 0 p 0 none (by simp) (by simp) rule len q h⟩
+
+theorem extract_eq_empty_offset {s : String} (p q : s.Pos) (h : (s.extract p q).toList = []) :
+ q.offset.byteIdx ≤ p.offset.byteIdx := by
+ have h1 : (s.extract p q).utf8ByteSize = 0 := by
+ rw [String.utf8ByteSize_eq_zero_iff]; exact String.toList_eq_nil_iff.mp h
+ rw [← String.size_toByteArray, String.toByteArray_extract, ByteArray.size_extract] at h1
+ have := q.isValid.le_rawEndPos
+ simp only [String.Pos.Raw.le_iff, String.byteIdx_rawEndPos] at this
+ rw [String.size_toByteArray] at h1
+ omega
+
+/-- The flat scan matched nothing (`len = 0`) exactly when its end does not pass `p`. -/
+theorem flatScanStr_len_zero_iff {s : String} (f : FlatDFA) (p : s.Pos) (hend : p ≠ s.endPos)
+ (rule len : Nat) (q : s.Pos) (h : DFA.flatScanStr f p = some (rule, len, q)) :
+ len = 0 ↔ q.offset.byteIdx ≤ p.offset.byteIdx := by
+ obtain ⟨hpq, hq⟩ := flatScanStr_spec f p rule len q h
+ have hsplit : charsFrom p = (s.extract p q).toList ++ charsFrom q := by
+ rw [charsFrom, sliceFrom_copy_split s p q hpq, String.toList_append]; rfl
+ constructor
+ · intro h0
+ subst h0
+ rw [List.drop_zero] at hq
+ rw [hq] at hsplit
+ have : (s.extract p q).toList = [] := by
+ have := congrArg List.length hsplit
+ rw [List.length_append] at this
+ exact List.eq_nil_of_length_eq_zero (by omega)
+ exact extract_eq_empty_offset p q this
+ · intro hle
+ have hpq' : p.offset.byteIdx ≤ q.offset.byteIdx := by
+ simpa [String.Pos.le_iff, String.Pos.Raw.le_iff] using hpq
+ have hqp : q = p := by
+ apply String.Pos.ext; apply String.Pos.Raw.ext; omega
+ subst hqp
+ have hcf := charsFrom_next q hend
+ have := congrArg List.length hq
+ rw [List.length_drop, hcf] at this
+ simp at this
+ omega
+
+/-- The lexeme of the byte lexer is the lexeme of the flat lexer. -/
+theorem fromUTF8_extract_eq {s : String} (p q : s.Pos) :
+ String.fromUTF8! (s.toUTF8.extract p.offset.byteIdx q.offset.byteIdx) = s.extract p q := by
+ have hv : (s.toUTF8.extract p.offset.byteIdx q.offset.byteIdx).IsValidUTF8 := by
+ have := (s.extract p q).isValidUTF8
+ simpa [String.toByteArray_extract, String.toUTF8_eq_toByteArray] using this
+ simp only [String.fromUTF8!, hv, dite_true]
+ apply String.toByteArray_inj.1
+ simp [String.toByteArray_extract, String.toUTF8_eq_toByteArray]
+
+/-! ### The tokenizer loop -/
+
+/-- The byte scan of `bd` returns the flat scan of `f` from every position. -/
+def ScanAgree (bd : ByteDFA) (f : FlatDFA) : Prop :=
+ ∀ (s : String) (p : s.Pos),
+ DFA.byteScan bd s.toUTF8 p.offset.byteIdx = (DFA.flatScanStr f p).map endProj
+
+theorem scanAgree_of_byteUnicodeValid (bd : ByteDFA) (f : FlatDFA)
+ (h : byteUnicodeValid bd f = true) : ScanAgree bd f := by
+ obtain ⟨h1, h2, h3, h4, h5⟩ := agreements_of_byteUnicodeValid bd f h
+ intro s p
+ exact byteScan_eq_flatScanStr bd f h1 h3 h2 h4 h5 p
+
+/-- The empty tables (a mode index past the end of both arrays) both scan nothing. -/
+theorem scanAgree_default : ScanAgree default default := by
+ intro s p
+ have hle := offset_le_size s p
+ have hb : DFA.byteScan (default : ByteDFA) s.toUTF8 p.offset.byteIdx = none := by
+ have hd : (default : ByteDFA) = { nStates := 0, nBoundary := 0, trans := #[], accept := #[] } :=
+ rfl
+ unfold DFA.byteScan
+ obtain ⟨k, hk⟩ : ∃ k, s.toUTF8.size + 1 - p.offset.byteIdx = k + 1 :=
+ ⟨s.toUTF8.size - p.offset.byteIdx, by omega⟩
+ rw [hk, DFA.byteScanGoU, hd]
+ simp only [ByteDFA.step]
+ split <;> simp
+ have hf : DFA.flatScanStr (default : FlatDFA) p = none := by
+ have hd : (default : FlatDFA) =
+ { bounds := #[], nClasses := 0, nStates := 0, ascii := #[], trans := #[], accept := #[] } := rfl
+ unfold DFA.flatScanStr DFA.flatScanStrR
+ rw [DFA.flatScanStrGoU, hd]
+ simp only [FlatDFA.step]
+ split <;> simp [DFA.packBest] <;> rfl
+ rw [hb, hf]; rfl
+
+/-- Every mode's byte table passes `byteUnicodeValid` against that mode's flat table. -/
+def byteValidAll {Tok : Type} (cb : CompiledByte Tok) : Bool :=
+ cb.bytes.size == cb.flat.flats.size &&
+ (List.range cb.flat.flats.size).all (fun m =>
+ byteUnicodeValid (cb.bytes.getD m default) (cb.flat.flats.getD m default))
+
+theorem scanAgree_of_byteValidAll {Tok : Type} (cb : CompiledByte Tok)
+ (h : byteValidAll cb = true) :
+ ∀ m, ScanAgree (cb.bytes.getD m default) (cb.flat.flats.getD m default) := by
+ unfold byteValidAll at h
+ simp only [Bool.and_eq_true, beq_iff_eq, List.all_eq_true, List.mem_range] at h
+ obtain ⟨hsz, hall⟩ := h
+ intro m
+ by_cases hm : m < cb.flat.flats.size
+ · exact scanAgree_of_byteUnicodeValid _ _ (hall m hm)
+ · have e1 : cb.bytes.getD m default = default := by
+ rw [Array.getD_eq_getD_getElem?, Array.getElem?_eq_none (by omega)]; rfl
+ have e2 : cb.flat.flats.getD m default = default := by
+ rw [Array.getD_eq_getD_getElem?, Array.getElem?_eq_none (by omega)]; rfl
+ rw [e1, e2]
+ exact scanAgree_default
+
+variable {Tok : Type}
+
+/-- **The tokenizer loop.** With every mode's scans in agreement, `lexPosAux` from byte
+ `p.offset.byteIdx` and `tokenizeFlatStrPosAux` from `p` return the same token list, or
+ both fail (the error payloads differ). By induction on the fuel, which both loops spend
+ one per token. -/
+theorem lexPosAux_toOption_eq (cb : CompiledByte Tok)
+ (hscan : ∀ m, ScanAgree (cb.bytes.getD m default) (cb.flat.flats.getD m default))
+ (s : String) :
+ ∀ (fuel : Nat) (p : s.Pos) (cpos cpos' : Nat) (stack : List Nat)
+ (acc : List (Runtime.Positioned Tok)),
+ (lexPosAux cb s.toUTF8 fuel p.offset.byteIdx cpos stack acc).toOption =
+ (tokenizeFlatStrPosAux cb.flat s fuel p cpos' stack acc).toOption := by
+ intro fuel
+ induction fuel with
+ | zero => intro p cpos cpos' stack acc; rfl
+ | succ fuel ih =>
+ intro p cpos cpos' stack acc
+ unfold lexPosAux tokenizeFlatStrPosAux
+ by_cases hend : p = s.endPos
+ · have hi : p.offset.byteIdx ≥ s.toUTF8.size := by
+ rw [(eq_endPos_iff_offset s p).1 hend]; exact Nat.le_refl _
+ simp only [hi, ite_true]
+ rw [dite_eq_left hend]
+ rcases stack with _ | ⟨a, _ | ⟨b, t⟩⟩
+ · rfl
+ · cases cb.flat.base.eofToken with
+ | none => rfl
+ | some tok =>
+ simp only [Except.toOption]
+ congr
+ · rfl
+ · have hi : ¬ p.offset.byteIdx ≥ s.toUTF8.size := by
+ have h1 := offset_le_size s p
+ have h2 : p.offset.byteIdx ≠ s.toUTF8.size := fun h => hend ((eq_endPos_iff_offset s p).2 h)
+ omega
+ simp only [hi, ite_false]
+ rw [dite_eq_right hend, DFA.ScanRes.elim_eq]
+ have hR : (DFA.flatScanStrR (cb.flat.flats.getD (stack.headD cb.flat.base.start) default) p).toOption
+ = DFA.flatScanStr (cb.flat.flats.getD (stack.headD cb.flat.base.start) default) p := rfl
+ rw [hR, hscan (stack.headD cb.flat.base.start) s p]
+ cases hsc : DFA.flatScanStr (cb.flat.flats.getD (stack.headD cb.flat.base.start) default) p with
+ | none => rfl
+ | some res =>
+ obtain ⟨rule, len, q⟩ := res
+ have hz := flatScanStr_len_zero_iff _ p hend rule len q hsc
+ simp only [Option.map_some, endProj]
+ by_cases hlen : len = 0
+ · have hle : q.offset.byteIdx ≤ p.offset.byteIdx := hz.1 hlen
+ simp only [hle, ite_true, hlen]
+ rfl
+ · have hle : ¬ q.offset.byteIdx ≤ p.offset.byteIdx := fun h => hlen (hz.2 h)
+ simp only [hle, ite_false, hlen]
+ rw [fromUTF8_extract_eq p q]
+ cases (((cb.flat.base.acts.getD (stack.headD cb.flat.base.start) #[]).getD rule
+ (fun _ => {})) (bif cb.flat.needsText (stack.headD cb.flat.base.start) rule then
+ s.extract p q else "")).emit with
+ | none => exact ih q _ _ _ _
+ | some tok => exact ih q _ _ _ _
+
+/-- `lexPos` and the positioned flat tokenizer agree, given the per-mode scan agreements. -/
+theorem posLexerAgrees_of_scanAgree (cb : CompiledByte Tok)
+ (hscan : ∀ m, ScanAgree (cb.bytes.getD m default) (cb.flat.flats.getD m default)) :
+ PosLexerAgrees cb (tokenizeFlatStrPos cb.flat) := by
+ intro s
+ unfold lexPos tokenizeFlatStrPos
+ have hsz : s.toUTF8.size = s.utf8ByteSize := by simp
+ have := lexPosAux_toOption_eq cb hscan s (s.toUTF8.size + 1) s.startPos 0 0
+ [cb.flat.base.start] []
+ rw [hsz] at this
+ simpa using this
+
+/-- **`PosLexerAgrees` from the Boolean check.** If every mode's byte table passes
+ `byteUnicodeValid` against its flat table (`byteValidAll`, per lexer by `native_decide`),
+ the positioned byte lexer and the positioned flat lexer succeed on the same inputs with
+ the same tokens and spans. No restriction on modes or actions. -/
+theorem posLexerAgrees_of_byteValidAll (cb : CompiledByte Tok) (h : byteValidAll cb = true) :
+ PosLexerAgrees cb (tokenizeFlatStrPos cb.flat) :=
+ posLexerAgrees_of_scanAgree cb (scanAgree_of_byteValidAll cb h)
+
+/-- **`tokenizeByte` from `PosLexerAgrees`.** The bare byte tokenizer succeeds exactly when
+ `tokenize` does, with the token values of `tokenize`. -/
+theorem tokenizeByte_toOption (cb : CompiledByte Tok)
+ {tokenize : String → Except LexError (List (Runtime.Positioned Tok))}
+ (h : PosLexerAgrees cb tokenize) (s : String) :
+ (tokenizeByte cb s).toOption = ((tokenize s).toOption).map (List.map (·.val)) := by
+ rw [tokenizeByte_eq_lexPos, ← h s]
+ cases lexPos cb s <;> rfl
+
+end Lexer
diff --git a/LeanParserGenerator/Lexer/BytePull.lean b/LeanParserGenerator/Lexer/BytePull.lean
index 611eb1f..a62e3f5 100644
--- a/LeanParserGenerator/Lexer/BytePull.lean
+++ b/LeanParserGenerator/Lexer/BytePull.lean
@@ -348,7 +348,8 @@ theorem pullSource_total (cb : CompiledByte Tk) (bytes : ByteArray) :
/-- The positioned byte lexer `lexPos` and a tokenizer agree on which inputs lex and on the
tokens. Stated on `toOption` because the error payloads differ (`lexPos` reports a byte
- offset and no character). Not proved here. -/
+ offset and no character). `posLexerAgrees_of_byteValidAll` (`Lexer/ByteAgree.lean`)
+ proves it for `tokenizeFlatStrPos cb.flat` from a Boolean check. -/
def PosLexerAgrees (cb : CompiledByte Tk)
(tokenize : String → Except LexError (List (Positioned Tk))) : Prop :=
∀ s, (lexPos cb s).toOption = (tokenize s).toOption
diff --git a/LeanParserGenerator/Lexer/ByteTokenize.lean b/LeanParserGenerator/Lexer/ByteTokenize.lean
index 01d8553..364fa61 100644
--- a/LeanParserGenerator/Lexer/ByteTokenize.lean
+++ b/LeanParserGenerator/Lexer/ByteTokenize.lean
@@ -21,8 +21,8 @@ The runtime byte tokenizer over `String.toUTF8`.
`Lexer/ByteScan.lean` gives the `ByteDFA` and `DFA.byteScan`. This file wraps a
`CompiledFlat` with per-mode `ByteDFA`s (`CompiledByte`) and runs the tokenizer over
`input.toUTF8` by byte index, slicing lexemes with `ByteArray.extract` +
-`String.fromUTF8!`. It is the fast runtime path; `Lexer/ByteValidator.lean` carries
-the equivalence to the flat/spec tokenizer (in progress).
+`String.fromUTF8!`. It is the fast runtime path; `Lexer/ByteAgree.lean` proves the
+positioned form `lexPos` equal to the positioned flat tokenizer.
-/
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FlatTokenize
@@ -162,4 +162,42 @@ theorem lexPosAux_acc (cb : CompiledByte Tok) (bytes : ByteArray) :
rw [ih _ _ _ (⟨tok, _⟩ :: acc), ih _ _ _ [⟨tok, _⟩]]
cases lexPosAux cb bytes fuel endi endi _ [] <;> simp [Except.map]
+/-! ### The bare byte tokenizer is `lexPos` without spans -/
+
+theorem tokenizeByteAux_eq_lexPosAux (cb : CompiledByte Tok) (bytes : ByteArray) :
+ ∀ (fuel i cpos : Nat) (stack : List Nat) (acc : List (Runtime.Positioned Tok)),
+ tokenizeByteAux cb bytes fuel i cpos stack (acc.map (·.val)) =
+ (lexPosAux cb bytes fuel i cpos stack acc).map (List.map (·.val)) := by
+ intro fuel
+ induction fuel with
+ | zero => intro i cpos stack acc; rfl
+ | succ fuel ih =>
+ intro i cpos stack acc
+ unfold tokenizeByteAux lexPosAux
+ by_cases hi : i ≥ bytes.size
+ · simp only [hi, ite_true]
+ rcases stack with _ | ⟨a, _ | ⟨c, t⟩⟩
+ · rfl
+ · cases cb.flat.base.eofToken with
+ | none => simp [Except.map, List.map_reverse]
+ | some tok => simp [Except.map, List.map_reverse]
+ · rfl
+ · simp only [hi, ite_false]
+ cases hs : DFA.byteScan (cb.bytes.getD (stack.headD cb.flat.base.start) default) bytes i with
+ | none => rfl
+ | some r =>
+ obtain ⟨rule, endi⟩ := r
+ by_cases he : endi ≤ i
+ · simp only [he, ite_true]; rfl
+ · simp only [he, ite_false]
+ cases hem : (((cb.flat.base.acts.getD (stack.headD cb.flat.base.start) #[]).getD rule
+ (fun _ => {})) _).emit with
+ | none => exact ih _ _ _ _
+ | some tok => exact ih _ _ _ (⟨tok, _⟩ :: acc)
+
+/-- `tokenizeByte` returns the token values of `lexPos`, and the same error. -/
+theorem tokenizeByte_eq_lexPos (cb : CompiledByte Tok) (input : String) :
+ tokenizeByte cb input = (lexPos cb input).map (List.map (·.val)) :=
+ tokenizeByteAux_eq_lexPosAux cb input.toUTF8 _ 0 0 _ []
+
end Lexer
diff --git a/LeanParserGenerator/Lexer/ByteUnicode.lean b/LeanParserGenerator/Lexer/ByteUnicode.lean
new file mode 100644
index 0000000..fbe40cc
--- /dev/null
+++ b/LeanParserGenerator/Lexer/ByteUnicode.lean
@@ -0,0 +1,701 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+The byte agreements of `Lexer/ByteValidator.lean` for every Unicode scalar value.
+
+`byteValidate` checks the byte tables at one representative character per flat class. That
+does not cover a class: two characters of one class have different UTF-8 bytes, and the byte
+tables are not built per class. This file gives a Boolean check, `byteUnicodeValid bd f`,
+and proves that it implies `ByteStepAgree`, `ByteNoMidAccept`, `ByteAcceptAgree` and
+`ByteStatesInRange` (`agreements_of_byteUnicodeValid`), that is, for every `Char`.
+
+The check walks, from every flat state, the tree of UTF-8 byte prefixes: the 128 one-byte
+characters, then for `k = 2, 3, 4` every lead byte and below it every continuation byte. A
+node at depth `r` (`r` continuation bytes still to read) stands for the code points
+`[base * 64^r, (base + 1) * 64^r)`. A node is accepted without descending when
+
+* none of its code points is a `k`-byte scalar value (outside `[min_k, max_k]`, or a
+ surrogate), or
+* all of its code points lie in one flat class `i` (`FlatDFA.clsOfRange`, which needs the
+ sorted class boundaries) and every sequence of `r` continuation bytes from the node's byte
+ state ends at the flat target of class `i`, through non-accepting states. The second half
+ is read from per-state tables `uniTable` (one per depth `1, 2, 3`) computed once per byte
+ table.
+
+Otherwise the check descends into the 64 continuation bytes, down to single code points. The
+byte value of each position comes from `String.utf8EncodeChar_eq_cons_cons` and its
+siblings in core (`utf8Enc2` to `utf8Enc4` below restate them as `Nat` arithmetic).
+
+Cost: for a flat table whose non-ASCII classes are few, almost every lead byte is accepted
+by the second rule, so the check does `O(states * (128 + 56 + 64 * (boundary nodes)))` table
+reads plus `O(byte states * 64 * 3)` for the tables.
+-/
+public import LeanParserGenerator.Lexer.ByteValidator
+
+
+@[expose] public section
+
+namespace Lexer
+
+open DFA
+open FlatDFA
+
+/-! ### UTF-8 bytes as `Nat` arithmetic -/
+
+namespace Utf8
+
+/-- The continuation byte carrying the low six bits of `x`. -/
+def cont (x : Nat) : UInt8 := UInt8.ofNat (0x80 + x % 64)
+
+/-- The `r` continuation bytes of code point `v`, most significant first:
+ `[cont (v / 64^(r-1)), …, cont (v / 64), cont v]`. -/
+def conts : Nat → Nat → List UInt8
+ | 0, _ => []
+ | r + 1, v => cont (v / 64 ^ r) :: conts r v
+
+@[simp] theorem conts_length (r v : Nat) : (conts r v).length = r := by
+ induction r with
+ | zero => rfl
+ | succ r ih => simp [conts, ih]
+
+theorem byte_mask_or (b : UInt8) (j : Nat) (h : UInt8) (hh : h.toNat % 2^j = 0)
+ (mask : UInt8) (hmask : mask.toNat = 2^j - 1) :
+ (b &&& mask ||| h).toNat = h.toNat + b.toNat % 2^j := by
+ rw [UInt8.toNat_or, UInt8.toNat_and, hmask, Nat.and_two_pow_sub_one_eq_mod]
+ have : b.toNat % 2^j < 2^j := Nat.mod_lt _ (Nat.two_pow_pos _)
+ obtain ⟨a, ha⟩ : ∃ a, h.toNat = 2^j * a :=
+ ⟨h.toNat / 2^j, by have := Nat.div_add_mod h.toNat (2^j); omega⟩
+ rw [ha, Nat.or_comm, ← Nat.two_pow_add_eq_or_of_lt this]
+
+theorem toNat_val (c : Char) : c.val.toNat = c.toNat := rfl
+
+theorem cont_eq (v : UInt32) (k : Nat) (hk : k < 32) :
+ (v >>> UInt32.ofNat k).toUInt8 &&& 0x3f ||| 0x80 = cont (v.toNat / 2^k) := by
+ apply UInt8.toNat_inj.1
+ rw [byte_mask_or _ 6 _ (by decide) _ (by decide)]
+ simp only [cont, UInt32.toNat_toUInt8, UInt32.toNat_shiftRight, UInt8.toNat_ofNat',
+ Nat.shiftRight_eq_div_pow, UInt32.toNat_ofNat', UInt8.reduceToNat]
+ rw [Nat.mod_eq_of_lt (a := k) (by omega), Nat.mod_eq_of_lt (a := k) (by omega)]
+ omega
+
+theorem cont0_eq (v : UInt32) : v.toUInt8 &&& 0x3f ||| 0x80 = cont v.toNat := by
+ apply UInt8.toNat_inj.1
+ rw [byte_mask_or _ 6 _ (by decide) _ (by decide)]
+ simp only [cont, UInt32.toNat_toUInt8, UInt8.toNat_ofNat', UInt8.reduceToNat]
+ omega
+
+theorem toNat_le_max (c : Char) : c.toNat ≤ 0x10ffff := by
+ have := c.valid
+ simp only [UInt32.isValidChar, Nat.isValidChar, toNat_val] at this
+ omega
+
+theorem not_surrogate (c : Char) : c.toNat < 0xD800 ∨ 0xDFFF < c.toNat := by
+ have := c.valid
+ simp only [UInt32.isValidChar, Nat.isValidChar, toNat_val] at this
+ omega
+
+theorem enc1 (c : Char) (hc : c.utf8Size = 1) :
+ String.utf8EncodeChar c = [UInt8.ofNat c.toNat] := by
+ rw [String.utf8EncodeChar_eq_singleton hc]
+ rfl
+
+theorem enc2 (c : Char) (hc : c.utf8Size = 2) :
+ String.utf8EncodeChar c = UInt8.ofNat (0xC0 + c.toNat / 64 ^ 1) :: conts 1 c.toNat := by
+ rw [String.utf8EncodeChar_eq_cons_cons hc]
+ have hv := Char.utf8Size_eq_two_iff.1 hc
+ simp only [UInt32.lt_iff_toNat_lt, UInt32.le_iff_toNat_le, UInt32.reduceToNat, toNat_val] at hv
+ simp only [conts, Nat.pow_zero, Nat.div_one, List.cons.injEq, and_true]
+ constructor
+ · apply UInt8.toNat_inj.1
+ rw [byte_mask_or _ 5 _ (by decide) _ (by decide)]
+ simp only [UInt32.toNat_toUInt8, UInt32.toNat_shiftRight, UInt8.toNat_ofNat',
+ Nat.shiftRight_eq_div_pow, UInt32.reduceToNat, toNat_val, UInt8.reduceToNat, Nat.reduceMod,
+ Nat.reducePow]
+ omega
+ · rw [cont0_eq]; rfl
+
+theorem enc3 (c : Char) (hc : c.utf8Size = 3) :
+ String.utf8EncodeChar c = UInt8.ofNat (0xE0 + c.toNat / 64 ^ 2) :: conts 2 c.toNat := by
+ rw [String.utf8EncodeChar_eq_cons_cons_cons hc]
+ have hv := Char.utf8Size_eq_three_iff.1 hc
+ simp only [UInt32.lt_iff_toNat_lt, UInt32.le_iff_toNat_le, UInt32.reduceToNat, toNat_val] at hv
+ simp only [conts, Nat.pow_zero, Nat.div_one, Nat.pow_one, List.cons.injEq, and_true]
+ refine ⟨?_, ?_, ?_⟩
+ · apply UInt8.toNat_inj.1
+ rw [byte_mask_or _ 4 _ (by decide) _ (by decide)]
+ simp only [UInt32.toNat_toUInt8, UInt32.toNat_shiftRight, UInt8.toNat_ofNat',
+ Nat.shiftRight_eq_div_pow, UInt32.reduceToNat, toNat_val, UInt8.reduceToNat, Nat.reduceMod,
+ Nat.reducePow]
+ omega
+ · have := cont_eq c.val 6 (by omega)
+ rw [← toNat_val, ← this]; rfl
+ · rw [cont0_eq]; rfl
+
+theorem enc4 (c : Char) (hc : c.utf8Size = 4) :
+ String.utf8EncodeChar c = UInt8.ofNat (0xF0 + c.toNat / 64 ^ 3) :: conts 3 c.toNat := by
+ rw [String.utf8EncodeChar_eq_cons_cons_cons_cons hc]
+ have hmax := toNat_le_max c
+ simp only [conts, Nat.pow_zero, Nat.div_one, Nat.pow_one, List.cons.injEq, and_true]
+ refine ⟨?_, ?_, ?_, ?_⟩
+ · apply UInt8.toNat_inj.1
+ rw [byte_mask_or _ 3 _ (by decide) _ (by decide)]
+ simp only [UInt32.toNat_toUInt8, UInt32.toNat_shiftRight, UInt8.toNat_ofNat',
+ Nat.shiftRight_eq_div_pow, UInt32.reduceToNat, toNat_val, UInt8.reduceToNat, Nat.reduceMod,
+ Nat.reducePow]
+ omega
+ · have := cont_eq c.val 12 (by omega)
+ rw [← toNat_val, ← this]; rfl
+ · have := cont_eq c.val 6 (by omega)
+ rw [← toNat_val, ← this]; rfl
+ · rw [cont0_eq]; rfl
+
+end Utf8
+
+/-! ### Class of a code-point range -/
+
+namespace FlatDFA
+
+/-- The flat target from state `sid` on class `ci`. `step f sid c = stepCls f sid (classOf f c)`. -/
+@[inline] def stepCls (f : FlatDFA) (sid ci : Nat) : Option Nat :=
+ let t := f.trans.getD (sid * f.nClasses + ci) 0
+ if t == 0 then none else some (t - 1)
+
+theorem step_eq_stepCls (f : FlatDFA) (sid : Nat) (c : Char) :
+ f.step sid c = f.stepCls sid (f.classOf c) := rfl
+
+/-- The class boundaries are sorted, start at `0` and end above the largest code point. -/
+def boundsOK (f : FlatDFA) : Bool :=
+ 2 ≤ f.bounds.size && f.bounds.getD 0 0 == 0 && 0x10ffff < f.bounds.getD (f.bounds.size - 1) 0 &&
+ (List.range (f.bounds.size - 1)).all (fun i => f.bounds.getD i 0 ≤ f.bounds.getD (i + 1) 0)
+
+/-- `some i` when the code points `[lo, hi]` are all in class `i`. -/
+def clsOfRange (f : FlatDFA) (lo hi : Nat) : Option Nat :=
+ let i := f.classOfNat lo
+ if f.bounds.getD i 0 ≤ lo && hi < f.bounds.getD (i + 1) 0 && i + 1 < f.bounds.size then some i
+ else none
+
+theorem bounds_mono (f : FlatDFA)
+ (h : (List.range (f.bounds.size - 1)).all
+ (fun i => f.bounds.getD i 0 ≤ f.bounds.getD (i + 1) 0) = true) :
+ ∀ a b, a ≤ b → b < f.bounds.size → f.bounds.getD a 0 ≤ f.bounds.getD b 0 := by
+ intro a b hab hb
+ induction b with
+ | zero => have : a = 0 := by omega
+ subst this; exact Nat.le_refl _
+ | succ b ih =>
+ by_cases hab' : a = b + 1
+ · subst hab'; exact Nat.le_refl _
+ · have h1 := ih (by omega) (by omega)
+ have h2 := (List.all_eq_true.mp h) b (by simp; omega)
+ simp only [decide_eq_true_eq] at h2
+ omega
+
+theorem bsearch_spec (bounds : Array Nat) (n : Nat) :
+ ∀ lo hi, lo < hi → bounds.getD lo 0 ≤ n → n < bounds.getD hi 0 →
+ lo ≤ bsearch bounds n lo hi ∧ bsearch bounds n lo hi < hi ∧
+ bounds.getD (bsearch bounds n lo hi) 0 ≤ n ∧ n < bounds.getD (bsearch bounds n lo hi + 1) 0 := by
+ intro lo hi
+ induction lo, hi using bsearch.induct bounds n with
+ | case1 lo hi hlt mid hmid ih =>
+ intro _ hlo hhi
+ have hm : mid = (lo + hi) / 2 := rfl
+ have e : bsearch bounds n lo hi = bsearch bounds n mid hi := by
+ rw [bsearch]; simp only [hlt, ite_true]; exact ite_eq_left hmid
+ rw [e]
+ have := ih (by omega) hmid hhi
+ omega
+ | case2 lo hi hlt mid hmid ih =>
+ intro _ hlo _
+ have hm : mid = (lo + hi) / 2 := rfl
+ have e : bsearch bounds n lo hi = bsearch bounds n lo mid := by
+ rw [bsearch]; simp only [hlt, ite_true]; exact ite_eq_right hmid
+ rw [e]
+ have := ih (by omega) hlo (by omega)
+ omega
+ | case3 lo hi hlt =>
+ intro hlh hlo hhi
+ rw [bsearch]; simp only [hlt, ite_false]
+ have : hi = lo + 1 := by omega
+ subst this
+ exact ⟨Nat.le_refl _, by omega, hlo, hhi⟩
+
+theorem classOfNat_eq (f : FlatDFA) (hb : f.boundsOK = true) (n i : Nat) (hn : n ≤ 0x10ffff)
+ (hi1 : f.bounds.getD i 0 ≤ n) (hi2 : n < f.bounds.getD (i + 1) 0) (hi3 : i + 1 < f.bounds.size) :
+ f.classOfNat n = i := by
+ unfold boundsOK at hb
+ simp only [Bool.and_eq_true, decide_eq_true_eq, beq_iff_eq] at hb
+ obtain ⟨⟨⟨hsz, h0⟩, hlast⟩, hsort⟩ := hb
+ have hmono := bounds_mono f hsort
+ have := bsearch_spec f.bounds n 0 (f.bounds.size - 1) (by omega) (by omega) (by omega)
+ unfold classOfNat
+ generalize bsearch f.bounds n 0 (f.bounds.size - 1) = r at this ⊢
+ obtain ⟨_, hr2, hr3, hr4⟩ := this
+ rcases Nat.lt_trichotomy r i with h | h | h
+ · have := hmono (r + 1) i (by omega) (by omega); omega
+ · exact h
+ · have := hmono (i + 1) r (by omega) (by omega); omega
+
+theorem clsOfRange_spec (f : FlatDFA) (hb : f.boundsOK = true) (lo hi i : Nat)
+ (h : f.clsOfRange lo hi = some i) :
+ ∀ n, lo ≤ n → n ≤ hi → n ≤ 0x10ffff → f.classOfNat n = i := by
+ intro n h1 h2 h3
+ unfold clsOfRange at h
+ simp only at h
+ split at h
+ · rename_i hc
+ simp only [Option.some.injEq] at h
+ subst h
+ simp only [Bool.and_eq_true, decide_eq_true_eq] at hc
+ exact classOfNat_eq f hb n _ h3 (by omega) (by omega) hc.2
+ · cases h
+
+theorem classOf_of_ge (f : FlatDFA) (c : Char) (h : 128 ≤ c.toNat) :
+ f.classOf c = f.classOfNat c.toNat := by
+ unfold classOf
+ simp only
+ rw [ite_eq_right (by omega)]
+
+end FlatDFA
+
+/-! ### Byte tables uniform over continuation bytes -/
+
+theorem ByteDFA.runList_cons (bd : ByteDFA) (s : Nat) (b : UInt8) (bs : List UInt8) :
+ bd.runList s (b :: bs) = (bd.step s b).bind (fun n => bd.runList n bs) := by
+ simp only [ByteDFA.runList]
+ cases bd.step s b <;> rfl
+
+/-- Every sequence of `r` continuation bytes from byte state `q` ends at `v`, and the states
+ strictly inside the sequence do not accept. -/
+def UniSpec (bd : ByteDFA) (r q : Nat) (v : Option Nat) : Prop :=
+ ∀ x, bd.runList q (Utf8.conts r x) = v ∧
+ ∀ j, 0 < j → j < r → ∀ m, bd.runList q ((Utf8.conts r x).take j) = some m → bd.acceptOf m = none
+
+/-- The result of one continuation byte `b` from `q`, given the uniform results `prev` one
+ level down. `mid`: the state after `b` is inside the character, so it must not accept. -/
+def uniChild (bd : ByteDFA) (prev : Nat → Option (Option Nat)) (mid : Bool) (q : Nat)
+ (b : UInt8) : Option (Option Nat) :=
+ match bd.step q b with
+ | none => some none
+ | some q' => if mid && (bd.acceptOf q').isSome then none else prev q'
+
+/-- `some v` when every continuation byte from `q` gives the same uniform result `v`. -/
+def uniStep (bd : ByteDFA) (prev : Nat → Option (Option Nat)) (mid : Bool) (q : Nat) :
+ Option (Option Nat) :=
+ let v := uniChild bd prev mid q 0x80
+ if v.isSome && (List.range 64).all (fun t => uniChild bd prev mid q (UInt8.ofNat (0x80 + t)) == v)
+ then v else none
+
+/-- `uniStep` at every byte state. -/
+def uniTable (bd : ByteDFA) (prev : Nat → Option (Option Nat)) (mid : Bool) :
+ Array (Option (Option Nat)) :=
+ Array.ofFn (n := bd.nStates) (fun q => uniStep bd prev mid q.val)
+
+theorem uniStep_spec (bd : ByteDFA) (prev : Nat → Option (Option Nat)) (r : Nat)
+ (hprev : ∀ q v, prev q = some v → UniSpec bd r q v) (q : Nat) (v : Option Nat)
+ (h : uniStep bd prev (decide (1 ≤ r)) q = some v) : UniSpec bd (r + 1) q v := by
+ unfold uniStep at h
+ simp only at h
+ split at h
+ · rename_i hc
+ simp only [Bool.and_eq_true, List.all_eq_true, List.mem_range, beq_iff_eq] at hc
+ obtain ⟨_, hall⟩ := hc
+ intro x
+ have hb : Utf8.cont (x / 64 ^ r) = UInt8.ofNat (0x80 + (x / 64 ^ r) % 64) := rfl
+ have hch := hall ((x / 64 ^ r) % 64) (Nat.mod_lt _ (by decide))
+ rw [← hb, h] at hch
+ simp only [Utf8.conts]
+ unfold uniChild at hch
+ cases hs : bd.step q (Utf8.cont (x / 64 ^ r)) with
+ | none =>
+ rw [hs] at hch
+ simp only [Option.some.injEq] at hch
+ refine ⟨by rw [ByteDFA.runList_cons, hs]; exact hch.symm.trans rfl |>.symm ▸ rfl, ?_⟩
+ intro j hj _ m hm
+ obtain ⟨j', rfl⟩ : ∃ j', j = j' + 1 := ⟨j - 1, by omega⟩
+ simp only [List.take_succ_cons, ByteDFA.runList_cons, hs, Option.bind_none] at hm
+ cases hm
+ | some q' =>
+ rw [hs] at hch
+ simp only at hch
+ split at hch
+ · cases hch
+ · rename_i hmid
+ have hsp := hprev q' v hch x
+ refine ⟨by rw [ByteDFA.runList_cons, hs]; exact hsp.1, ?_⟩
+ intro j hj hjr m hm
+ obtain ⟨j', rfl⟩ : ∃ j', j = j' + 1 := ⟨j - 1, by omega⟩
+ simp only [List.take_succ_cons, ByteDFA.runList_cons, hs, Option.bind_some] at hm
+ cases j' with
+ | zero =>
+ simp only [List.take_zero, ByteDFA.runList, Option.some.injEq] at hm
+ subst hm
+ have hr : 1 ≤ r := by omega
+ simp only [hr, decide_true, Bool.true_and] at hmid
+ cases ha : bd.acceptOf q' with
+ | none => rfl
+ | some a => rw [ha] at hmid; simp at hmid
+ | succ j'' => exact hsp.2 (j'' + 1) (by omega) (by omega) m hm
+ · cases h
+
+theorem uniTable_spec (bd : ByteDFA) (prev : Nat → Option (Option Nat)) (r : Nat)
+ (hprev : ∀ q v, prev q = some v → UniSpec bd r q v) :
+ ∀ q v, (uniTable bd prev (decide (1 ≤ r))).getD q none = some v → UniSpec bd (r + 1) q v := by
+ intro q v h
+ unfold uniTable at h
+ rw [Array.getD_eq_getD_getElem?] at h
+ by_cases hq : q < bd.nStates
+ · rw [Array.getElem?_ofFn] at h
+ simp only [hq, dite_true, Option.getD_some] at h
+ exact uniStep_spec bd prev r hprev q v h
+ · rw [Array.getElem?_ofFn] at h
+ simp only [hq, dite_false, Option.getD_none] at h
+ cases h
+
+/-- Uniform results at depth `0..3`, from three tables. -/
+def uniLook (t1 t2 t3 : Array (Option (Option Nat))) : Nat → Nat → Option (Option Nat)
+ | 0, s => some (some s)
+ | 1, s => t1.getD s none
+ | 2, s => t2.getD s none
+ | 3, s => t3.getD s none
+ | _, _ => none
+
+/-- The three uniform-result tables of `bd`, computed once per byte table. -/
+structure UniTables where
+ t1 : Array (Option (Option Nat))
+ t2 : Array (Option (Option Nat))
+ t3 : Array (Option (Option Nat))
+
+/-- The tables of `bd` at depths `1, 2, 3`. -/
+def ByteDFA.uniTables (bd : ByteDFA) : UniTables :=
+ let t1 := uniTable bd (uniLook #[] #[] #[] 0) false
+ let t2 := uniTable bd (uniLook t1 #[] #[] 1) true
+ let t3 := uniTable bd (uniLook t1 t2 #[] 2) true
+ ⟨t1, t2, t3⟩
+
+/-- Look up a uniform result at depth `r`. -/
+def UniTables.look (u : UniTables) : Nat → Nat → Option (Option Nat) := uniLook u.t1 u.t2 u.t3
+
+theorem uniTables_spec (bd : ByteDFA) :
+ ∀ r q v, bd.uniTables.look r q = some v → UniSpec bd r q v := by
+ have h0 : ∀ q v, uniLook #[] #[] #[] 0 q = some v → UniSpec bd 0 q v := by
+ intro q v h
+ simp only [uniLook, Option.some.injEq] at h
+ subst h
+ intro x
+ exact ⟨rfl, fun j hj hj' => by omega⟩
+ have h1 : ∀ q v, (uniTable bd (uniLook #[] #[] #[] 0) false).getD q none = some v →
+ UniSpec bd 1 q v := uniTable_spec bd _ 0 h0
+ have h1' : ∀ q v, uniLook (uniTable bd (uniLook #[] #[] #[] 0) false) #[] #[] 1 q = some v →
+ UniSpec bd 1 q v := fun q v h => h1 q v h
+ have h2 : ∀ q v, (uniTable bd (uniLook (uniTable bd (uniLook #[] #[] #[] 0) false) #[] #[] 1)
+ true).getD q none = some v → UniSpec bd 2 q v := uniTable_spec bd _ 1 h1'
+ have h2' : ∀ q v, uniLook (uniTable bd (uniLook #[] #[] #[] 0) false)
+ (uniTable bd (uniLook (uniTable bd (uniLook #[] #[] #[] 0) false) #[] #[] 1) true) #[] 2 q
+ = some v → UniSpec bd 2 q v := fun q v h => h2 q v h
+ have h3 : ∀ q v, (uniTable bd (uniLook (uniTable bd (uniLook #[] #[] #[] 0) false)
+ (uniTable bd (uniLook (uniTable bd (uniLook #[] #[] #[] 0) false) #[] #[] 1) true) #[] 2)
+ true).getD q none = some v → UniSpec bd 3 q v := uniTable_spec bd _ 2 h2'
+ intro r q v h
+ unfold UniTables.look ByteDFA.uniTables at h
+ match r, h with
+ | 0, h => exact h0 q v h
+ | 1, h => exact h1 q v h
+ | 2, h => exact h2 q v h
+ | 3, h => exact h3 q v h
+ | n + 4, h => simp [uniLook] at h
+
+/-! ### The prefix-tree check -/
+
+/-- A node of the UTF-8 prefix tree, from flat state `sid`: `r` continuation bytes remain,
+ `q` is the byte state after the prefix (`none`: dead), and the node covers the code points
+ `[base * 64^r, (base + 1) * 64^r)`. Only the scalar values in `[lo0, hi0]` (the code points
+ encoded with the current length) are checked. `mid`: `q` is inside a character, so it
+ must not accept. -/
+def nodeOK (f : FlatDFA) (bd : ByteDFA) (look : Nat → Nat → Option (Option Nat))
+ (sid lo0 hi0 : Nat) : (r : Nat) → (mid : Bool) → (q : Option Nat) → (base : Nat) → Bool
+ | r, mid, q, base =>
+ let lo := base * 64 ^ r
+ let hi := lo + 64 ^ r - 1
+ if hi < lo0 || hi0 < lo || (0xD800 ≤ lo && hi ≤ 0xDFFF) then true
+ else
+ (!mid || q.all (fun m => (bd.acceptOf m).isNone)) &&
+ ((128 ≤ lo && match f.clsOfRange lo hi with
+ | none => false
+ | some i => match q with
+ | none => f.stepCls sid i == none
+ | some s => look r s == some (f.stepCls sid i)) ||
+ match r with
+ | 0 => q == f.step sid (Char.ofNat lo)
+ | r' + 1 => (List.range 64).all (fun t =>
+ nodeOK f bd look sid lo0 hi0 r' (r' != 0)
+ (q.bind (fun s => bd.step s (UInt8.ofNat (0x80 + t)))) (base * 64 + t)))
+
+/-- All characters from flat state `sid`: the ASCII bytes, then the prefix trees under each
+ lead byte of a 2-, 3- and 4-byte encoding. -/
+def sidOK (f : FlatDFA) (bd : ByteDFA) (look : Nat → Nat → Option (Option Nat)) (sid : Nat) :
+ Bool :=
+ (List.range 128).all (fun t => bd.step sid (UInt8.ofNat t) == f.step sid (Char.ofNat t)) &&
+ (List.range 32).all (fun t =>
+ nodeOK f bd look sid 0x80 0x7FF 1 true (bd.step sid (UInt8.ofNat (0xC0 + t))) t) &&
+ (List.range 16).all (fun t =>
+ nodeOK f bd look sid 0x800 0xFFFF 2 true (bd.step sid (UInt8.ofNat (0xE0 + t))) t) &&
+ (List.range 8).all (fun t =>
+ nodeOK f bd look sid 0x10000 0x10FFFF 3 true (bd.step sid (UInt8.ofNat (0xF0 + t))) t)
+
+/-- The full-Unicode byte validator. When `true` (per lexer, `native_decide`), the byte
+ tables agree with the flat tables on every character (`agreements_of_byteUnicodeValid`). -/
+def byteUnicodeValid (bd : ByteDFA) (f : FlatDFA) : Bool :=
+ 0 < f.nStates && f.boundsOK &&
+ f.trans.all (fun t => t == 0 || t - 1 < f.nStates) &&
+ (List.range f.nStates).all (fun sid => bd.acceptOf sid == f.acceptOf sid) &&
+ (let u := bd.uniTables
+ (List.range f.nStates).all (fun sid => sidOK f bd u.look sid))
+
+/-! ### Soundness of the check -/
+
+/-- What a node guarantees for one character `c` it covers. -/
+def NodeSpec (f : FlatDFA) (bd : ByteDFA) (sid r : Nat) (mid : Bool) (q : Option Nat)
+ (c : Char) : Prop :=
+ q.bind (fun s => bd.runList s (Utf8.conts r c.toNat)) = f.step sid c ∧
+ (mid = true → ∀ m, q = some m → bd.acceptOf m = none) ∧
+ ∀ j, 0 < j → j < r → ∀ m,
+ q.bind (fun s => bd.runList s ((Utf8.conts r c.toNat).take j)) = some m → bd.acceptOf m = none
+
+theorem div_pow_succ (x r : Nat) : x / 64 ^ (r + 1) = x / 64 ^ r / 64 := by
+ rw [Nat.pow_succ, Nat.div_div_eq_div_mul]
+
+theorem nodeOK_spec (f : FlatDFA) (bd : ByteDFA) (look : Nat → Nat → Option (Option Nat))
+ (hlook : ∀ r q v, look r q = some v → UniSpec bd r q v) (hb : f.boundsOK = true)
+ (sid lo0 hi0 : Nat) :
+ ∀ r mid q base, nodeOK f bd look sid lo0 hi0 r mid q base = true →
+ ∀ c : Char, c.toNat / 64 ^ r = base → lo0 ≤ c.toNat → c.toNat ≤ hi0 →
+ NodeSpec f bd sid r mid q c := by
+ intro r
+ induction r with
+ | zero =>
+ intro mid q base h c hc h0 h1
+ simp only [Nat.pow_zero, Nat.div_one] at hc
+ subst hc
+ have hs := Utf8.not_surrogate c
+ unfold nodeOK at h
+ simp only [Nat.pow_zero, Nat.mul_one] at h
+ rw [ite_eq_right (by simp only [Bool.or_eq_true, decide_eq_true_eq, Bool.and_eq_true]; omega)] at h
+ simp only [Bool.and_eq_true, Bool.or_eq_true, Bool.not_eq_true'] at h
+ obtain ⟨hmid, hrest⟩ := h
+ refine ⟨?_, ?_, fun j hj hj' => by omega⟩
+ · simp only [Utf8.conts]
+ have hq : q.bind (fun s => bd.runList s []) = q := by cases q <;> rfl
+ rw [hq]
+ rcases hrest with hsc | hleaf
+ · simp only [decide_eq_true_eq] at hsc
+ obtain ⟨h128, hcls⟩ := hsc
+ split at hcls
+ · cases hcls
+ · rename_i i hi
+ have hci : f.classOf c = i := by
+ rw [FlatDFA.classOf_of_ge f c h128]
+ exact FlatDFA.clsOfRange_spec f hb _ _ i hi c.toNat (by omega) (by omega)
+ (Utf8.toNat_le_max c)
+ rw [FlatDFA.step_eq_stepCls, hci]
+ cases q with
+ | none => exact (by simpa using hcls : f.stepCls sid i = none).symm
+ | some s =>
+ simp only [beq_iff_eq] at hcls
+ have := (hlook 0 s _ hcls c.toNat).1
+ simpa [Utf8.conts, ByteDFA.runList] using this
+ · simp only [beq_iff_eq, Char.ofNat_toNat] at hleaf
+ exact hleaf
+ · intro hm m hqm
+ rcases hmid with hm' | hm'
+ · rw [hm] at hm'; cases hm'
+ · subst hqm
+ simpa using hm'
+ | succ r ih =>
+ intro mid q base h c hc h0 h1
+ have hs := Utf8.not_surrogate c
+ have hP : 0 < 64 ^ (r + 1) := Nat.pow_pos (by decide)
+ have hlo : base * 64 ^ (r + 1) ≤ c.toNat := by
+ rw [← hc]; exact Nat.div_mul_le_self _ _
+ have hhi : c.toNat < base * 64 ^ (r + 1) + 64 ^ (r + 1) := by
+ rw [← hc]; exact Nat.lt_div_mul_add hP
+ unfold nodeOK at h
+ rw [ite_eq_right (by simp only [Bool.or_eq_true, decide_eq_true_eq, Bool.and_eq_true]; omega)] at h
+ simp only [Bool.and_eq_true, Bool.or_eq_true, Bool.not_eq_true'] at h
+ obtain ⟨hmid, hrest⟩ := h
+ have hmidspec : mid = true → ∀ m, q = some m → bd.acceptOf m = none := by
+ intro hm m hqm
+ rcases hmid with hm' | hm'
+ · rw [hm] at hm'; cases hm'
+ · subst hqm
+ simpa using hm'
+ rcases hrest with hsc | hdesc
+ · -- uniform shortcut
+ simp only [decide_eq_true_eq] at hsc
+ obtain ⟨h128, hcls⟩ := hsc
+ split at hcls
+ · cases hcls
+ · rename_i i hi
+ have hci : f.classOf c = i := by
+ rw [FlatDFA.classOf_of_ge f c (by omega)]
+ exact FlatDFA.clsOfRange_spec f hb _ _ i hi c.toNat hlo (by omega)
+ (Utf8.toNat_le_max c)
+ refine ⟨?_, hmidspec, ?_⟩
+ · rw [FlatDFA.step_eq_stepCls, hci]
+ cases q with
+ | none => exact (by simpa using hcls : f.stepCls sid i = none).symm
+ | some s =>
+ simp only [beq_iff_eq] at hcls
+ exact (hlook _ s _ hcls c.toNat).1
+ · intro j hj hjr m hm
+ cases q with
+ | none => cases hm
+ | some s =>
+ simp only [beq_iff_eq] at hcls
+ exact (hlook _ s _ hcls c.toNat).2 j hj hjr m hm
+ · -- descend into the continuation byte of `c`
+ simp only [List.all_eq_true, List.mem_range] at hdesc
+ have ht : (c.toNat / 64 ^ r) % 64 < 64 := Nat.mod_lt _ (by decide)
+ have hch := hdesc _ ht
+ have hbase : c.toNat / 64 ^ r = base * 64 + (c.toNat / 64 ^ r) % 64 := by
+ rw [div_pow_succ] at hc
+ have := Nat.div_add_mod (c.toNat / 64 ^ r) 64
+ omega
+ have hsp := ih _ _ _ hch c hbase h0 h1
+ have hb' : Utf8.cont (c.toNat / 64 ^ r) = UInt8.ofNat (0x80 + (c.toNat / 64 ^ r) % 64) := rfl
+ have hbind : ∀ (l : List UInt8), q.bind (fun s => bd.runList s (Utf8.cont (c.toNat / 64 ^ r) :: l))
+ = (q.bind (fun s => bd.step s (UInt8.ofNat (0x80 + (c.toNat / 64 ^ r) % 64)))).bind
+ (fun s => bd.runList s l) := by
+ intro l
+ rw [hb']
+ cases q with
+ | none => rfl
+ | some s => simp only [Option.bind_some, ByteDFA.runList_cons]
+ refine ⟨?_, hmidspec, ?_⟩
+ · simp only [Utf8.conts]
+ rw [hbind]
+ exact hsp.1
+ · intro j hj hjr m hm
+ obtain ⟨j', rfl⟩ : ∃ j', j = j' + 1 := ⟨j - 1, by omega⟩
+ simp only [Utf8.conts, List.take_succ_cons] at hm
+ rw [hbind] at hm
+ cases j' with
+ | zero =>
+ simp only [List.take_zero] at hm
+ have hq' : ∀ (o : Option Nat), o.bind (fun s => bd.runList s []) = o := by
+ intro o; cases o <;> rfl
+ rw [hq'] at hm
+ have hr : (r != 0) = true := by simp; omega
+ exact hsp.2.1 hr m hm
+ | succ j'' => exact hsp.2.2 (j'' + 1) (by omega) (by omega) m hm
+
+/-- The four agreements on every character follow from `byteUnicodeValid`. -/
+theorem agreements_of_byteUnicodeValid (bd : ByteDFA) (f : FlatDFA)
+ (h : byteUnicodeValid bd f = true) :
+ ByteStepAgree bd f ∧ ByteNoMidAccept bd f ∧ ByteAcceptAgree bd f ∧ ByteStatesInRange f ∧
+ 0 < f.nStates := by
+ unfold byteUnicodeValid at h
+ simp only [Bool.and_eq_true, decide_eq_true_eq, List.all_eq_true, List.mem_range,
+ beq_iff_eq] at h
+ obtain ⟨⟨⟨⟨hpos, hb⟩, htrans⟩, hacc⟩, hsid⟩ := h
+ have hlook := uniTables_spec bd
+ -- the per-character facts, for each encoding length
+ have key : ∀ sid, sid < f.nStates → ∀ c : Char,
+ bd.runList sid (String.utf8EncodeChar c) = FlatDFA.step f sid c ∧
+ ∀ k, 0 < k → k < (String.utf8EncodeChar c).length →
+ ∀ mid, bd.runList sid ((String.utf8EncodeChar c).take k) = some mid →
+ bd.acceptOf mid = none := by
+ intro sid hsl c
+ have hs := hsid sid hsl
+ unfold sidOK at hs
+ simp only [Bool.and_eq_true, List.all_eq_true, List.mem_range, beq_iff_eq] at hs
+ obtain ⟨⟨⟨h1, h2⟩, h3⟩, h4⟩ := hs
+ -- a lead byte followed by a node
+ have lead : ∀ (r : Nat) (b : UInt8) (lo0 hi0 : Nat),
+ nodeOK f bd bd.uniTables.look sid lo0 hi0 r true (bd.step sid b) (c.toNat / 64 ^ r) = true →
+ lo0 ≤ c.toNat → c.toNat ≤ hi0 →
+ bd.runList sid (b :: Utf8.conts r c.toNat) = FlatDFA.step f sid c ∧
+ ∀ k, 0 < k → k < r + 1 →
+ ∀ mid, bd.runList sid ((b :: Utf8.conts r c.toNat).take k) = some mid →
+ bd.acceptOf mid = none := by
+ intro r b lo0 hi0 hn hl hh
+ have hsp := nodeOK_spec f bd _ hlook hb sid lo0 hi0 r true _ _ hn c rfl hl hh
+ refine ⟨by rw [ByteDFA.runList_cons]; exact hsp.1, ?_⟩
+ intro k hk hkr m hm
+ obtain ⟨k', rfl⟩ : ∃ k', k = k' + 1 := ⟨k - 1, by omega⟩
+ simp only [List.take_succ_cons, ByteDFA.runList_cons] at hm
+ cases k' with
+ | zero =>
+ simp only [List.take_zero] at hm
+ have hq' : ∀ (o : Option Nat), o.bind (fun s => bd.runList s []) = o := by
+ intro o; cases o <;> rfl
+ rw [hq'] at hm
+ exact hsp.2.1 rfl m hm
+ | succ k'' => exact hsp.2.2 (k'' + 1) (by omega) (by omega) m hm
+ rcases Char.utf8Size_eq c with hk | hk | hk | hk
+ · rw [Utf8.enc1 c hk]
+ have hv := Char.utf8Size_eq_one_iff.1 hk
+ simp only [UInt32.le_iff_toNat_le, UInt32.reduceToNat, Utf8.toNat_val] at hv
+ have := h1 c.toNat (by omega)
+ rw [Char.ofNat_toNat] at this
+ refine ⟨?_, fun k hk hk' => by simp at hk'; omega⟩
+ rw [ByteDFA.runList_cons]
+ rw [this]
+ cases FlatDFA.step f sid c <;> rfl
+ · rw [Utf8.enc2 c hk]
+ have hv := Char.utf8Size_eq_two_iff.1 hk
+ simp only [UInt32.lt_iff_toNat_lt, UInt32.le_iff_toNat_le, UInt32.reduceToNat,
+ Utf8.toNat_val] at hv
+ have := lead 1 _ 0x80 0x7FF (h2 _ (by omega)) (by omega) (by omega)
+ simpa using this
+ · rw [Utf8.enc3 c hk]
+ have hv := Char.utf8Size_eq_three_iff.1 hk
+ simp only [UInt32.lt_iff_toNat_lt, UInt32.le_iff_toNat_le, UInt32.reduceToNat,
+ Utf8.toNat_val] at hv
+ have := lead 2 _ 0x800 0xFFFF (h3 _ (by omega)) (by omega) (by omega)
+ simpa using this
+ · rw [Utf8.enc4 c hk]
+ have hv := Char.utf8Size_eq_four_iff.1 hk
+ simp only [UInt32.lt_iff_toNat_lt, UInt32.reduceToNat, Utf8.toNat_val] at hv
+ have hmax := Utf8.toNat_le_max c
+ have := lead 3 _ 0x10000 0x10FFFF (h4 _ (by omega)) (by omega) (by omega)
+ simpa using this
+ refine ⟨fun sid hs c => (key sid hs c).1, fun sid hs c k hk hk' mid hm => (key sid hs c).2 k hk hk' mid hm,
+ fun sid hs => hacc sid hs, ?_, hpos⟩
+ intro sid _ c next hn
+ unfold FlatDFA.step at hn
+ simp only at hn
+ split at hn
+ · cases hn
+ · rename_i ht
+ simp only [Option.some.injEq] at hn
+ subst hn
+ rw [Array.getD_eq_getD_getElem?] at ht ⊢
+ cases hget : f.trans[sid * f.nClasses + f.classOf c]? with
+ | none => rw [hget] at ht; simp at ht
+ | some t =>
+ rw [hget] at ht
+ simp only [Option.getD_some, beq_iff_eq] at ht ⊢
+ have hmem : t ∈ f.trans := by
+ rw [Array.getElem?_eq_some_iff] at hget
+ obtain ⟨hi, hget⟩ := hget
+ rw [← hget]; exact Array.getElem_mem hi
+ have := (Array.all_eq_true_iff_forall_mem.mp htrans) t hmem
+ simp only [Bool.or_eq_true, beq_iff_eq, decide_eq_true_eq] at this
+ omega
+
+end Lexer
diff --git a/LeanParserGenerator/Lexer/ByteValidator.lean b/LeanParserGenerator/Lexer/ByteValidator.lean
index df8dd47..30536f6 100644
--- a/LeanParserGenerator/Lexer/ByteValidator.lean
+++ b/LeanParserGenerator/Lexer/ByteValidator.lean
@@ -26,10 +26,12 @@ byte-expands, so the byte scanner inherits the whole soundness chain
The connection is a per-code-point simulation. From a boundary state `sid`,
consuming the UTF-8 bytes of a char `c` (`String.utf8EncodeChar c`) must drive the
byte tables to the boundary state `FlatDFA.step f sid c`, passing only through
-non-accepting intermediate states so no accept is recorded mid-character. Three
-Boolean conditions (`byteValidate`), discharged per lexer by `native_decide`, imply
-that simulation at one representative per flat class — sound because `FlatDFA.step`
-is constant on a flat class (already established for the `FlatDFA`).
+non-accepting intermediate states so no accept is recorded mid-character. The three
+Boolean conditions of `byteValidate` check that simulation at one representative per
+flat class. That does not cover the class: `FlatDFA.step` is constant on a class, but
+the byte run is not, since the characters of a class have different bytes. The check
+that does imply the simulation for every character is `byteUnicodeValid`
+(`Lexer/ByteUnicode.lean`).
The input is modelled as `encodeChars cs = cs.flatMap utf8EncodeChar`, the UTF-8
byte stream of a `List Char`. The runtime feeds `input.toUTF8`, and
@@ -506,8 +508,8 @@ Chaining `byteScanGo_eq_listGo` (ByteArray → list model), the walk theorem
`Array Char` flat walk gives: the byte scan over `s.toUTF8` and the flat scan over
`s.toList` record the same rule. Combined with `flatScanArr_eq_scan` (the flat scanner
= `DFA.scan`), the byte scanner inherits the flat/spec soundness on the rule. The
-agreements are hypotheses here; the Boolean validator that discharges them per lexer
-is the remaining work (§9.6.3). -/
+agreements are hypotheses here. `byteValidate` above does not imply them (one character
+per class does not cover a class); `byteUnicodeValid` (`Lexer/ByteUnicode.lean`) does. -/
/-- The `Array Char` flat walk equals the char-list flat walk on the dropped suffix.
Both are the same recursion; by induction on fuel. -/
@@ -570,9 +572,7 @@ theorem byteScan_rule_eq_flatScanArr (bd : ByteDFA) (f : FlatDFA)
For a single-byte (ASCII, `utf8Size = 1`) code point, `utf8EncodeChar c = [b]` with
`b = c.val.toUInt8`, so the byte run is one `bd.step`. This is the provable core of
`ByteStepAgree`: the byte automaton's behavior on an ASCII char is a single validated
-byte transition. The non-ASCII (multi-byte) fragment requires the byte automaton to
-recognize the UTF-8 ranges of a class, which is the range-coverage obligation noted
-in docs/DESIGN.md §9.6.3. -/
+byte transition. `Lexer/ByteUnicode.lean` covers all code points. -/
/-- On a single-byte code point, the byte run is one step on that byte. -/
theorem runList_utf8EncodeChar_ascii (bd : ByteDFA) (sid : Nat) (c : Char)
diff --git a/LeanParserGenerator/Lexer/LexerSound.lean b/LeanParserGenerator/Lexer/LexerSound.lean
new file mode 100644
index 0000000..5c6202c
--- /dev/null
+++ b/LeanParserGenerator/Lexer/LexerSound.lean
@@ -0,0 +1,211 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+Facts about a generated lexer that the end-to-end theorems use, stated over its `FastActs`
+table so that the generator can discharge them one rule at a time.
+
+* `tokenizeFlatStrPos_sound`: a successful positioned flat tokenization is a maximal-munch
+ `Tokenization` of the input, and the spec `tokenize` returns the same token values. For a
+ lexer with one validated start mode whose rules all `stay`. It chains
+ `tokenizeFlatStrPos_val`, `tokenizeFlatStr_eq_tokenize` and `tokenize_sound`.
+* `pullSource_fails_tokens`: every token the pull lexer delivers before a lex error comes from
+ a rule's action. With `noEof` (no rule emits the EOF token), none of them is the EOF token.
+
+The per-rule premises are lists of proofs: `AllL P l` (every element of `l` satisfies `P`),
+from which `FastActs.get_of_allL` reads off `P (fa.get m r)` at every index.
+-/
+public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.BytePull
+public import LeanParserGenerator.Lexer.Tokenize
+
+
+@[expose] public section
+
+namespace Lexer
+
+variable {Tok : Type}
+
+/-! ### Properties of every action -/
+
+/-- Every element of a list satisfies `P`. One constructor per element, so a generated
+ proof is a chain of per-element proofs. -/
+inductive AllL {α : Type} (P : α → Prop) : List α → Prop where
+ | nil : AllL P []
+ | cons {a : α} {l : List α} : P a → AllL P l → AllL P (a :: l)
+
+theorem AllL.getD {α : Type} {P : α → Prop} {d : α} (hd : P d) :
+ ∀ {l : List α}, AllL P l → ∀ i, P (l.toArray.getD i d)
+ | [], .nil, i => by simpa [Array.getD_eq_getD_getElem?] using hd
+ | _ :: _, .cons ha hl, i => by
+ cases i with
+ | zero => simpa [Array.getD_eq_getD_getElem?] using ha
+ | succ i => simpa [Array.getD_eq_getD_getElem?] using AllL.getD hd hl i
+
+/-- `P` holds at every index of `fa`, given a proof per entry and one for the missing entry. -/
+theorem FastActs.get_of_allL [Inhabited Tok] (fa : FastActs Tok) (P : FastAct Tok → Prop)
+ (hskip : P FastAct.skip)
+ (h : AllL (fun row : Array (FastAct Tok) => AllL P row.toList) fa.toList) :
+ ∀ m r, P (fa.get m r) := by
+ intro m r
+ rcases fa with ⟨rows⟩
+ unfold FastActs.get
+ have hrow : AllL P ((rows.toArray.getD m #[]).toList) :=
+ AllL.getD (P := fun row : Array (FastAct Tok) => AllL P row.toList) (d := #[]) AllL.nil h m
+ have := AllL.getD (d := FastAct.skip) hskip hrow r
+ simpa using this
+
+/-- The rule at index `r` of mode `m` ignores its lexeme whenever the `textDep` flag is
+ `false`. Read off a chain over the flags and the entries of one mode. -/
+theorem FastActs.textIndep_of_forall₂ [Inhabited Tok] (fa : FastActs Tok) (flags : Array Bool)
+ (m : Nat)
+ (h : Forall₂ (fun (b : Bool) (f : FastAct Tok) => b = false → ∀ s, f.toAct s = f.toAct "")
+ flags.toList (fa.getD m #[]).toList) :
+ ∀ r, flags.getD r true = false → ∀ s, (fa.get m r).toAct s = (fa.get m r).toAct "" := by
+ unfold FastActs.get
+ generalize fa.getD m #[] = row at h ⊢
+ rcases flags with ⟨flags⟩
+ rcases row with ⟨row⟩
+ simp only at h
+ induction h with
+ | nil => intro r hr; simp [Array.getD_eq_getD_getElem?] at hr
+ | @cons b f bs fs hbf _ ih =>
+ intro r hr s
+ cases r with
+ | zero => simp [Array.getD_eq_getD_getElem?] at hr ⊢; exact hbf hr s
+ | succ r =>
+ have := ih r (by simpa [Array.getD_eq_getD_getElem?] using hr) s
+ simpa [Array.getD_eq_getD_getElem?] using this
+
+/-! ### Tokenization soundness of the positioned flat lexer -/
+
+/-- **Positioned flat tokenizer soundness.** For a lexer whose start mode is validated (spec
+ DFA by `validate`, flat table by `flatValidate`) and whose start-mode rules all `stay`, a
+ successful `tokenizeFlatStrPos` is a maximal-munch `Tokenization` of the input, and the
+ spec `tokenize` returns the same token values. -/
+theorem tokenizeFlatStrPos_sound [Inhabited Tok] (cf : CompiledFlat Tok) (fa : FastActs Tok)
+ (hagree : fa.Agrees cf.base.acts) {rules : Array Regex} {dfa : DFA} {cert : LexCert}
+ (hval : validate rules dfa cert = true) (hdfa : cf.base.dfas.getD cf.base.start default = dfa)
+ (hflat : flatValidate (cf.flats.getD cf.base.start default) dfa = true)
+ (hpos : 0 < dfa.states.size)
+ (hstay : ∀ r, (fa.get cf.base.start r).trans = .stay)
+ (htext : ∀ r, cf.needsText cf.base.start r = false →
+ ∀ s, (fa.get cf.base.start r).toAct s = (fa.get cf.base.start r).toAct "")
+ {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : tokenizeFlatStrPos cf input = .ok ts) :
+ Tokenization rules input.toList ∧ tokenize cf.base input = .ok (ts.map (·.val)) := by
+ have hstay' : ∀ (s : String) (rule : Nat),
+ (((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) s).trans = Trans.stay := by
+ intro s rule
+ rw [hagree]
+ exact hstay rule
+ have htext' : ∀ (rule : Nat), cf.needsText cf.base.start rule = false →
+ ∀ (s : String), ((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) s
+ = ((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) "" := by
+ intro rule hr s
+ rw [hagree, hagree]
+ exact htext rule hr s
+ have hbare : tokenizeFlatStr cf input = .ok (ts.map (·.val)) := by
+ rw [← tokenizeFlatStrPos_val, h]; rfl
+ have hspec : tokenize cf.base input = .ok (ts.map (·.val)) := by
+ rw [← tokenizeFlatStr_eq_tokenize cf (by rw [hdfa]; exact hflat) (by rw [hdfa]; exact hpos)
+ hstay' htext' input]
+ exact hbare
+ exact ⟨tokenize_sound hval cf.base hdfa hstay' hspec, hspec⟩
+
+/-! ### Tokens the pull lexer delivers -/
+
+/-- A token `pullAux` delivers was emitted by some rule's action. -/
+theorem pullAux_tok_emit (cb : CompiledByte Tok) (bytes : ByteArray) :
+ ∀ (fuel i : Nat) (stack : List Nat) (t : Tok) (a b f' : Nat) (s' : List Nat),
+ pullAux cb bytes fuel i stack = .tok t a b f' s' →
+ ∃ m r s, (((cb.flat.base.acts.getD m #[]).getD r (fun _ => {})) s).emit = some t := by
+ intro fuel
+ induction fuel with
+ | zero => intro i stack t a b f' s' h; simp [pullAux] at h
+ | succ fuel ih =>
+ intro i stack t a b f' s'
+ unfold pullAux
+ by_cases hi : i ≥ bytes.size
+ · simp only [hi, ite_true]
+ rcases stack with _ | ⟨x, _ | ⟨c, r⟩⟩
+ · intro h; cases h
+ · cases cb.flat.base.eofToken <;> intro h <;> cases h
+ · intro h; cases h
+ · simp only [hi, ite_false]
+ cases DFA.byteScan (cb.bytes.getD (stack.headD cb.flat.base.start) default) bytes i with
+ | none => intro h; cases h
+ | some res =>
+ obtain ⟨rule, endi⟩ := res
+ by_cases he : endi ≤ i
+ · simp only [he, ite_true]; intro h; cases h
+ · simp only [he, ite_false]
+ cases hem : (((cb.flat.base.acts.getD (stack.headD cb.flat.base.start) #[]).getD rule
+ (fun _ => {})) (bif cb.flat.needsText (stack.headD cb.flat.base.start) rule then
+ String.fromUTF8! (bytes.extract i endi) else "")).emit with
+ | none => intro h; exact ih _ _ _ _ _ _ _ h
+ | some tok =>
+ intro h
+ simp only [Pull.tok.injEq] at h
+ obtain ⟨rfl, -⟩ := h
+ exact ⟨_, _, _, hem⟩
+
+/-- Every token delivered before a lex error was emitted by a rule; under `hP` it satisfies
+ `P`. -/
+theorem pullSource_fails_tokens [Inhabited Tok] (cb : CompiledByte Tok) (fa : FastActs Tok)
+ (hagree : fa.Agrees cb.flat.base.acts) (P : Tok → Prop)
+ (hP : ∀ m r, (fa.get m r).emit = true → ∀ s, P ((fa.get m r).tok s)) (bytes : ByteArray) :
+ ∀ (st : PullSt) (ts : List (Runtime.Positioned Tok)) (e : String),
+ Runtime.Exec.Fails (pullSource (pullAux cb bytes)) st ts e → ∀ t ∈ ts, P t.val := by
+ intro st ts e hF
+ induction hF with
+ | err _ => intro t ht; cases ht
+ | @tok s s' t sp ts' e hn hF' ih =>
+ intro x hx
+ rcases List.mem_cons.mp hx with rfl | hx
+ · simp only [pullSource] at hn
+ split at hn
+ · cases hn
+ · cases hpa : pullAux cb bytes s.fuel s.pos s.stack with
+ | err e' => rw [hpa] at hn; cases hn
+ | done => rw [hpa] at hn; cases hn
+ | tok t0 a b lf ls =>
+ rw [hpa] at hn
+ simp only [Runtime.Exec.Step.tok.injEq] at hn
+ obtain ⟨rfl, -, -⟩ := hn
+ obtain ⟨m, r, s0, hem⟩ := pullAux_tok_emit cb bytes _ _ _ _ _ _ _ _ hpa
+ rw [hagree] at hem
+ simp only [FastAct.toAct] at hem
+ cases hf : (fa.get m r).emit with
+ | false => rw [hf] at hem; cases hem
+ | true =>
+ rw [hf] at hem
+ simp only [Bool.cond_true, Option.some.injEq] at hem
+ rw [← hem]
+ exact hP m r hf s0
+ | eofTok t0 n =>
+ -- after the EOF token the source is done, so it cannot fail
+ rw [hpa] at hn
+ simp only [Runtime.Exec.Step.tok.injEq] at hn
+ obtain ⟨-, -, rfl⟩ := hn
+ exfalso
+ cases hF' with
+ | err h => simp [pullSource] at h
+ | tok h _ => simp [pullSource] at h
+ · exact ih x hx
+
+end Lexer
diff --git a/LeanParserGenerator/Lexer/Lexing.lean b/LeanParserGenerator/Lexer/Lexing.lean
new file mode 100644
index 0000000..97f7fb4
--- /dev/null
+++ b/LeanParserGenerator/Lexer/Lexing.lean
@@ -0,0 +1,661 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+Completeness and uniqueness of single-mode maximal-munch tokenization, at the level of
+characters and at the level of byte positions (docs/DESIGN.md §9.8).
+
+`Lexer.Tokenization` (`Lexer/Spec.lean`) is a `Prop` with no data, so it has nothing to be
+unique about. This file adds two derivations that carry their data:
+
+ * `Lexing rules cs steps`: `cs` splits into maximal-munch steps `(rule, len)`. Each step
+ consumes at most the remaining input. `Lexing.unique`: the steps are determined by
+ `cs` (from `matchStep_unique`). `lexingTokens` is the token list the actions emit.
+ `tokenize_complete`: a `Lexing` of the input makes `tokenize` succeed with
+ `lexingTokens`. `tokenize_lexing` is the converse with data.
+ * `PosLexing rules act eof s p ts`: the same over byte positions of a `String`. Each
+ step goes from `p` to `q`, its lexeme is `s.extract p q`, and an emitted token has the
+ span `⟨p.offset, q.offset⟩`. A step whose action emits nothing is a skip, so the bytes
+ between two consecutive tokens are consumed by skip steps. The end-of-input token has
+ the empty span at the end. `tokenizeFlatStrPos_posLexing` and
+ `posLexing_tokenizeFlatStrPos`: the positioned flat tokenizer computes exactly the
+ `PosLexing` of its input. `PosLexing.unique` and `PosLexing.spans_ordered` follow.
+
+All theorems are for one validated mode whose actions keep the mode stack put, the
+condition of `tokenize_sound`.
+-/
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.FlatTokenize
+public import LeanParserGenerator.Lexer.FlatScan
+
+
+@[expose] public section
+
+namespace Lexer
+
+variable {Tok : Type}
+
+/-! ### Character-level derivations with steps -/
+
+/-- A maximal-munch tokenization of `cs` by `rules`, with its steps `(rule, len)`. Each step
+ is the maximal-munch winner at its position (`MatchStep`) and consumes at most the
+ remaining input. -/
+inductive Lexing (rules : Array Regex) : List Char → List (Nat × Nat) → Prop
+ | nil : Lexing rules [] []
+ | cons {cs : List Char} {rule len : Nat} {steps : List (Nat × Nat)} :
+ MatchStep rules cs rule len → len ≤ cs.length →
+ Lexing rules (cs.drop len) steps → Lexing rules cs ((rule, len) :: steps)
+
+/-- A `Lexing` is a `Tokenization`. -/
+theorem Lexing.tokenization {rules : Array Regex} {cs : List Char} {steps : List (Nat × Nat)}
+ (h : Lexing rules cs steps) : Tokenization rules cs := by
+ induction h with
+ | nil => exact .nil
+ | cons hms _ _ ih => exact .cons hms ih
+
+/-- **Uniqueness of the maximal-munch tokenization.** The steps of a `Lexing` of `cs` are
+ determined by `cs`. -/
+theorem Lexing.unique {rules : Array Regex} {cs : List Char} {s₁ s₂ : List (Nat × Nat)}
+ (h₁ : Lexing rules cs s₁) (h₂ : Lexing rules cs s₂) : s₁ = s₂ := by
+ induction h₁ generalizing s₂ with
+ | nil =>
+ cases h₂ with
+ | nil => rfl
+ | cons hms hle _ => exact absurd (Nat.lt_of_lt_of_le hms.lenPos hle) (by simp)
+ | cons hms₁ hle₁ _ ih =>
+ cases h₂ with
+ | nil => exact absurd (Nat.lt_of_lt_of_le hms₁.lenPos hle₁) (by simp)
+ | cons hms₂ hle₂ t₂ =>
+ obtain ⟨hr, hl⟩ := matchStep_unique hms₁ hms₂ hle₁ hle₂
+ subst hr hl
+ rw [ih t₂]
+
+/-- The tokens emitted by the steps of a single-mode run in mode `m` (no end-of-input
+ token). -/
+def lexingTokensAux (c : Compiled Tok) (m : Nat) : List Char → List (Nat × Nat) → List Tok
+ | _, [] => []
+ | cs, (rule, len) :: steps =>
+ (match (((c.acts.getD m #[]).getD rule (fun _ => {})) (String.ofList (cs.take len))).emit with
+ | some tok => [tok]
+ | none => []) ++ lexingTokensAux c m (cs.drop len) steps
+
+/-- The tokens of a `Lexing` of `cs` in mode `m`, followed by the end-of-input token. -/
+def lexingTokens (c : Compiled Tok) (m : Nat) (cs : List Char) (steps : List (Nat × Nat)) :
+ List Tok :=
+ lexingTokensAux c m cs steps ++ c.eofToken.toList
+
+/-- The loop of `tokenize` follows a `Lexing`, with enough fuel. -/
+theorem tokenizeAuxDFA_of_lexing {rules : Array Regex} {dfa : DFA} {cert : LexCert}
+ (hval : validate rules dfa cert = true) (c : Compiled Tok) (m : Nat)
+ (hdfa : c.dfas.getD m default = dfa)
+ (hstay : ∀ (s : String) (rule : Nat),
+ (((c.acts.getD m #[]).getD rule (fun _ => {})) s).trans = Trans.stay)
+ {cs : List Char} {steps : List (Nat × Nat)} (h : Lexing rules cs steps) :
+ ∀ (fuel pos : Nat) (acc : List Tok), cs.length < fuel →
+ tokenizeAuxDFA c fuel cs pos [m] acc =
+ .ok (acc.reverse ++ lexingTokensAux c m cs steps ++ c.eofToken.toList) := by
+ induction h with
+ | nil =>
+ intro fuel pos acc hf
+ obtain ⟨f, rfl⟩ : ∃ f, fuel = f + 1 := ⟨fuel - 1, by simp at hf; omega⟩
+ simp only [tokenizeAuxDFA, lexingTokensAux, List.append_nil]
+ cases c.eofToken with
+ | none => simp
+ | some tok => simp
+ | @cons cs rule len steps hms hle _ ih =>
+ intro fuel pos acc hf
+ obtain ⟨f, rfl⟩ : ∃ f, fuel = f + 1 := ⟨fuel - 1, by omega⟩
+ obtain ⟨ch, cs', rfl⟩ : ∃ ch cs', cs = ch :: cs' := by
+ cases cs with
+ | nil => exact absurd (Nat.lt_of_lt_of_le hms.lenPos hle) (by simp)
+ | cons ch cs' => exact ⟨ch, cs', rfl⟩
+ have hscan : DFA.scan dfa (ch :: cs') = some (rule, len) := scan_of_matchStep hval hms hle
+ have hlen0 : len ≠ 0 := Nat.pos_iff_ne_zero.mp hms.lenPos
+ rw [tokenizeAuxDFA_cons]
+ simp only [List.headD_cons, hdfa, hscan, hlen0, ite_false]
+ have htr := hstay (String.ofList ((ch :: cs').take len)) rule
+ simp only [htr]
+ have hf' : ((ch :: cs').drop len).length < f := by
+ simp only [List.length_drop, List.length_cons] at hf ⊢; have := hms.lenPos; omega
+ rw [ih f (pos + len) _ hf']
+ simp only [lexingTokensAux]
+ cases (((c.acts.getD m #[]).getD rule (fun _ => {})) (String.ofList ((ch :: cs').take len))).emit with
+ | none => simp
+ | some tok => simp
+
+/-- **Completeness of `tokenize` (single mode).** If the start mode is validated for
+ `rules`, its actions keep the mode stack put, and `input` has a maximal-munch `Lexing`
+ with steps `steps`, then `tokenize` succeeds with the tokens of those steps. -/
+theorem tokenize_complete {rules : Array Regex} {dfa : DFA} {cert : LexCert}
+ (hval : validate rules dfa cert = true) (c : Compiled Tok)
+ (hdfa : c.dfas.getD c.start default = dfa)
+ (hstay : ∀ (s : String) (rule : Nat),
+ (((c.acts.getD c.start #[]).getD rule (fun _ => {})) s).trans = Trans.stay)
+ {input : String} {steps : List (Nat × Nat)} (h : Lexing rules input.toList steps) :
+ tokenize c input = .ok (lexingTokens c c.start input.toList steps) := by
+ simp only [tokenize]
+ rw [tokenizeAuxDFA_of_lexing hval c c.start hdfa hstay h _ 0 [] (by omega)]
+ simp [lexingTokens]
+
+/-- The loop of `tokenize` succeeds only along a `Lexing`. -/
+theorem lexing_of_tokenizeAuxDFA {rules : Array Regex} {dfa : DFA} {cert : LexCert}
+ (hval : validate rules dfa cert = true) (c : Compiled Tok) (m : Nat)
+ (hdfa : c.dfas.getD m default = dfa)
+ (hstay : ∀ (s : String) (rule : Nat),
+ (((c.acts.getD m #[]).getD rule (fun _ => {})) s).trans = Trans.stay) :
+ ∀ (fuel : Nat) (cs : List Char) (pos : Nat) (acc toks : List Tok),
+ tokenizeAuxDFA c fuel cs pos [m] acc = .ok toks →
+ ∃ steps, Lexing rules cs steps ∧
+ toks = acc.reverse ++ lexingTokensAux c m cs steps ++ c.eofToken.toList
+ | 0, _, _, _, _, h => by simp [tokenizeAuxDFA] at h
+ | _ + 1, [], _, acc, toks, h => by
+ refine ⟨[], .nil, ?_⟩
+ simp only [tokenizeAuxDFA] at h
+ cases he : c.eofToken with
+ | none => rw [he] at h; simp at h; simp [h, lexingTokensAux]
+ | some tok => rw [he] at h; simp at h; simp [← h, lexingTokensAux]
+ | fuel + 1, ch :: cs, pos, acc, toks, h => by
+ rw [tokenizeAuxDFA_cons] at h
+ simp only [List.headD_cons, hdfa] at h
+ cases hscan : DFA.scan dfa (ch :: cs) with
+ | none => rw [hscan] at h; simp at h
+ | some p =>
+ obtain ⟨rule, len⟩ := p
+ rw [hscan] at h
+ by_cases hlen : len = 0
+ · simp [hlen] at h
+ · have hms : MatchStep rules (ch :: cs) rule len :=
+ scan_matchStep hval hscan (Nat.pos_of_ne_zero hlen)
+ have hle : len ≤ (ch :: cs).length := scan_len_le dfa _ rule len hscan
+ simp only [hlen, ite_false, hstay (String.ofList ((ch :: cs).take len)) rule] at h
+ obtain ⟨steps, hl, ht⟩ := lexing_of_tokenizeAuxDFA hval c m hdfa hstay fuel _ _ _ toks h
+ refine ⟨(rule, len) :: steps, .cons hms hle hl, ?_⟩
+ rw [ht]
+ simp only [lexingTokensAux]
+ cases (((c.acts.getD m #[]).getD rule (fun _ => {})) (String.ofList ((ch :: cs).take len))).emit with
+ | none => simp
+ | some tok => simp
+
+/-- **Soundness of `tokenize` with steps.** A successful `tokenize` gives a `Lexing` of the
+ input whose tokens are the result. -/
+theorem tokenize_lexing {rules : Array Regex} {dfa : DFA} {cert : LexCert}
+ (hval : validate rules dfa cert = true) (c : Compiled Tok)
+ (hdfa : c.dfas.getD c.start default = dfa)
+ (hstay : ∀ (s : String) (rule : Nat),
+ (((c.acts.getD c.start #[]).getD rule (fun _ => {})) s).trans = Trans.stay)
+ {input : String} {toks : List Tok} (h : tokenize c input = .ok toks) :
+ ∃ steps, Lexing rules input.toList steps ∧ toks = lexingTokens c c.start input.toList steps := by
+ simp only [tokenize] at h
+ obtain ⟨steps, hl, ht⟩ := lexing_of_tokenizeAuxDFA hval c c.start hdfa hstay _ _ _ _ _ h
+ exact ⟨steps, hl, by simpa [lexingTokens] using ht⟩
+
+/-! ### The flat positioned tokenizer, at the level of values -/
+
+/-- **Completeness of the positioned flat tokenizer.** A `Lexing` of the input makes
+ `tokenizeFlatStrPos` succeed, and the token values are the tokens of the steps. The
+ hypotheses are those of `tokenizeFlatStrPos_sound`. -/
+theorem tokenizeFlatStrPos_complete [Inhabited Tok] (cf : CompiledFlat Tok) (fa : FastActs Tok)
+ (hagree : fa.Agrees cf.base.acts) {rules : Array Regex} {dfa : DFA} {cert : LexCert}
+ (hval : validate rules dfa cert = true) (hdfa : cf.base.dfas.getD cf.base.start default = dfa)
+ (hflat : flatValidate (cf.flats.getD cf.base.start default) dfa = true)
+ (hpos : 0 < dfa.states.size)
+ (hstay : ∀ r, (fa.get cf.base.start r).trans = .stay)
+ (htext : ∀ r, cf.needsText cf.base.start r = false →
+ ∀ s, (fa.get cf.base.start r).toAct s = (fa.get cf.base.start r).toAct "")
+ {input : String} {steps : List (Nat × Nat)} (h : Lexing rules input.toList steps) :
+ ∃ ts, tokenizeFlatStrPos cf input = .ok ts ∧
+ ts.map (·.val) = lexingTokens cf.base cf.base.start input.toList steps := by
+ have hstay' : ∀ (s : String) (rule : Nat),
+ (((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) s).trans = Trans.stay := by
+ intro s rule
+ rw [hagree]
+ exact hstay rule
+ have htext' : ∀ (rule : Nat), cf.needsText cf.base.start rule = false →
+ ∀ (s : String), ((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) s
+ = ((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) "" := by
+ intro rule hr s
+ rw [hagree, hagree]
+ exact htext rule hr s
+ have hspec := tokenize_complete hval cf.base hdfa hstay' h
+ have hbare : tokenizeFlatStr cf input = .ok (lexingTokens cf.base cf.base.start input.toList steps) := by
+ rw [tokenizeFlatStr_eq_tokenize cf (by rw [hdfa]; exact hflat) (by rw [hdfa]; exact hpos)
+ hstay' htext' input]
+ exact hspec
+ rw [← tokenizeFlatStrPos_val] at hbare
+ cases hp : tokenizeFlatStrPos cf input with
+ | error e => rw [hp] at hbare; cases hbare
+ | ok ts =>
+ rw [hp] at hbare
+ exact ⟨ts, rfl, by simpa [Except.map] using hbare⟩
+
+/-! ### Derivations over byte positions -/
+
+open String in
+/-- Two positions with the same remaining characters are equal. -/
+theorem charsFrom_inj {s : String} {p q : s.Pos} (h : charsFrom p = charsFrom q) : p = q := by
+ have h1 : (s.sliceFrom p).copy = (s.sliceFrom q).copy := String.toList_inj.mp h
+ have h2 := congrArg String.utf8ByteSize h1
+ rw [Slice.utf8ByteSize_copy, Slice.utf8ByteSize_copy, utf8ByteSize_sliceFrom,
+ utf8ByteSize_sliceFrom] at h2
+ have hp : p.offset.byteIdx ≤ s.utf8ByteSize := by simp
+ have hq : q.offset.byteIdx ≤ s.utf8ByteSize := by simp
+ apply String.Pos.ext
+ apply String.Pos.Raw.ext
+ omega
+
+/-- The action of rule `rule` in mode `m` of a compiled lexer. -/
+abbrev modeAct (c : Compiled Tok) (m : Nat) (rule : Nat) : String → Act Tok :=
+ (c.acts.getD m #[]).getD rule (fun _ => {})
+
+/-- The token an action emits for the lexeme `[p, q)`, with the span `⟨p.offset, q.offset⟩`;
+ nothing for a skip. -/
+def emitAt {s : String} (a : Act Tok) (p q : s.Pos) : List (Runtime.Positioned Tok) :=
+ match a.emit with
+ | some t => [⟨t, ⟨p.offset, q.offset⟩⟩]
+ | none => []
+
+/-- The positioned maximal-munch tokenization of `s` from position `p`, for one mode with
+ rules `rules` and actions `act`, ending with the end-of-input token `eof` (if any) at the
+ empty span at the end of `s`. A step from `p` to `q` is the maximal-munch winner
+ `(rule, len)` on the characters at `p`; `q` is the position `len` characters further, its
+ lexeme is `s.extract p q`, and the token it emits, if any, has the span
+ `⟨p.offset, q.offset⟩`. -/
+inductive PosLexing (rules : Array Regex) (act : Nat → String → Act Tok) (eof : Option Tok)
+ (s : String) : s.Pos → List (Runtime.Positioned Tok) → Prop
+ | done : PosLexing rules act eof s s.endPos
+ (eof.toList.map fun t => ⟨t, Runtime.Span.point s.endPos.offset⟩)
+ | step {p q : s.Pos} {rule len : Nat} {rest : List (Runtime.Positioned Tok)} :
+ MatchStep rules (charsFrom p) rule len → len ≤ (charsFrom p).length →
+ p ≤ q → charsFrom q = (charsFrom p).drop len →
+ PosLexing rules act eof s q rest →
+ PosLexing rules act eof s p (emitAt (act rule (s.extract p q)) p q ++ rest)
+
+/-- **Uniqueness.** The positioned tokenization of `s` from `p` is determined by `s` and `p`. -/
+theorem PosLexing.unique {rules : Array Regex} {act : Nat → String → Act Tok} {eof : Option Tok}
+ {s : String} {p : s.Pos} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : PosLexing rules act eof s p ts₁) (h₂ : PosLexing rules act eof s p ts₂) : ts₁ = ts₂ := by
+ induction h₁ generalizing ts₂ with
+ | done =>
+ cases h₂ with
+ | done => rfl
+ | step hms hle _ _ _ =>
+ rw [charsFrom_endPos] at hle
+ exact absurd (Nat.lt_of_lt_of_le hms.lenPos hle) (by simp)
+ | @step p q rule len rest hms₁ hle₁ _ hq₁ _ ih =>
+ cases h₂ with
+ | done =>
+ rw [charsFrom_endPos] at hle₁
+ exact absurd (Nat.lt_of_lt_of_le hms₁.lenPos hle₁) (by simp)
+ | @step _ q₂ rule₂ len₂ rest₂ hms₂ hle₂ _ hq₂ t₂ =>
+ obtain ⟨hr, hl⟩ := matchStep_unique hms₁ hms₂ hle₁ hle₂
+ subst hr hl
+ have hq : q = q₂ := charsFrom_inj (hq₁.trans hq₂.symm)
+ subst hq
+ rw [ih t₂]
+
+/-- **Spans are ordered.** In a positioned tokenization from `p`, every token's span starts
+ at or after `p` and does not end before it starts, and each token ends at or before the
+ next one starts. -/
+theorem PosLexing.spans_ordered {rules : Array Regex} {act : Nat → String → Act Tok}
+ {eof : Option Tok} {s : String} {p : s.Pos} {ts : List (Runtime.Positioned Tok)}
+ (h : PosLexing rules act eof s p ts) :
+ (∀ t ∈ ts, p.offset ≤ t.span.startPos ∧ t.span.startPos ≤ t.span.endPos ∧
+ t.span.endPos ≤ s.endPos.offset) ∧
+ ts.Pairwise (fun a b => a.span.endPos ≤ b.span.startPos) := by
+ induction h with
+ | done =>
+ cases eof with
+ | none => simp
+ | some t =>
+ refine ⟨?_, by simp⟩
+ intro x hx
+ simp only [Option.toList_some, List.map_cons, List.map_nil, List.mem_singleton] at hx
+ subst hx
+ exact ⟨String.Pos.Raw.le_refl, String.Pos.Raw.le_refl, String.Pos.Raw.le_refl⟩
+ | @step p q rule len rest _ _ hpq _ _ ih =>
+ obtain ⟨hall, hpair⟩ := ih
+ have hpq' : p.offset ≤ q.offset := hpq
+ have hqe : q.offset ≤ s.endPos.offset := String.Pos.le_endPos q
+ unfold emitAt
+ cases (act rule (s.extract p q)).emit with
+ | none =>
+ refine ⟨fun t ht => ?_, hpair⟩
+ obtain ⟨h1, h2, h3⟩ := hall t ht
+ exact ⟨String.Pos.Raw.le_trans hpq' h1, h2, h3⟩
+ | some tok =>
+ refine ⟨?_, ?_⟩
+ · intro t ht
+ rcases List.mem_cons.mp ht with ht | ht
+ · subst ht; exact ⟨String.Pos.Raw.le_refl, hpq', hqe⟩
+ · obtain ⟨h1, h2, h3⟩ := hall t ht
+ exact ⟨String.Pos.Raw.le_trans hpq' h1, h2, h3⟩
+ · exact List.Pairwise.cons (fun t ht => (hall t ht).1) hpair
+
+/-- The span `sp` delimits a substring of `s`: its ends are positions `a ≤ b` of `s`. The
+ substring is `s.extract a b`. -/
+def SpanIn (s : String) (sp : Runtime.Span) : Prop :=
+ ∃ a b : s.Pos, a.offset = sp.startPos ∧ b.offset = sp.endPos ∧ a ≤ b
+
+/-- The token `t` and its lexeme in `s`: the span of `t` is `[a, b)` for positions `a ≤ b` of
+ `s`, and either the action of some rule on the lexeme `s.extract a b` emits `t`, or `t` is
+ the end-of-input token `eof` at the empty span at the end of `s`. -/
+def TokenLexeme (act : Nat → String → Act Tok) (eof : Option Tok) (s : String)
+ (t : Runtime.Positioned Tok) : Prop :=
+ ∃ a b : s.Pos, a.offset = t.span.startPos ∧ b.offset = t.span.endPos ∧ a ≤ b ∧
+ ((∃ rule, (act rule (s.extract a b)).emit = some t.val) ∨
+ (a = s.endPos ∧ b = s.endPos ∧ eof = some t.val))
+
+theorem TokenLexeme.spanIn {act : Nat → String → Act Tok} {eof : Option Tok} {s : String}
+ {t : Runtime.Positioned Tok} (h : TokenLexeme act eof s t) : SpanIn s t.span :=
+ let ⟨a, b, ha, hb, hab, _⟩ := h
+ ⟨a, b, ha, hb, hab⟩
+
+/-- **Every token is its lexeme.** Each token of a positioned tokenization has the span of
+ its lexeme, which its rule's action emits it from (or it is the end-of-input token). -/
+theorem PosLexing.tokenLexeme {rules : Array Regex} {act : Nat → String → Act Tok}
+ {eof : Option Tok} {s : String} {p : s.Pos} {ts : List (Runtime.Positioned Tok)}
+ (h : PosLexing rules act eof s p ts) : ∀ t ∈ ts, TokenLexeme act eof s t := by
+ induction h with
+ | done =>
+ intro t ht
+ cases eof with
+ | none => cases ht
+ | some e =>
+ simp only [Option.toList_some, List.map_cons, List.map_nil, List.mem_singleton] at ht
+ subst ht
+ exact ⟨s.endPos, s.endPos, rfl, rfl, String.Pos.le_refl _, .inr ⟨rfl, rfl, rfl⟩⟩
+ | @step p q rule len rest _ _ hpq _ _ ih =>
+ intro t ht
+ rcases List.mem_append.mp ht with ht | ht
+ · unfold emitAt at ht
+ cases he : (act rule (s.extract p q)).emit with
+ | none => rw [he] at ht; cases ht
+ | some tok =>
+ rw [he, List.mem_singleton] at ht
+ subst ht
+ exact ⟨p, q, rfl, rfl, hpq, .inl ⟨rule, he⟩⟩
+ · exact ih t ht
+
+/-- **The end-of-input token is last, and only there.** In a positioned tokenization ending
+ with `eof`, every other token satisfies `P` when every token an action emits does. -/
+theorem PosLexing.eof_last {rules : Array Regex} {act : Nat → String → Act Tok} {eof : Tok}
+ {s : String} {p : s.Pos} {ts : List (Runtime.Positioned Tok)} (P : Tok → Prop)
+ (hact : ∀ rule lexeme t, (act rule lexeme).emit = some t → P t)
+ (h : PosLexing rules act (some eof) s p ts) :
+ ∃ ts0, ts = ts0 ++ [⟨eof, Runtime.Span.point s.endPos.offset⟩] ∧ ∀ t ∈ ts0, P t.val := by
+ induction h with
+ | done => exact ⟨[], rfl, fun _ ht => by cases ht⟩
+ | @step p q rule len rest _ _ _ _ _ ih =>
+ obtain ⟨ts0, hts, hP⟩ := ih
+ refine ⟨emitAt (act rule (s.extract p q)) p q ++ ts0, by rw [hts, List.append_assoc], ?_⟩
+ intro t ht
+ rcases List.mem_append.mp ht with ht | ht
+ · unfold emitAt at ht
+ cases he : (act rule (s.extract p q)).emit with
+ | none => rw [he] at ht; cases ht
+ | some tok =>
+ rw [he, List.mem_singleton] at ht
+ subst ht
+ exact hact rule _ tok he
+ · exact hP t ht
+
+/-- A property of every token a fast action table emits holds of every token the closure
+ actions it agrees with emit. -/
+theorem modeAct_emit_of_agrees [Inhabited Tok] (c : Compiled Tok) (fa : FastActs Tok)
+ (hagree : fa.Agrees c.acts) (P : Tok → Prop)
+ (hP : ∀ m r, (fa.get m r).emit = true → ∀ s, P ((fa.get m r).tok s)) (m : Nat) :
+ ∀ rule lexeme t, (modeAct c m rule lexeme).emit = some t → P t := by
+ intro rule lexeme t he
+ have hd : modeAct c m rule lexeme = (fa.get m rule).toAct lexeme := hagree m rule lexeme
+ rw [hd] at he
+ simp only [FastAct.toAct] at he
+ cases hf : (fa.get m rule).emit with
+ | false => rw [hf] at he; cases he
+ | true =>
+ rw [hf] at he
+ simp only [Bool.cond_true, Option.some.injEq] at he
+ rw [← he]
+ exact hP m rule hf lexeme
+
+/-- The lexeme the flat loop passes to an action is the extract, up to the text
+ independence of the action. -/
+private theorem matched_eq [Inhabited Tok] (cf : CompiledFlat Tok) (m : Nat)
+ (htext : ∀ (rule : Nat), cf.needsText m rule = false →
+ ∀ (s : String), modeAct cf.base m rule s = modeAct cf.base m rule "")
+ (s : String) (rule : Nat) (p q : s.Pos) :
+ ((cf.base.acts.getD m #[]).getD rule (fun _ => {}))
+ (bif cf.needsText m rule then s.extract p q else "") =
+ ((cf.base.acts.getD m #[]).getD rule (fun _ => {})) (s.extract p q) := by
+ cases hn : cf.needsText m rule with
+ | true => rfl
+ | false =>
+ simp only [Bool.cond_false]
+ exact (htext rule hn (s.extract p q)).symm
+
+/-- One scan step of the flat loop, read off the derivative scanner. -/
+private theorem scan_facts (dfa : DFA) (s : String) (p : s.Pos) (rule len : Nat) (q : s.Pos)
+ (hsc : DFA.scanStr dfa p = some (rule, len, q)) :
+ DFA.scan dfa (charsFrom p) = some (rule, len) ∧
+ charsFrom q = (charsFrom p).drop len ∧ p ≤ q := by
+ refine ⟨?_, ?_, ?_⟩
+ · rw [← scanStr_eq_scan_at, hsc]; rfl
+ · apply scanStrGo_pos dfa (charsFrom p) (s.utf8ByteSize + 1) 0 p 0 none
+ (by have := charsFrom_length_le_byteSize p; omega) rfl (by intro rb lb pb hb; simp at hb)
+ rule len q
+ rw [DFA.scanStr] at hsc; exact hsc
+ · apply scanStrGo_pos_le dfa p (s.utf8ByteSize + 1) 0 p 0 none
+ (String.Pos.le_refl _) (by intro rb lb pb hb; simp at hb) rule len q
+ rw [DFA.scanStr] at hsc; exact hsc
+
+section FlatPos
+
+variable [Inhabited Tok] (cf : CompiledFlat Tok) (m : Nat) {rules : Array Regex} {cert : LexCert}
+ (hval : validate rules (cf.base.dfas.getD m default) cert = true)
+ (hflat : flatValidate (cf.flats.getD m default) (cf.base.dfas.getD m default) = true)
+ (hstartm : 0 < (cf.base.dfas.getD m default).states.size)
+ (hstay : ∀ (s : String) (rule : Nat),
+ (((cf.base.acts.getD m #[]).getD rule (fun _ => {})) s).trans = Trans.stay)
+ (htext : ∀ (rule : Nat), cf.needsText m rule = false →
+ ∀ (s : String), modeAct cf.base m rule s = modeAct cf.base m rule "")
+include hval hflat hstartm hstay htext
+
+/-- **Soundness of the flat positioned loop.** A successful run from `p` in mode `m` is the
+ positioned tokenization from `p`, after the accumulator. -/
+theorem posLexing_of_tokenizeFlatStrPosAux (s : String) :
+ ∀ (fuel : Nat) (p : s.Pos) (cpos : Nat) (acc ts : List (Runtime.Positioned Tok)),
+ tokenizeFlatStrPosAux cf s fuel p cpos [m] acc = .ok ts →
+ ∃ rest, PosLexing rules (modeAct cf.base m) cf.base.eofToken s p rest ∧
+ ts = acc.reverse ++ rest := by
+ obtain ⟨hstep, hacc, hrange⟩ := agreements_of_flatValidate _ _ hflat
+ intro fuel
+ induction fuel with
+ | zero => intro p cpos acc ts h; simp [tokenizeFlatStrPosAux] at h
+ | succ fuel ih =>
+ intro p cpos acc ts h
+ unfold tokenizeFlatStrPosAux at h
+ by_cases hend : p = s.endPos
+ · subst hend
+ simp only [dite_true] at h
+ refine ⟨_, .done, ?_⟩
+ cases he : cf.base.eofToken with
+ | none => rw [he] at h; simp at h; simp [h]
+ | some tok => rw [he] at h; simp at h; simp [← h]
+ · simp only [hend, dite_false] at h
+ rw [DFA.ScanRes.elim_eq] at h
+ have hR : (DFA.flatScanStrR (cf.flats.getD m default) p).toOption
+ = DFA.flatScanStr (cf.flats.getD m default) p := rfl
+ simp only [List.headD_cons] at h
+ rw [hR, flatScanStr_eq_scanStr (cf.flats.getD m default) (cf.base.dfas.getD m default)
+ hstep hacc hrange hstartm p] at h
+ cases hsc : DFA.scanStr (cf.base.dfas.getD m default) p with
+ | none => rw [hsc] at h; simp at h
+ | some res =>
+ obtain ⟨rule, len, q⟩ := res
+ rw [hsc] at h
+ by_cases hlen : len = 0
+ · simp [hlen] at h
+ · simp only [hlen, ite_false] at h
+ rw [matched_eq cf m htext s rule p q] at h
+ simp only [hstay (s.extract p q) rule] at h
+ obtain ⟨hscan, hdrop, hpq⟩ := scan_facts _ s p rule len q hsc
+ have hms : MatchStep rules (charsFrom p) rule len :=
+ scan_matchStep hval hscan (Nat.pos_of_ne_zero hlen)
+ have hle : len ≤ (charsFrom p).length := scan_len_le _ _ rule len hscan
+ obtain ⟨rest, hl, hts⟩ := ih q _ _ ts h
+ refine ⟨_, .step hms hle hpq hdrop hl, ?_⟩
+ rw [hts]
+ unfold emitAt
+ cases (modeAct cf.base m rule (s.extract p q)).emit with
+ | none => simp
+ | some tok => simp
+
+/-- **Completeness of the flat positioned loop.** From `p`, with enough fuel, the loop
+ returns the positioned tokenization from `p` after the accumulator. -/
+theorem tokenizeFlatStrPosAux_of_posLexing (s : String) {p : s.Pos}
+ {rest : List (Runtime.Positioned Tok)}
+ (hl : PosLexing rules (modeAct cf.base m) cf.base.eofToken s p rest) :
+ ∀ (fuel cpos : Nat) (acc : List (Runtime.Positioned Tok)), (charsFrom p).length < fuel →
+ tokenizeFlatStrPosAux cf s fuel p cpos [m] acc = .ok (acc.reverse ++ rest) := by
+ obtain ⟨hstep, hacc, hrange⟩ := agreements_of_flatValidate _ _ hflat
+ induction hl with
+ | done =>
+ intro fuel cpos acc hf
+ obtain ⟨f, rfl⟩ : ∃ f, fuel = f + 1 := ⟨fuel - 1, by omega⟩
+ unfold tokenizeFlatStrPosAux
+ simp only [dite_true]
+ cases cf.base.eofToken with
+ | none => simp
+ | some tok => simp
+ | @step p q rule len rest hms hle hpq hdrop _ ih =>
+ intro fuel cpos acc hf
+ obtain ⟨f, rfl⟩ : ∃ f, fuel = f + 1 := ⟨fuel - 1, by omega⟩
+ have hne : p ≠ s.endPos := by
+ intro he
+ subst he
+ rw [charsFrom_endPos] at hle
+ exact absurd (Nat.lt_of_lt_of_le hms.lenPos hle) (by simp)
+ have hscan : DFA.scan (cf.base.dfas.getD m default) (charsFrom p) = some (rule, len) :=
+ scan_of_matchStep hval hms hle
+ have hproj := scanStr_eq_scan_at (cf.base.dfas.getD m default) p
+ rw [hscan] at hproj
+ obtain ⟨q', hsc⟩ : ∃ q', DFA.scanStr (cf.base.dfas.getD m default) p = some (rule, len, q') := by
+ cases h : DFA.scanStr (cf.base.dfas.getD m default) p with
+ | none => rw [h] at hproj; cases hproj
+ | some res =>
+ obtain ⟨r, l, q'⟩ := res
+ rw [h] at hproj
+ simp only [projRL, Option.map_some, Option.some.injEq, Prod.mk.injEq] at hproj
+ obtain ⟨rfl, rfl⟩ := hproj
+ exact ⟨q', rfl⟩
+ obtain ⟨_, hdrop', _⟩ := scan_facts _ s p rule len q' hsc
+ have hq : q' = q := charsFrom_inj (hdrop'.trans hdrop.symm)
+ subst hq
+ unfold tokenizeFlatStrPosAux
+ simp only [hne, dite_false, List.headD_cons]
+ rw [DFA.ScanRes.elim_eq]
+ have hR : (DFA.flatScanStrR (cf.flats.getD m default) p).toOption
+ = DFA.flatScanStr (cf.flats.getD m default) p := rfl
+ rw [hR, flatScanStr_eq_scanStr (cf.flats.getD m default) (cf.base.dfas.getD m default)
+ hstep hacc hrange hstartm p, hsc]
+ have hlen0 : len ≠ 0 := Nat.pos_iff_ne_zero.mp hms.lenPos
+ simp only [hlen0, ite_false]
+ rw [matched_eq cf m htext s rule p q']
+ simp only [hstay (s.extract p q') rule]
+ have hf' : (charsFrom q').length < f := by
+ rw [hdrop, List.length_drop]
+ have := hms.lenPos
+ have hcf : (charsFrom p).length < f + 1 := hf
+ omega
+ rw [ih f _ _ hf']
+ unfold emitAt
+ cases (modeAct cf.base m rule (s.extract p q')).emit with
+ | none => simp
+ | some tok => simp
+
+end FlatPos
+
+/-- **The positioned flat tokenizer computes the positioned tokenization** (single start
+ mode, validated, actions that keep the stack put): `tokenizeFlatStrPos cf s = .ok ts` if
+ and only if `ts` is the `PosLexing` of `s` from its start. -/
+theorem tokenizeFlatStrPos_iff_posLexing [Inhabited Tok] (cf : CompiledFlat Tok)
+ {rules : Array Regex} {cert : LexCert}
+ (hval : validate rules (cf.base.dfas.getD cf.base.start default) cert = true)
+ (hflat : flatValidate (cf.flats.getD cf.base.start default)
+ (cf.base.dfas.getD cf.base.start default) = true)
+ (hstartm : 0 < (cf.base.dfas.getD cf.base.start default).states.size)
+ (hstay : ∀ (s : String) (rule : Nat),
+ (((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) s).trans = Trans.stay)
+ (htext : ∀ (rule : Nat), cf.needsText cf.base.start rule = false →
+ ∀ (s : String), modeAct cf.base cf.base.start rule s = modeAct cf.base cf.base.start rule "")
+ (s : String) (ts : List (Runtime.Positioned Tok)) :
+ tokenizeFlatStrPos cf s = .ok ts ↔
+ PosLexing rules (modeAct cf.base cf.base.start) cf.base.eofToken s s.startPos ts := by
+ constructor
+ · intro h
+ obtain ⟨rest, hl, hts⟩ := posLexing_of_tokenizeFlatStrPosAux cf cf.base.start hval hflat hstartm
+ hstay htext s _ _ _ _ ts h
+ simp only [List.reverse_nil, List.nil_append] at hts
+ rw [hts]; exact hl
+ · intro hl
+ have := tokenizeFlatStrPosAux_of_posLexing cf cf.base.start hval hflat hstartm hstay htext s hl
+ (s.utf8ByteSize + 1) 0 [] (by have := charsFrom_length_le_byteSize s.startPos; omega)
+ simpa [tokenizeFlatStrPos] using this
+
+/-- `tokenizeFlatStrPos_iff_posLexing` with the hypotheses of `tokenizeFlatStrPos_sound`
+ (fast actions that agree with the spec actions). -/
+theorem tokenizeFlatStrPos_iff_posLexing' [Inhabited Tok] (cf : CompiledFlat Tok)
+ (fa : FastActs Tok) (hagree : fa.Agrees cf.base.acts) {rules : Array Regex} {dfa : DFA}
+ {cert : LexCert}
+ (hval : validate rules dfa cert = true) (hdfa : cf.base.dfas.getD cf.base.start default = dfa)
+ (hflat : flatValidate (cf.flats.getD cf.base.start default) dfa = true)
+ (hpos : 0 < dfa.states.size)
+ (hstay : ∀ r, (fa.get cf.base.start r).trans = .stay)
+ (htext : ∀ r, cf.needsText cf.base.start r = false →
+ ∀ s, (fa.get cf.base.start r).toAct s = (fa.get cf.base.start r).toAct "")
+ (s : String) (ts : List (Runtime.Positioned Tok)) :
+ tokenizeFlatStrPos cf s = .ok ts ↔
+ PosLexing rules (modeAct cf.base cf.base.start) cf.base.eofToken s s.startPos ts := by
+ subst hdfa
+ refine tokenizeFlatStrPos_iff_posLexing cf hval hflat hpos (fun s rule => ?_)
+ (fun rule hr s => ?_) s ts
+ · rw [hagree]; exact hstay rule
+ · show ((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) s =
+ ((cf.base.acts.getD cf.base.start #[]).getD rule (fun _ => {})) ""
+ rw [hagree, hagree]; exact htext rule hr s
+
+/-- The positioned byte lexer computes the same tokenization as `tokenize`, when they
+ agree (`PosLexerAgrees`): `lexPos cb s = .ok ts ↔ tokenize s = .ok ts`. -/
+theorem lexPos_ok_iff {cb : CompiledByte Tok}
+ {tokenize : String → Except LexError (List (Runtime.Positioned Tok))}
+ (h : PosLexerAgrees cb tokenize) (s : String) (ts : List (Runtime.Positioned Tok)) :
+ lexPos cb s = .ok ts ↔ tokenize s = .ok ts := by
+ have hs := h s
+ constructor
+ · intro hl
+ rw [hl] at hs
+ revert hs
+ cases tokenize s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+ · intro ht
+ rw [ht] at hs
+ revert hs
+ cases lexPos cb s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+
+end Lexer
diff --git a/LeanParserGenerator/Lexer/SpanText.lean b/LeanParserGenerator/Lexer/SpanText.lean
new file mode 100644
index 0000000..78819f1
--- /dev/null
+++ b/LeanParserGenerator/Lexer/SpanText.lean
@@ -0,0 +1,203 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+The spans of a parse tree over a positioned tokenization, as text of the input
+(docs/DESIGN.md §6.2).
+
+`SpanGrammar.allSpanFacts` relates each node's span to the tokens of its word, and
+`PosLexing` relates each token to its lexeme in the input `s`. This file combines the two.
+`AllNodeText act eof s pe t`: every leaf of `t` is a token with its lexeme in `s`
+(`TokenLexeme`), and every inner node's span delimits a substring of `s` (`SpanIn`) and
+satisfies `SpanFacts`. So the substring ends at the end of the lexeme of the node's last
+token, and starts at the start of the lexeme of its first token or, under the Rust
+convention, at the end `pe` of the token before the node (an empty word, or leftmost
+children that derive the empty word).
+
+`PosLexing.allNodeText`: every tree over a `PosLexing` of `s` from `p` has
+`AllNodeText … p.offset`.
+-/
+public import LeanParserGenerator.Lexer.Lexing
+public import LeanParserGenerator.Runtime.SpanGrammar
+
+
+@[expose] public section
+
+namespace Lexer
+
+open Runtime
+
+/-! ### Ordered tokens -/
+
+section Chain
+
+variable {α : Type}
+
+/-- The tokens of `w` start at or after `pe`, each starts before it ends, and each ends at or
+ before the next one starts. -/
+def Chain (pe : String.Pos.Raw) (w : List (Positioned α)) : Prop :=
+ (∀ x ∈ w, pe ≤ x.span.startPos ∧ x.span.startPos ≤ x.span.endPos) ∧
+ w.Pairwise (fun a b => a.span.endPos ≤ b.span.startPos)
+
+/-- The end of a word is `pe` or the end of one of its tokens. -/
+theorem wordEnd_cases (pe : String.Pos.Raw) :
+ ∀ w : List (Positioned α), Positioned.wordEnd pe w = pe ∨
+ ∃ y ∈ w, Positioned.wordEnd pe w = y.span.endPos
+ | [] => .inl rfl
+ | x :: w => by
+ have hc : Positioned.wordEnd pe (x :: w) = Positioned.wordEnd x.span.endPos w := rfl
+ rw [hc]
+ rcases wordEnd_cases x.span.endPos w with h | ⟨y, hy, h⟩
+ · exact .inr ⟨x, List.mem_cons_self, h⟩
+ · exact .inr ⟨y, List.mem_cons_of_mem _ hy, h⟩
+
+theorem Chain.wordEnd_ge {pe : String.Pos.Raw} :
+ ∀ {w : List (Positioned α)}, Chain pe w →
+ pe ≤ Positioned.wordEnd pe w ∧ ∀ x ∈ w, x.span.startPos ≤ Positioned.wordEnd pe w
+ | [], _ => ⟨String.Pos.Raw.le_refl, fun _ h => by cases h⟩
+ | x :: w, ⟨hx, hp⟩ => by
+ have hc : Positioned.wordEnd pe (x :: w) = Positioned.wordEnd x.span.endPos w := rfl
+ rw [hc]
+ have hx0 := hx x List.mem_cons_self
+ rw [List.pairwise_cons] at hp
+ have ih := Chain.wordEnd_ge (pe := x.span.endPos) (w := w)
+ ⟨fun y hy => ⟨hp.1 y hy, (hx y (List.mem_cons_of_mem _ hy)).2⟩, hp.2⟩
+ have hxe : x.span.startPos ≤ Positioned.wordEnd x.span.endPos w :=
+ String.Pos.Raw.le_trans hx0.2 ih.1
+ refine ⟨String.Pos.Raw.le_trans hx0.1 hxe, fun y hy => ?_⟩
+ rcases List.mem_cons.mp hy with rfl | hy
+ · exact hxe
+ · exact ih.2 y hy
+
+theorem Chain.append {pe : String.Pos.Raw} {a b : List (Positioned α)} (h : Chain pe (a ++ b)) :
+ Chain pe a ∧ Chain (Positioned.wordEnd pe a) b := by
+ obtain ⟨hx, hp⟩ := h
+ rw [List.pairwise_append] at hp
+ refine ⟨⟨fun x h => hx x (List.mem_append_left _ h), hp.1⟩, ⟨fun x h => ?_, hp.2.1⟩⟩
+ refine ⟨?_, (hx x (List.mem_append_right _ h)).2⟩
+ rcases wordEnd_cases pe a with he | ⟨y, hy, he⟩
+ · rw [he]; exact (hx x (List.mem_append_right _ h)).1
+ · rw [he]; exact hp.2.2 y hy x h
+
+end Chain
+
+/-! ### Node spans as text -/
+
+/-- `x` is the offset of a position of `s`. -/
+abbrev PosIn (s : String) (x : String.Pos.Raw) : Prop := ∃ a : s.Pos, a.offset = x
+
+theorem posIn_wordEnd {α : Type} {s : String} {pe : String.Pos.Raw} (hpe : PosIn s pe)
+ {w : List (Positioned α)} (hw : ∀ x ∈ w, PosIn s x.span.endPos) :
+ PosIn s (Positioned.wordEnd pe w) := by
+ rcases wordEnd_cases pe w with he | ⟨y, hy, he⟩
+ · rw [he]; exact hpe
+ · rw [he]; exact hw y hy
+
+variable [SG : SpanGrammar]
+
+attribute [local instance] SpanGrammar.toGrammar
+
+open SpanGrammar (ParseTree ParseTreeList ptSpan ptlSpans wordEnd SpanFacts)
+
+/-- The text facts of one node with span `sp` and word `word`, after the token that ends at
+ `pe`: `sp` delimits a substring of `s` (`SpanIn`), and `SpanFacts`: the substring ends at
+ the end of the last token of `word` (at `pe` when `word` is empty), and starts at `pe` or
+ at the start of the first token of `word`. -/
+def NodeText (s : String) (pe : String.Pos.Raw) (word : List (Positioned SG.Tok)) (sp : Span) :
+ Prop :=
+ SpanIn s sp ∧ SpanFacts pe word sp
+
+mutual
+/-- Every leaf of a tree is a token with its lexeme in `s` (`TokenLexeme`), and every inner
+ node satisfies `NodeText`, each at the end of the word before it. -/
+def AllNodeText (act : Nat → String → Act SG.Tok) (eof : Option SG.Tok) (s : String)
+ (pe : String.Pos.Raw) : {head : SpanGrammar.Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTree head word → Prop
+ | _, _, .terminal tok => TokenLexeme act eof s tok
+ | _, _, .nonTerminal (word := w) _ ptl =>
+ NodeText s pe w (Span.fold pe (ptlSpans pe ptl)) ∧ AllNodeTextL act eof s pe ptl
+
+/-- Every node of a parse-tree list satisfies `AllNodeText`. -/
+def AllNodeTextL (act : Nat → String → Act SG.Tok) (eof : Option SG.Tok) (s : String)
+ (pe : String.Pos.Raw) : {heads : List SpanGrammar.Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTreeList heads word → Prop
+ | _, _, .nil => True
+ | _, _, .cons (wordQ := wq) q t =>
+ AllNodeTextL act eof s pe q ∧ AllNodeText act eof s (wordEnd pe wq) t
+end
+
+/-- `SpanFacts` of a node over ordered tokens of `s` give a substring of `s`. -/
+theorem nodeText_of_spanFacts {act : Nat → String → Act SG.Tok} {eof : Option SG.Tok}
+ {s : String} {pe : String.Pos.Raw} (hpe : PosIn s pe) {w : List (Positioned SG.Tok)}
+ (hw : ∀ x ∈ w, TokenLexeme act eof s x) (hc : Chain pe w) {sp : Span}
+ (hf : SpanFacts pe w sp) : NodeText s pe w sp := by
+ refine ⟨?_, hf⟩
+ obtain ⟨hend, hstart⟩ := hf
+ have hge := Chain.wordEnd_ge hc
+ obtain ⟨b, hb⟩ := posIn_wordEnd hpe (fun x hx => let ⟨_, b, _, hb, _⟩ := hw x hx; ⟨b, hb⟩)
+ rcases hstart with hs | ⟨tok, rest, rfl, hs⟩
+ · obtain ⟨a, ha⟩ := hpe
+ refine ⟨a, b, by rw [ha, hs], by rw [hb, hend], ?_⟩
+ show a.offset ≤ b.offset
+ rw [ha, hb]; exact hge.1
+ · obtain ⟨a, _, ha, _⟩ := hw tok List.mem_cons_self
+ refine ⟨a, b, by rw [ha, hs], by rw [hb, hend], ?_⟩
+ show a.offset ≤ b.offset
+ rw [ha, hb]; exact hge.2 tok List.mem_cons_self
+
+mutual
+/-- **Node spans as text.** In a tree whose word is ordered tokens of `s` with their lexemes,
+ after the position `pe` of `s`, every node satisfies `AllNodeText`. -/
+theorem allNodeText {act : Nat → String → Act SG.Tok} {eof : Option SG.Tok} {s : String} :
+ (pe : String.Pos.Raw) → PosIn s pe → {head : SpanGrammar.Sym} →
+ {word : List (Positioned SG.Tok)} → (t : ParseTree head word) →
+ (∀ x ∈ word, TokenLexeme act eof s x) → Chain pe word → AllNodeText act eof s pe t
+ | _, _, _, _, .terminal tok, hw, _ => by
+ rw [AllNodeText.eq_def]
+ exact hw tok List.mem_cons_self
+ | pe, hpe, _, _, .nonTerminal p ptl, hw, hc => by
+ rw [AllNodeText.eq_def]
+ have hf := (SpanGrammar.allSpanFacts pe (Grammar.ParseTree.nonTerminal (G := SG.toGrammar) p ptl))
+ rw [SpanGrammar.AllSpanFacts.eq_def] at hf
+ exact ⟨nodeText_of_spanFacts hpe hw hc hf.1, allNodeTextL pe hpe ptl hw hc⟩
+
+theorem allNodeTextL {act : Nat → String → Act SG.Tok} {eof : Option SG.Tok} {s : String} :
+ (pe : String.Pos.Raw) → PosIn s pe → {heads : List SpanGrammar.Sym} →
+ {word : List (Positioned SG.Tok)} → (ptl : ParseTreeList heads word) →
+ (∀ x ∈ word, TokenLexeme act eof s x) → Chain pe word → AllNodeTextL act eof s pe ptl
+ | _, _, _, _, .nil, _, _ => by rw [AllNodeTextL.eq_def]; trivial
+ | pe, hpe, _, _, .cons (wordQ := wq) (wordT := wt) q t, hw, hc => by
+ rw [AllNodeTextL.eq_def]
+ have hc' := Chain.append hc
+ exact ⟨allNodeTextL pe hpe q (fun x hx => hw x (List.mem_append_left _ hx)) hc'.1,
+ allNodeText (wordEnd pe wq)
+ (posIn_wordEnd hpe (fun x hx =>
+ let ⟨_, b, _, hb, _⟩ := hw x (List.mem_append_left _ hx); ⟨b, hb⟩))
+ t (fun x hx => hw x (List.mem_append_right _ hx)) hc'.2⟩
+end
+
+/-- **Node spans of a tree over a positioned tokenization.** Every tree whose word is the
+ `PosLexing` of `s` from `p` satisfies `AllNodeText` at `p`. -/
+theorem PosLexing.allNodeText {rules : Array Regex} {act : Nat → String → Act SG.Tok}
+ {eof : Option SG.Tok} {s : String} {p : s.Pos} {ts : List (Positioned SG.Tok)}
+ (h : PosLexing rules act eof s p ts) {head : SpanGrammar.Sym} (t : ParseTree head ts) :
+ AllNodeText act eof s p.offset t := by
+ obtain ⟨hall, hpair⟩ := PosLexing.spans_ordered h
+ exact Lexer.allNodeText p.offset ⟨p, rfl⟩ t (PosLexing.tokenLexeme h)
+ ⟨fun x hx => ⟨(hall x hx).1, (hall x hx).2.1⟩, hpair⟩
+
+end Lexer
diff --git a/LeanParserGenerator/Runtime.lean b/LeanParserGenerator/Runtime.lean
index ff73510..d14b5c2 100644
--- a/LeanParserGenerator/Runtime.lean
+++ b/LeanParserGenerator/Runtime.lean
@@ -27,7 +27,9 @@ public import LeanParserGenerator.Runtime.Validator.Complete
public import LeanParserGenerator.Runtime.Safety
public import LeanParserGenerator.Runtime.Correct
public import LeanParserGenerator.Runtime.Complete
+public import LeanParserGenerator.Runtime.SpanGrammar
public import LeanParserGenerator.Runtime.Refinement
+public import LeanParserGenerator.Runtime.ParseEnd
public import LeanParserGenerator.Runtime.GrammarView
public import LeanParserGenerator.Lexer.Engine
public import LeanParserGenerator.Lexer.DFA
@@ -36,8 +38,13 @@ public import LeanParserGenerator.Lexer.StringScan
public import LeanParserGenerator.Lexer.FlatTokenize
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.ByteValidator
+public import LeanParserGenerator.Lexer.ByteUnicode
public import LeanParserGenerator.Lexer.ByteTokenize
public import LeanParserGenerator.Lexer.FastAct
public import LeanParserGenerator.Lexer.BytePull
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
+public import LeanParserGenerator.Lexer.SpanText
public import LeanParserGenerator.Lexer.StreamRun
public import LeanParserGenerator.Lexer.Roundtrip
diff --git a/LeanParserGenerator/Runtime/Exec.lean b/LeanParserGenerator/Runtime/Exec.lean
index afa6050..0b43e90 100644
--- a/LeanParserGenerator/Runtime/Exec.lean
+++ b/LeanParserGenerator/Runtime/Exec.lean
@@ -35,6 +35,7 @@ is the specification; generated parsers run `Runtime.Exec.runFast`
(`Runtime/ExecFast.lean`), which is proved equal to it.
-/
+public import LeanParserGenerator.Runtime.Span
@[expose] public section
@@ -52,6 +53,9 @@ inductive Act where
| error : Act
deriving Repr, Inhabited, DecidableEq
+/-- The stack: a list of `(stateIndex, semanticValue)` cells, top of stack first. -/
+abbrev Stack (V : Type) := List (Nat × V)
+
/-- All the plain-data tables the executable engine needs, over a synthesized
value type `V`. Produced by the code generator. -/
structure ExecTable (V : Type) where
@@ -74,12 +78,11 @@ structure ExecTable (V : Type) where
/-- `prodRhsLen p` : the number of symbols on the right of production `p` (how
many stack cells a reduce by `p` pops). -/
prodRhsLen : Nat → Nat
- /-- `sem p args` : the semantic action of production `p`, applied to the popped
- values in left-to-right right-hand-side order. -/
- sem : Nat → List V → V
-
-/-- The stack: a list of `(stateIndex, semanticValue)` cells, top of stack first. -/
-abbrev Stack (V : Type) := List (Nat × V)
+ /-- `sem p rest args` : the semantic action of production `p`, applied to the popped
+ values in left-to-right right-hand-side order. `rest` is the stack below them;
+ an empty right-hand side reads the position of its span from it
+ (`Runtime.Exec.spanSem`). -/
+ sem : Nat → Stack V → List V → V
/-- The outcome of a parse. -/
inductive Result (V : Type) where
@@ -127,7 +130,7 @@ def reduce (tbl : ExecTable V) (p : Nat) (stk : Stack V) : Result V ⊕ Stack V
match popN (tbl.prodRhsLen p) stk with
| none => .inl (.err s!"reduce: stack underflow on production {p}")
| some (args, stk') =>
- let v := tbl.sem p args
+ let v := tbl.sem p stk' args
match tbl.goto (topState tbl stk') (tbl.prodLhs p) with
| some s' => .inr ((s', v) :: stk')
| none =>
@@ -209,7 +212,7 @@ structure FlatTable (V : Type) where
defRedData : Array (Option Nat)
lhsData : Array Nat
lenData : Array Nat
- sem : Nat → List V → V
+ sem : Nat → Stack V → List V → V
/-- The `ExecTable` whose closure fields are exactly the ones the emitter writes
over a `FlatTable`'s arrays. This is definitionally the emitted `table`. -/
@@ -235,7 +238,7 @@ def reduceInline (f : FlatTable V) (p : Nat) (stk : Stack V) : Result V ⊕ Stac
match popN (f.lenData.getD p 0) stk with
| none => .inl (.err s!"reduce: stack underflow on production {p}")
| some (args, stk') =>
- let v := f.sem p args
+ let v := f.sem p stk' args
match f.gotoData.getD ((f.topState stk') * f.gotoWidth + f.lhsData.getD p 0) none with
| some s' => .inr ((s', v) :: stk')
| none => .inl (.ok v)
@@ -331,6 +334,28 @@ theorem runInline_eq_run (f : FlatTable V) (input : List (Nat × V)) (logNSteps
operand list. `reduceInline` is this followed by the goto. The generated fused
reduces are proved against it (`Runtime/ExecFast.lean`). -/
def popNsem (f : FlatTable V) (p : Nat) (stk : Stack V) : Option (V × Stack V) :=
- (popN (f.lenData.getD p 0) stk).map (fun r => (f.sem p r.1, r.2))
+ (popN (f.lenData.getD p 0) stk).map (fun r => (f.sem p r.2 r.1, r.2))
+
+/-! ### Spans of reduced cells
+
+The executable value type of a generated parser is `Span × W`. The span of a reduced
+cell is computed here, not by generated code: `Span.fold` of the popped spans, with the
+end of the cell below (`stackEnd`) as the position of an empty right-hand side. The
+end of the top cell is the end of the last shifted token, since a shifted cell ends
+there and a reduced cell ends where its last child ends (or, when empty, where the cell
+below ends). This is the convention of the Rust backend. -/
+
+/-- The end of the span of the top cell, or byte 0 on the empty stack. -/
+def stackEnd {W : Type} : Stack (Span × W) → String.Pos.Raw
+ | [] => ⟨0⟩
+ | (_, (sp, _)) :: _ => sp.endPos
+
+/-- The executable semantic action of a generated parser: the node span is
+ `Span.fold (stackEnd rest)` of the argument spans, and the value is `semV p spans
+ values`, where `semV` is the generated per-production action. -/
+@[inline] def spanSem {W : Type} (semV : Nat → List Span → List W → W) (p : Nat)
+ (rest : Stack (Span × W)) (args : List (Span × W)) : Span × W :=
+ let spans := args.map Prod.fst
+ (Span.fold (stackEnd rest) spans, semV p spans (args.map Prod.snd))
end Runtime.Exec
diff --git a/LeanParserGenerator/Runtime/ExecFast.lean b/LeanParserGenerator/Runtime/ExecFast.lean
index 0284f6f..ed6682c 100644
--- a/LeanParserGenerator/Runtime/ExecFast.lean
+++ b/LeanParserGenerator/Runtime/ExecFast.lean
@@ -77,6 +77,9 @@ class StackOps (W T S : Type) where
pushEof : Nat → S → S
/-- The value on top, for `accept`. -/
accept : S → Result (Span × W)
+ /-- The end of the span of the top cell (byte 0 when empty), the position of the span
+ of an empty right-hand side reduced on this stack (`Runtime.Exec.stackEnd`). -/
+ endPos : S → String.Pos.Raw
/-- The specification stack this stack represents. -/
toList : S → Stack (Span × W)
/-- The inverse of `toList`, used by the slow reduce path. -/
@@ -100,6 +103,7 @@ structure StackOps.Lawful (ops : StackOps W T S) (val : T → W) (eofv : Span ×
| (_, v) :: _ => .ok v
| [] => .err "accept on empty stack"
toList_ofList : ∀ l, ops.toList (ops.ofList l) = l
+ endPos_eq : ∀ s, ops.endPos s = stackEnd (ops.toList s)
theorem StackOps.Lawful.top_eq_flat {ops : StackOps W T S} {val : T → W} {eofv : Span × W}
(hl : ops.Lawful val eofv) (f : FlatTable (Span × W)) (s : S) :
@@ -212,9 +216,32 @@ theorem fuseOKAt_of_pop {ops : StackOps W T S} {val : T → W} {eofv : Span × W
rw [hp] at hred
simp only [Option.map_some, Option.some.injEq, Prod.mk.injEq] at hred
obtain ⟨hsem, hrest⟩ := hred
- simp only [hsem, hrest, ← hl.top_eq_flat, hg]
+ subst hrest
+ simp only [hsem, ← hl.top_eq_flat, hg]
rw [hmk]
+/-- The shape of the per-production proof for an empty right-hand side: the fused
+reduce pushes the empty span at `ops.endPos stk`. `hred` and `hmk` hold by `rfl` for a
+generated `fuse `. -/
+theorem fuseOKAt_of_eps {ops : StackOps W T S} {val : T → W} {eofv : Span × W}
+ (hl : ops.Lawful val eofv) (f : FlatTable (Span × W)) (p : Nat) (stk : S)
+ (v : W) (mk : Nat → S)
+ (hred : popNsem f p (ops.toList stk) =
+ some ((⟨stackEnd (ops.toList stk), stackEnd (ops.toList stk)⟩, v), ops.toList stk))
+ (hmk : ∀ s', ops.toList (mk s') = (s', (⟨ops.endPos stk, ops.endPos stk⟩, v)) :: ops.toList stk)
+ (hmkf : ∀ s', ops.isFail (mk s') = false) :
+ (ops.isFail (pushGotoWith f.gotoData f.gotoWidth (f.lhsData.getD p 0)
+ (ops.top f.startState stk) mk (fun _ => ops.fail stk)) = true →
+ ops.unfail (pushGotoWith f.gotoData f.gotoWidth (f.lhsData.getD p 0)
+ (ops.top f.startState stk) mk (fun _ => ops.fail stk)) = stk) ∧
+ (ops.isFail (pushGotoWith f.gotoData f.gotoWidth (f.lhsData.getD p 0)
+ (ops.top f.startState stk) mk (fun _ => ops.fail stk)) = false →
+ reduceInline f p (ops.toList stk) =
+ .inr (ops.toList (pushGotoWith f.gotoData f.gotoWidth (f.lhsData.getD p 0)
+ (ops.top f.startState stk) mk (fun _ => ops.fail stk)))) := by
+ rw [hl.endPos_eq] at hmk
+ exact fuseOKAt_of_pop hl f p stk stk _ _ v mk hred hmk hmkf
+
/-- Reduce by `p`: try the generated `fuse`, and fall back to `reduceInline` on the
original stack when it declines, passing the new stack to `k`. -/
@[inline] def reduceFast [ops : StackOps W T S] (f : FlatTable (Span × W))
diff --git a/LeanParserGenerator/Runtime/ExecStream.lean b/LeanParserGenerator/Runtime/ExecStream.lean
index 7477db1..e93aeb8 100644
--- a/LeanParserGenerator/Runtime/ExecStream.lean
+++ b/LeanParserGenerator/Runtime/ExecStream.lean
@@ -114,196 +114,6 @@ theorem indexSource_denotes (n : Nat) (tokOf : Nat → T) (spanOf : Nat → Span
end Sources
-/-- The parse does not depend on the token spans: it gives the same result on the tokens with
- every span replaced by `Span.dummy`. `SpanIndependent.of_run` proves it for a span-free `sem`. -/
-def SpanIndependent {T α : Type} (parse : List (Positioned T) → Nat → Option α) : Prop :=
- ∀ ts k, parse ts k = parse (ts.map fun t => ⟨t.val, Span.dummy⟩) k
-
-/-! ### Span erasure
-
-`run_erase`: two runs whose inputs agree except for spans agree except for spans, when `sem`
-builds its value component from the value components of its arguments (`SemSpanFree`). -/
-
-section SpanErase
-
-variable {W : Type}
-
-/-- A stack or input cell without its span. -/
-def eraseCell (c : Nat × (Span × W)) : Nat × W := (c.1, c.2.2)
-
-/-- The result without the span of the accepted value. -/
-def Result.eraseSpan : Result (Span × W) → Result W
- | .ok v => .ok v.2
- | .reject s t => .reject s t
- | .timeout => .timeout
- | .err m => .err m
-
-/-- `sem` builds the value component of its result from the value components of its arguments. -/
-def SemSpanFree (sem : Nat → List (Span × W) → Span × W) : Prop :=
- ∀ p args, (sem p args).2 = (sem p (args.map fun c => (Span.dummy, c.2))).2
-
-theorem SemSpanFree.congr {sem : Nat → List (Span × W) → Span × W} (h : SemSpanFree sem)
- (p : Nat) {a b : List (Span × W)} (hab : a.map Prod.snd = b.map Prod.snd) :
- (sem p a).2 = (sem p b).2 := by
- rw [h p a, h p b]
- have e : ∀ l : List (Span × W),
- l.map (fun c => (Span.dummy, c.2)) = (l.map Prod.snd).map (fun v => (Span.dummy, v)) := by
- intro l; simp [List.map_map, Function.comp_def]
- rw [e a, e b, hab]
-
-theorem popN_go_erase (n : Nat) : ∀ (s1 s2 : Stack (Span × W)) (a1 a2 : List (Span × W)),
- s1.map eraseCell = s2.map eraseCell → a1.map Prod.snd = a2.map Prod.snd →
- (popN.go n s1 a1).map (fun r => (r.1.map Prod.snd, r.2.map eraseCell)) =
- (popN.go n s2 a2).map (fun r => (r.1.map Prod.snd, r.2.map eraseCell)) := by
- induction n with
- | zero => intro s1 s2 a1 a2 hs ha; simp [popN.go, ha, hs]
- | succ n ih =>
- intro s1 s2 a1 a2 hs ha
- cases s1 with
- | nil =>
- cases s2 with
- | nil => rfl
- | cons _ _ => simp at hs
- | cons c1 r1 =>
- cases s2 with
- | nil => simp at hs
- | cons c2 r2 =>
- simp only [List.map_cons, List.cons.injEq, eraseCell, Prod.mk.injEq] at hs
- simp only [popN.go]
- exact ih r1 r2 _ _ hs.2 (by simp [ha, hs.1.2])
-
-theorem topState_erase (tbl : ExecTable (Span × W)) {s1 s2 : Stack (Span × W)}
- (hs : s1.map eraseCell = s2.map eraseCell) : topState tbl s1 = topState tbl s2 := by
- cases s1 <;> cases s2 <;> simp_all [topState, eraseCell]
-
-/-- A reduce outcome without spans. -/
-def eraseRed : Result (Span × W) ⊕ Stack (Span × W) → Result W ⊕ List (Nat × W)
- | .inl r => .inl r.eraseSpan
- | .inr s => .inr (s.map eraseCell)
-
-theorem reduce_erase (tbl : ExecTable (Span × W)) (hsem : SemSpanFree tbl.sem) (p : Nat)
- {s1 s2 : Stack (Span × W)} (hs : s1.map eraseCell = s2.map eraseCell) :
- eraseRed (reduce tbl p s1) = eraseRed (reduce tbl p s2) := by
- have h := popN_go_erase (tbl.prodRhsLen p) s1 s2 [] [] hs rfl
- unfold reduce popN
- cases h1 : popN.go (tbl.prodRhsLen p) s1 [] with
- | none =>
- cases h2 : popN.go (tbl.prodRhsLen p) s2 [] with
- | none => rfl
- | some _ => rw [h1, h2] at h; simp at h
- | some r1 =>
- cases h2 : popN.go (tbl.prodRhsLen p) s2 [] with
- | none => rw [h1, h2] at h; simp at h
- | some r2 =>
- rw [h1, h2] at h
- obtain ⟨a1, t1⟩ := r1
- obtain ⟨a2, t2⟩ := r2
- simp only [Option.map_some, Option.some.injEq, Prod.mk.injEq] at h
- obtain ⟨ha, hr⟩ := h
- have hv := hsem.congr p ha
- dsimp only
- rw [topState_erase tbl hr]
- cases tbl.goto (topState tbl t2) (tbl.prodLhs p) with
- | none => simp [eraseRed, Result.eraseSpan, hv]
- | some s' => simp [eraseRed, eraseCell, hv, hr]
-
-/-- A step outcome without spans. -/
-def eraseStep : Result (Span × W) ⊕ (Stack (Span × W) × List (Nat × (Span × W))) →
- Result W ⊕ (List (Nat × W) × List (Nat × W))
- | .inl r => .inl r.eraseSpan
- | .inr (s, i) => .inr (s.map eraseCell, i.map eraseCell)
-
-theorem step_erase (tbl : ExecTable (Span × W)) (hsem : SemSpanFree tbl.sem)
- {s1 s2 : Stack (Span × W)} {i1 i2 : List (Nat × (Span × W))}
- (hs : s1.map eraseCell = s2.map eraseCell) (hi : i1.map eraseCell = i2.map eraseCell) :
- eraseStep (step tbl s1 i1) = eraseStep (step tbl s2 i2) := by
- have hred := (reduce_erase tbl hsem · hs)
- unfold step
- dsimp only
- rw [topState_erase tbl hs]
- cases tbl.defaultReduce (topState tbl s2) with
- | some p =>
- dsimp only
- have h := hred p
- revert h
- cases reduce tbl p s1 <;> cases reduce tbl p s2 <;> simp_all [eraseRed, eraseStep]
- | none =>
- dsimp only
- have hhd : eraseCell (i1.getD 0 tbl.eof) = eraseCell (i2.getD 0 tbl.eof) := by
- cases i1 <;> cases i2 <;> simp_all
- generalize i1.getD 0 tbl.eof = c1 at hhd ⊢
- generalize i2.getD 0 tbl.eof = c2 at hhd ⊢
- obtain ⟨t1, v1⟩ := c1
- obtain ⟨t2, v2⟩ := c2
- simp only [eraseCell, Prod.mk.injEq] at hhd
- obtain ⟨rfl, hv⟩ := hhd
- dsimp only
- cases tbl.action (topState tbl s2) t1 with
- | shift s' =>
- simp [eraseStep, eraseCell, hs, hv, hi]
- | reduce p =>
- dsimp only
- have h := hred p
- revert h
- cases reduce tbl p s1 <;> cases reduce tbl p s2 <;> simp_all [eraseRed, eraseStep]
- | accept =>
- cases s1 <;> cases s2 <;> simp_all [eraseStep, eraseCell, Result.eraseSpan]
- | error => rfl
-
-theorem parseFix_erase (tbl : ExecTable (Span × W)) (hsem : SemSpanFree tbl.sem) (n : Nat) :
- ∀ {s1 s2 : Stack (Span × W)} {i1 i2 : List (Nat × (Span × W))},
- s1.map eraseCell = s2.map eraseCell → i1.map eraseCell = i2.map eraseCell →
- eraseStep (parseFix tbl s1 i1 n) = eraseStep (parseFix tbl s2 i2 n) := by
- induction n with
- | zero => intro s1 s2 i1 i2 hs hi; exact step_erase tbl hsem hs hi
- | succ n ih =>
- intro s1 s2 i1 i2 hs hi
- have h := ih hs hi
- simp only [parseFix]
- revert h
- cases parseFix tbl s1 i1 n with
- | inl r1 =>
- cases parseFix tbl s2 i2 n with
- | inl r2 => intro h; exact h
- | inr _ => simp [eraseStep]
- | inr x1 =>
- cases parseFix tbl s2 i2 n with
- | inl _ => simp [eraseStep]
- | inr x2 =>
- obtain ⟨a1, b1⟩ := x1
- obtain ⟨a2, b2⟩ := x2
- simp only [eraseStep, Sum.inr.injEq, Prod.mk.injEq]
- intro ⟨ha, hb⟩
- exact ih ha hb
-
-theorem run_erase (tbl : ExecTable (Span × W)) (hsem : SemSpanFree tbl.sem)
- {i1 i2 : List (Nat × (Span × W))} (hi : i1.map eraseCell = i2.map eraseCell) (n : Nat) :
- (run tbl i1 n).eraseSpan = (run tbl i2 n).eraseSpan := by
- have h := parseFix_erase tbl hsem n (s1 := []) (s2 := []) rfl hi
- unfold run
- revert h
- cases parseFix tbl [] i1 n <;> cases parseFix tbl [] i2 n <;> simp_all [eraseStep]
-
-theorem SemSpanFree.of_split (semS : Nat → List (Span × W) → Span) (semV : Nat → List W → W) :
- SemSpanFree (fun p args => (semS p args, semV p (args.map Prod.snd))) := by
- intro p args
- simp [List.map_map, Function.comp_def]
-
-/-- `SpanIndependent` for a parse that runs `Exec.run` on the decoded tokens and reads only the
- span-free result. -/
-theorem SpanIndependent.of_run {T α : Type} {parse : List (Positioned T) → Nat → Option α}
- (tbl : ExecTable (Span × W)) (hsem : SemSpanFree tbl.sem) (term : T → Nat) (val : T → W)
- (g : Result W → Option α)
- (h : ∀ ts k, parse ts k = g (run tbl (ts.map (decodeWith term val)) k).eraseSpan) :
- SpanIndependent parse := by
- intro ts k
- rw [h, h]
- congr 1
- apply run_erase tbl hsem
- simp [List.map_map, Function.comp_def, eraseCell, decodeWith]
-
-end SpanErase
-
/-! ### Engine -/
variable {W T S σ : Type}
diff --git a/LeanParserGenerator/Runtime/ParseEnd.lean b/LeanParserGenerator/Runtime/ParseEnd.lean
new file mode 100644
index 0000000..721b880
--- /dev/null
+++ b/LeanParserGenerator/Runtime/ParseEnd.lean
@@ -0,0 +1,394 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+The parser does not accept before it has read the end marker.
+
+The augmented start production is `S' → S $`, so every word a start tree yields contains a
+`$` token (`parseTree_has_end`, given that every start production has `$` on its right-hand
+side, a decidable fact about the grammar). `parse` consumes at most one token per step
+(`parseFix_consumed`), so with `2^logN` steps it reads at most `2^logN` tokens. Together with
+`parseCorrect` (the consumed prefix is the yield of a start tree):
+
+`parse_ne_parsed_of_no_end`: on the stream `l` followed by end tokens, where no token of `l`
+is an end token and `l` is longer than `2^logN`, `parse` does not return `Parsed`.
+
+This is what closes the lex-failure case of the stream parser: the tokens it has read before
+a lex error contain no EOF token, and it can be given any continuation of them.
+
+`start_word_eq`: when `$` is the last symbol of every start production and no other
+right-hand side contains `$` or the start symbol (`EndMarkerLast`, also decidable), a start
+tree's word ends with its only `$` token. So if the word begins the stream of a list
+`ts0 ++ [a]` whose only `$` token is the last one, the word is `ts0 ++ [a]`.
+-/
+public import LeanParserGenerator.Runtime.Correct
+public import LeanParserGenerator.Runtime.ExecStream
+
+
+@[expose] public section
+
+set_option linter.unusedSectionVars false
+
+namespace Runtime
+
+open Grammar
+
+variable [G : Grammar] [A : Automaton]
+
+/-! ### Every start word contains the end marker -/
+
+mutual
+theorem parseTree_terminal_mem {e : G.Terminal} :
+ ∀ {sym : Sym} {w : List G.Token}, ParseTree sym w → sym = .T e → ∃ t ∈ w, G.tokenTerm t = e
+ | _, _, .terminal tok, h => ⟨tok, List.mem_singleton.2 rfl, by cases h; rfl⟩
+ | _, _, .nonTerminal _ _, h => by cases h
+
+theorem parseTreeList_has {e : G.Terminal} :
+ ∀ {syms : List Sym} {w : List G.Token}, ParseTreeList syms w → (.T e) ∈ syms →
+ ∃ t ∈ w, G.tokenTerm t = e
+ | _, _, .nil, h => by cases h
+ | _, _, .cons q t, h => by
+ rcases List.mem_cons.mp h with h | h
+ · obtain ⟨x, hx, he⟩ := parseTree_terminal_mem t h.symm
+ exact ⟨x, List.mem_append_right _ hx, he⟩
+ · obtain ⟨x, hx, he⟩ := parseTreeList_has q h
+ exact ⟨x, List.mem_append_left _ hx, he⟩
+end
+
+theorem parseTree_nt_has (e : G.Terminal) (n : G.NonTerminal)
+ (hend : ∀ p : G.Production, G.prodLhs p = n → (.T e) ∈ G.prodRhsRev p) :
+ ∀ {sym : Sym} {w : List G.Token}, ParseTree sym w → sym = .NT n → ∃ t ∈ w, G.tokenTerm t = e
+ | _, _, .terminal _, h => by cases h
+ | _, _, .nonTerminal p l, h => by
+ have hp : G.prodLhs p = n := by cases h; rfl
+ exact parseTreeList_has l (hend p hp)
+
+/-- If every production of the start symbol has the terminal `e` on its right-hand side, the
+ yield of a start tree contains a token of terminal `e`. -/
+theorem parseTree_has_end (init : A.InitState) (e : G.Terminal)
+ (hend : ∀ p : G.Production, G.prodLhs p = A.startNt init → (.T e) ∈ G.prodRhsRev p)
+ {w : List G.Token} (pt : ParseTree (.NT (A.startNt init)) w) : ∃ t ∈ w, G.tokenTerm t = e :=
+ parseTree_nt_has e _ hend pt rfl
+
+/-! ### Consumption -/
+
+variable {S : Type} [TokenStream S G.Token]
+
+/-- `s` with `j` tokens consumed. -/
+def advance : Nat → S → S
+ | 0, s => s
+ | j + 1, s => advance j (TokenStream.tail s)
+
+theorem advance_add : ∀ (a b : Nat) (s : S), advance b (advance a s) = advance (a + b) s
+ | 0, b, s => by simp [advance]
+ | a + 1, b, s => by
+ rw [advance, advance_add a b, show a + 1 + b = (a + b) + 1 by omega, advance]
+
+/-- `s'` is `s` with at most `k` tokens consumed. -/
+def Consumed (s s' : S) (k : Nat) : Prop := ∃ j, j ≤ k ∧ s' = advance j s
+
+theorem reduceStep_accept_stream (init : A.InitState) (stk : Stack) (prod : G.Production) (s : S)
+ (sem : G.semT (.NT (A.startNt init))) (s' : S)
+ (h : reduceStep init stk prod s = .Accept sem s') : s' = s := by
+ unfold reduceStep at h
+ repeat' split at h
+ all_goals (cases h <;> rfl)
+
+theorem reduceStep_progress_stream (init : A.InitState) (stk : Stack) (prod : G.Production)
+ (s : S) (stk' : Stack) (s' : S)
+ (h : reduceStep init stk prod s = .Progress stk' s') : s' = s := by
+ unfold reduceStep at h
+ repeat' split at h
+ all_goals (cases h <;> rfl)
+
+theorem step_consumed (init : A.InitState) (stk : Stack) (s : S) :
+ match step init stk s with
+ | .Accept _ s' => Consumed s s' 1
+ | .Progress _ s' => Consumed s s' 1
+ | _ => True := by
+ have r0 : ∀ prod, match reduceStep init stk prod s with
+ | .Accept _ s' => Consumed s s' 1
+ | .Progress _ s' => Consumed s s' 1
+ | _ => True := by
+ intro prod
+ cases hr : reduceStep init stk prod s with
+ | Accept sem s' => exact ⟨0, Nat.zero_le _, reduceStep_accept_stream init stk prod s sem s' hr⟩
+ | Progress stk' s' =>
+ exact ⟨0, Nat.zero_le _, reduceStep_progress_stream init stk prod s stk' s' hr⟩
+ | Fail _ _ => trivial
+ | Err _ => trivial
+ cases haction : A.actionTable (stateOfStack init stk) with
+ | DefaultReduce prod =>
+ have hstep : step (S := S) init stk s = reduceStep init stk prod s := by
+ unfold step; rw [haction]
+ rw [hstep]; exact r0 prod
+ | Lookahead awt =>
+ cases hawt : awt (G.tokenTerm (TokenStream.head s)) with
+ | Shift stateNew e =>
+ have hstep : step (S := S) init stk s
+ = .Progress (⟨stateNew, castSem e (G.tokenSem (TokenStream.head s))⟩ :: stk)
+ (TokenStream.tail s) := by
+ unfold step; rw [haction]; simp only [hawt]
+ rw [hstep]
+ exact ⟨1, Nat.le_refl _, rfl⟩
+ | Reduce prod =>
+ have hstep : step (S := S) init stk s = reduceStep init stk prod s := by
+ unfold step; rw [haction]; simp only [hawt]
+ rw [hstep]; exact r0 prod
+ | Fail =>
+ have hstep : step (S := S) init stk s
+ = .Fail (stateOfStack init stk) (TokenStream.head s) := by
+ unfold step; rw [haction]; simp only [hawt]
+ rw [hstep]; trivial
+
+theorem Consumed.trans {s s' s'' : S} {a b : Nat} (h1 : Consumed s s' a) (h2 : Consumed s' s'' b) :
+ Consumed s s'' (a + b) := by
+ obtain ⟨j1, hj1, rfl⟩ := h1
+ obtain ⟨j2, hj2, rfl⟩ := h2
+ exact ⟨j1 + j2, by omega, advance_add j1 j2 s⟩
+
+theorem Consumed.mono {s s' : S} {a b : Nat} (h : Consumed s s' a) (hab : a ≤ b) :
+ Consumed s s' b := by
+ obtain ⟨j, hj, rfl⟩ := h
+ exact ⟨j, by omega, rfl⟩
+
+/-- `parseFix` with `logN` consumes at most `2^logN` tokens. -/
+theorem parseFix_consumed (init : A.InitState) (logN : Nat) :
+ ∀ (stk : Stack) (s : S),
+ match parseFix init stk s logN with
+ | .Accept _ s' => Consumed s s' (2 ^ logN)
+ | .Progress _ s' => Consumed s s' (2 ^ logN)
+ | _ => True := by
+ induction logN with
+ | zero => intro stk s; exact step_consumed init stk s
+ | succ n ih =>
+ intro stk s
+ have h1 := ih stk s
+ simp only [parseFix]
+ cases hpf : parseFix init stk s n with
+ | Accept sem s' =>
+ rw [hpf] at h1
+ exact h1.mono (by rw [Nat.pow_succ]; omega)
+ | Progress stk' s' =>
+ rw [hpf] at h1
+ have h2 := ih stk' s'
+ dsimp only
+ cases hpf2 : parseFix init stk' s' n with
+ | Accept sem s'' =>
+ rw [hpf2] at h2
+ exact (h1.trans h2).mono (by rw [Nat.pow_succ]; omega)
+ | Progress stk'' s'' =>
+ rw [hpf2] at h2
+ exact (h1.trans h2).mono (by rw [Nat.pow_succ]; omega)
+ | Fail _ _ => trivial
+ | Err _ => trivial
+ | Fail _ _ => trivial
+ | Err _ => trivial
+
+theorem parse_consumed (init : A.InitState) (s : S) (logN : Nat)
+ (sem : G.semT (.NT (A.startNt init))) (s' : S)
+ (h : parse init s logN = .Parsed sem s') : Consumed s s' (2 ^ logN) := by
+ unfold parse at h
+ have := parseFix_consumed init logN [] s
+ revert this h
+ cases parseFix init [] s logN with
+ | Accept sem0 s0 => intro h hc; simp only [ParseResult.Parsed.injEq] at h; rw [← h.2]; exact hc
+ | Progress _ _ => intro h; cases h
+ | Fail _ _ => intro h; cases h
+ | Err _ => intro h; cases h
+
+/-! ### Streams of a list followed by end tokens -/
+
+theorem list_getD_lt {T : Type} (l : List T) (d : T) (i : Nat) (h : i < l.length) :
+ l.getD i d = l[i] := by
+ rw [List.getD_eq_getElem?_getD, List.getElem?_eq_getElem h]; rfl
+
+theorem list_getD_ge {T : Type} (l : List T) (d : T) (i : Nat) (h : l.length ≤ i) :
+ l.getD i d = d := by
+ rw [List.getD_eq_getElem?_getD, List.getElem?_eq_none h]; rfl
+
+theorem NatStream.advance_eq [G' : Grammar] (s : NatStream G'.Token) (j : Nat) :
+ advance (G := G') j s = fun n => s (n + j) := by
+ induction j generalizing s with
+ | zero => rfl
+ | succ j ih =>
+ rw [advance, ih]
+ funext n
+ show s (n + j + 1) = s (n + (j + 1))
+ rw [Nat.add_assoc]
+
+theorem NatStream.appList_lt {T : Type} :
+ ∀ (w : List T) (r : NatStream T) (n : Nat) (h : n < w.length),
+ NatStream.appList w r n = w[n]
+ | [], _, _, h => by simp at h
+ | t :: ts, r, 0, _ => rfl
+ | t :: ts, r, n + 1, h => by
+ simp only [NatStream.appList, List.getElem_cons_succ]
+ exact NatStream.appList_lt ts r n (by simpa using h)
+
+theorem NatStream.appList_length {T : Type} :
+ ∀ (w : List T) (r : NatStream T), NatStream.appList w r w.length = r 0
+ | [], _ => rfl
+ | t :: ts, r => by
+ simp only [NatStream.appList, List.length_cons]
+ exact NatStream.appList_length ts r
+
+/-- **No acceptance before the end marker.** On the stream of `l` followed by `pad` forever,
+ where `pad` has terminal `e`, no token of `l` does, and `l` has more than `2^logN` tokens,
+ `parse` does not accept. -/
+theorem parse_ne_parsed_of_no_end (init : A.InitState) (e : G.Terminal)
+ (hend : ∀ p : G.Production, G.prodLhs p = A.startNt init → (.T e) ∈ G.prodRhsRev p)
+ (l : List G.Token) (pad : G.Token) (hpad : G.tokenTerm pad = e)
+ (hl : ∀ t ∈ l, G.tokenTerm t ≠ e) (logN : Nat) (hlen : 2 ^ logN < l.length)
+ (sem : G.semT (.NT (A.startNt init))) (rest : NatStream G.Token) :
+ parse (S := NatStream G.Token) init (fun n => l.getD n pad) logN ≠ .Parsed sem rest := by
+ intro h
+ have hc := parse_consumed init _ logN sem rest h
+ have hsound := parseCorrect (S := NatStream G.Token) init (fun n => l.getD n pad) logN
+ rw [h] at hsound
+ obtain ⟨word, pt, hs, _⟩ := hsound
+ obtain ⟨j, hj, hrest⟩ := hc
+ replace hrest : rest = fun n => l.getD (n + j) pad := by
+ rw [hrest]; exact NatStream.advance_eq (G' := G) (fun n => l.getD n pad) j
+ obtain ⟨t, ht, hte⟩ := parseTree_has_end init e hend pt
+ obtain ⟨i, hi, rfl⟩ := List.getElem_of_mem ht
+ -- the end token of the word sits past `l`
+ have hi' : l.length ≤ i := by
+ apply Nat.le_of_not_lt
+ intro hlt
+ have hpos := congrFun hs i
+ change l.getD i pad = AppStream.appList word rest i at hpos
+ change l.getD i pad = NatStream.appList word rest i at hpos
+ rw [NatStream.appList_lt word rest i hi] at hpos
+ have := hl (l.getD i pad) (by rw [list_getD_lt _ _ _ (by omega)]; exact List.getElem_mem _)
+ rw [hpos] at this
+ exact this hte
+ -- position `word.length` of the stream is both `pad` and `l[j]`
+ have hw := congrFun hs word.length
+ change l.getD word.length pad = NatStream.appList word rest word.length at hw
+ rw [NatStream.appList_length, hrest] at hw
+ simp only [Nat.zero_add] at hw
+ rw [list_getD_ge _ _ _ (by omega)] at hw
+ have := hl (l.getD j pad) (by rw [list_getD_lt _ _ _ (by omega)]; exact List.getElem_mem _)
+ rw [← hw] at this
+ exact this hpad
+
+/-! ### The end marker closes the word -/
+
+/-- `$` (`e`) is the last symbol of every production of the start symbol `n0`, and no other
+ position of a right-hand side holds `$` or `n0`. The generated augmented grammar
+ `S' → S $` has this property: `$` and `S'` are not symbols of the source grammar. -/
+abbrev EndMarkerLast (n0 : G.NonTerminal) (e : G.Terminal) : Prop :=
+ ∀ p : G.Production,
+ (G.prodLhs p = n0 → (G.prodRhsRev p).head? = some (.T e) ∧
+ ∀ x ∈ (G.prodRhsRev p).tail, x ≠ .T e ∧ x ≠ .NT n0) ∧
+ (G.prodLhs p ≠ n0 → ∀ x ∈ G.prodRhsRev p, x ≠ .T e ∧ x ≠ .NT n0)
+
+mutual
+/-- Under `EndMarkerLast`, a tree of a symbol other than `$` and `n0` has no `$` token. -/
+theorem parseTree_no_end {n0 : G.NonTerminal} {e : G.Terminal} (h : EndMarkerLast n0 e) :
+ ∀ {sym : Sym} {w : List G.Token}, ParseTree sym w → sym ≠ .T e → sym ≠ .NT n0 →
+ ∀ t ∈ w, G.tokenTerm t ≠ e
+ | _, _, .terminal tok, h1, _ => fun t ht he => by
+ rw [List.mem_singleton.mp ht] at he
+ exact h1 (by rw [he])
+ | _, _, .nonTerminal p l, _, h2 =>
+ parseTreeList_no_end h l ((h p).2 (fun hp => h2 (by rw [hp])))
+
+theorem parseTreeList_no_end {n0 : G.NonTerminal} {e : G.Terminal} (h : EndMarkerLast n0 e) :
+ ∀ {syms : List Sym} {w : List G.Token}, ParseTreeList syms w →
+ (∀ x ∈ syms, x ≠ .T e ∧ x ≠ .NT n0) → ∀ t ∈ w, G.tokenTerm t ≠ e
+ | _, _, .nil, _ => fun _ ht => by cases ht
+ | _, _, .cons q t, hs => fun x hx => by
+ rcases List.mem_append.mp hx with hx | hx
+ · exact parseTreeList_no_end h q (fun y hy => hs y (List.mem_cons_of_mem _ hy)) x hx
+ · have h0 := hs _ List.mem_cons_self
+ exact parseTree_no_end h t h0.1 h0.2 x hx
+end
+
+theorem parseTree_terminal_word {e : G.Terminal} :
+ ∀ {sym : Sym} {w : List G.Token}, ParseTree sym w → sym = .T e →
+ ∃ tok, w = [tok] ∧ G.tokenTerm tok = e
+ | _, _, .terminal tok, h => ⟨tok, rfl, by cases h; rfl⟩
+ | _, _, .nonTerminal _ _, h => by cases h
+
+theorem parseTree_start_word_aux {n0 : G.NonTerminal} {e : G.Terminal} (h : EndMarkerLast n0 e) :
+ ∀ {sym : Sym} {w : List G.Token}, ParseTree sym w → sym = .NT n0 →
+ ∃ w0 tok, w = w0 ++ [tok] ∧ G.tokenTerm tok = e ∧ ∀ t ∈ w0, G.tokenTerm t ≠ e
+ | _, _, .terminal _, hs => by cases hs
+ | _, _, .nonTerminal p l, hs => by
+ have hp : G.prodLhs p = n0 := by cases hs; rfl
+ obtain ⟨hhead, htail⟩ := (h p).1 hp
+ revert hhead htail
+ generalize G.prodRhsRev p = syms at l
+ intro hhead htail
+ cases l with
+ | nil => cases hhead
+ | cons q t =>
+ simp only [List.head?_cons, Option.some.injEq] at hhead
+ simp only [List.tail_cons] at htail
+ obtain ⟨tok, rfl, htok⟩ := parseTree_terminal_word t hhead
+ exact ⟨_, tok, rfl, htok, parseTreeList_no_end h q htail⟩
+
+/-- **A start tree's word ends with its only `$` token.** -/
+theorem parseTree_start_word (init : A.InitState) (e : G.Terminal)
+ (h : EndMarkerLast (A.startNt init) e) {w : List G.Token}
+ (pt : ParseTree (.NT (A.startNt init)) w) :
+ ∃ w0 tok, w = w0 ++ [tok] ∧ G.tokenTerm tok = e ∧ ∀ t ∈ w0, G.tokenTerm t ≠ e :=
+ parseTree_start_word_aux h pt rfl
+
+/-- Two lists that each end with their only `P` element and begin the same stream are equal. -/
+theorem NatStream.appList_eq_of_last {T : Type} (P : T → Prop) (pad : T) (ts0 w0 : List T)
+ (a b : T) (rest : NatStream T) (hts : ∀ t ∈ ts0, ¬ P t) (hw : ∀ t ∈ w0, ¬ P t)
+ (ha : P a) (hb : P b)
+ (hs : (fun n => (ts0 ++ [a]).getD n pad) = NatStream.appList (w0 ++ [b]) rest) :
+ w0 ++ [b] = ts0 ++ [a] := by
+ have hat : ∀ n (h1 : n < (w0 ++ [b]).length) (h2 : n < (ts0 ++ [a]).length),
+ (w0 ++ [b])[n] = (ts0 ++ [a])[n] := by
+ intro n h1 h2
+ have := congrFun hs n
+ rw [list_getD_lt _ _ _ h2, NatStream.appList_lt _ _ _ h1] at this
+ exact this.symm
+ have hlen : w0.length = ts0.length := by
+ rcases Nat.lt_trichotomy w0.length ts0.length with hlt | heq | hgt
+ · exfalso
+ have := hat w0.length (by simp) (by simp; omega)
+ rw [List.getElem_append_right (by simp), List.getElem_append_left hlt] at this
+ simp only [Nat.sub_self, List.getElem_cons_zero] at this
+ exact hts _ (List.getElem_mem hlt) (this ▸ hb)
+ · exact heq
+ · exfalso
+ have := hat ts0.length (by simp; omega) (by simp)
+ rw [List.getElem_append_left hgt, List.getElem_append_right (by simp)] at this
+ simp only [Nat.sub_self, List.getElem_cons_zero] at this
+ exact hw _ (List.getElem_mem hgt) (this ▸ ha)
+ exact List.ext_getElem (by simp [hlen]) (fun n h1 h2 => hat n h1 h2)
+
+/-- **The word of an accepting start tree is the whole token list.** If `ts0 ++ [a]` has its
+ only `$` token last, and the word of a start tree begins its stream (padded with `pad`),
+ the word is `ts0 ++ [a]`. -/
+theorem start_word_eq (init : A.InitState) (e : G.Terminal)
+ (h : EndMarkerLast (A.startNt init) e) (pad : G.Token) (ts0 : List G.Token) (a : G.Token)
+ (ha : G.tokenTerm a = e) (hts : ∀ t ∈ ts0, G.tokenTerm t ≠ e) {word : List G.Token}
+ (pt : ParseTree (.NT (A.startNt init)) word) (rest : NatStream G.Token)
+ (hs : (fun n => (ts0 ++ [a]).getD n pad) = NatStream.appList word rest) :
+ word = ts0 ++ [a] := by
+ obtain ⟨w0, tok, rfl, htok, hw⟩ := parseTree_start_word init e h pt
+ exact NatStream.appList_eq_of_last (fun t => G.tokenTerm t = e) pad ts0 w0 a tok rest
+ hts hw ha htok hs
+
+end Runtime
diff --git a/LeanParserGenerator/Runtime/Refinement.lean b/LeanParserGenerator/Runtime/Refinement.lean
index 56b16ec..c339603 100644
--- a/LeanParserGenerator/Runtime/Refinement.lean
+++ b/LeanParserGenerator/Runtime/Refinement.lean
@@ -15,58 +15,64 @@
-/
module
+/-
+The executable parser refines the verified interpreter (docs/DESIGN.md §6.2).
+
+The dependent side is a `SpanGrammar` run on its derived grammar `toGrammar`, whose stack
+cells hold functions `Pos → Span × semT s` (`SpanGrammar.semR`). The executable stack holds
+`(state, (span, value))` cells. `eraseStack` evaluates each dependent cell at the end of the
+erased cell below it (`Exec.stackEnd`, byte 0 at the bottom), which is the position from
+which the executable engine computes the span of an empty right-hand side
+(`Exec.spanSem`). One step of each engine preserves this relation (`step_refines`), and so
+does a whole run (`run_refines`).
+
+The per-grammar obligations are table agreement (checked by `native_decide` in generated
+code) and one span-free equation per production (`semantic_agrees`): the generated
+executable action `semV p spans` agrees with the dependent action `prodAction p spans` for
+every span list.
+-/
public import LeanParserGenerator.Runtime.Exec
public import LeanParserGenerator.Runtime.Safety
+public import LeanParserGenerator.Runtime.SpanGrammar
@[expose] public section
namespace Runtime.Refinement
-open Runtime Grammar
+open Runtime Grammar SpanGrammar
-variable [G : Grammar] [A : Automaton]
-variable {V : Type}
+variable [SG : SpanGrammar] [A : Automaton (G := SG.toGrammarSig)]
+variable {W : Type}
-/-- A heterogeneous list of semantic values indexed by grammar symbols. -/
-inductive Values : List Grammar.Sym → Type
- | nil : Values []
- | cons {symbol : Grammar.Sym} {symbols : List Grammar.Sym}
- (value : G.semT symbol) (rest : Values symbols) : Values (symbol :: symbols)
+attribute [local instance] SpanGrammar.toGrammar
-namespace Values
-
-/-- Apply a curried dependent action to a heterogeneous value list. -/
-def apply {Result : Type} : {symbols : List Grammar.Sym} →
- Values symbols → arrowsRight Result (symbols.map G.semT) → Result
- | [], .nil, action => action
- | s :: _, .cons value rest, action =>
- have action' : G.semT s → arrowsRight Result _ := action
- rest.apply (action' value)
+set_option linter.unusedSectionVars false
/-- Encode a heterogeneous value list into executable values, top first. -/
-def encode (encodeValue : (symbol : Grammar.Sym) → G.semT symbol → V) :
- {symbols : List Grammar.Sym} → Values symbols → List V
+def _root_.Runtime.SpanGrammar.Values.encode (encodeValue : (symbol : SpanGrammar.Sym) → SG.semT symbol → W) :
+ {symbols : List SpanGrammar.Sym} → Values symbols → List W
| [], .nil => []
| symbol :: _, .cons value rest => encodeValue symbol value :: rest.encode encodeValue
-end Values
-
/-- Per-grammar evidence connecting a dependent automaton to an executable table. -/
-structure ExecRefinement (V : Type) where
- table : Exec.ExecTable V
- decode : G.Token → Nat × V
- eof : G.Token
- encodeValue : (symbol : Grammar.Sym) → G.semT symbol → V
+structure ExecRefinement (W : Type) where
+ table : Exec.ExecTable (Span × W)
+ /-- The generated executable action; `table.sem` is `Exec.spanSem semV`. -/
+ semV : Nat → List Span → List W → W
+ decode : Positioned SG.Tok → Nat × (Span × W)
+ eof : Positioned SG.Tok
+ encodeValue : (symbol : SpanGrammar.Sym) → SG.semT symbol → W
stateIndex : AState → Nat
- terminalIndex : G.Terminal → Nat
- nonterminalIndex : G.NonTerminal → Nat
- productionIndex : G.Production → Nat
+ terminalIndex : SG.Terminal → Nat
+ nonterminalIndex : SG.NonTerminal → Nat
+ productionIndex : SG.Production → Nat
start_agrees : ∀ init, table.startState = stateIndex (.Init init)
eof_agrees : table.eof = decode eof
- decode_agrees : ∀ token,
+ decode_agrees : ∀ token : Positioned SG.Tok,
decode token =
- (terminalIndex (G.tokenTerm token), encodeValue (.T (G.tokenTerm token)) (G.tokenSem token))
+ (terminalIndex (SG.tokenTerm token.val),
+ (token.span, encodeValue (.T (SG.tokenTerm token.val)) (SG.tokenSem token.val)))
default_agrees : ∀ state,
table.defaultReduce (stateIndex state) =
match A.actionTable state with
@@ -84,45 +90,96 @@ structure ExecRefinement (V : Type) where
(A.gotoTable state nonterminal).map fun target => stateIndex (.Ninit target.1)
production_lhs_agrees : ∀ production,
table.prodLhs (productionIndex production) =
- nonterminalIndex (G.prodLhs production)
+ nonterminalIndex (SG.prodLhs production)
production_length_agrees : ∀ production,
- table.prodRhsLen (productionIndex production) = (G.prodRhsRev production).length
- semantic_agrees : ∀ production (values : Values (G.prodRhsRev production)),
- table.sem (productionIndex production) (values.encode encodeValue).reverse =
- encodeValue (.NT (G.prodLhs production)) (values.apply (G.prodAction production))
+ table.prodRhsLen (productionIndex production) = (SG.prodRhsRev production).length
+ sem_agrees : table.sem = Exec.spanSem semV
+ semantic_agrees : ∀ production (spans : List Span) (values : Values (SG.prodRhsRev production)),
+ semV (productionIndex production) spans (values.encode encodeValue).reverse =
+ encodeValue (.NT (SG.prodLhs production)) (values.apply (SG.prodAction production spans))
/-- A finite token list viewed as the verified runtime's total EOF-padded stream. -/
-def listStream (refinement : ExecRefinement V) (input : List G.Token) : NatStream G.Token :=
+def listStream (refinement : ExecRefinement W) (input : List (Positioned SG.Tok)) :
+ NatStream (Positioned SG.Tok) :=
fun index => input.getD index refinement.eof
-/-- Erase the dependent parser stack into executable state/value cells. -/
-def eraseStack (refinement : ExecRefinement V) : Runtime.Stack → Exec.Stack V
+/-- Encode a span and a value into an executable cell value. -/
+def ExecRefinement.encodeCell (refinement : ExecRefinement W) (symbol : SpanGrammar.Sym)
+ (cell : Span × SG.semT symbol) : Span × W :=
+ (cell.1, refinement.encodeValue symbol cell.2)
+
+/-- Erase the dependent parser stack into executable state/value cells. Each cell is
+ evaluated at the end of the erased cell below it. -/
+def eraseStack (refinement : ExecRefinement W) : Runtime.Stack → Exec.Stack (Span × W)
| [] => []
| ⟨state, value⟩ :: rest =>
- (refinement.stateIndex (.Ninit state), refinement.encodeValue (A.lastSymb state) value) ::
+ (refinement.stateIndex (.Ninit state),
+ refinement.encodeCell (A.lastSymb state)
+ ((value : semR (A.lastSymb state)) (Exec.stackEnd (eraseStack refinement rest)))) ::
eraseStack refinement rest
-private theorem encode_cast (refinement : ExecRefinement V) {left right : Grammar.Sym}
- (equality : left = right) (value : G.semT left) :
- refinement.encodeValue right (castSem equality value) = refinement.encodeValue left value := by
+private theorem encode_cast (refinement : ExecRefinement W) {left right : SpanGrammar.Sym}
+ (equality : left = right) (value : semR left) (pe : Pos) :
+ refinement.encodeCell right ((castSem (G := SG.toGrammar) equality value : semR right) pe) =
+ refinement.encodeCell left (value pe) := by
subst right
rfl
-private inductive Pops : (symbols : List Grammar.Sym) → Runtime.Stack →
- Runtime.Stack → Values symbols → Prop
+namespace RValsR
+
+/-- Apply a curried derived action to a derived value list. -/
+def applyFn {B : Type} : {symbols : List SpanGrammar.Sym} →
+ RVals symbols → arrowsRight B (symbols.map semR) → B
+ | [], .nil, action => action
+ | s :: _, .cons value rest, action =>
+ have action' : semR s → arrowsRight B _ := action
+ applyFn rest (action' value)
+
+theorem applyFn_collect {B : Type} : {symbols : List SpanGrammar.Sym} →
+ (r : RVals symbols) → (k : RVals symbols → B) → applyFn r (collect symbols k) = k r
+ | [], .nil, _ => rfl
+ | _ :: _, .cons x rest, k => applyFn_collect rest (fun r => k (.cons x r))
+
+/-- The executable cells of a derived value list evaluated from `pe`, in source order. -/
+def cells (refinement : ExecRefinement W) :
+ {symbols : List SpanGrammar.Sym} → RVals symbols → Pos → List (Span × W)
+ | _, .nil, _ => []
+ | s :: _, .cons x rest, pe =>
+ cells refinement rest pe ++ [refinement.encodeCell s (x (rest.endPos pe))]
+
+theorem cells_fst (refinement : ExecRefinement W) : {symbols : List SpanGrammar.Sym} →
+ (r : RVals symbols) → (pe : Pos) → (cells refinement r pe).map Prod.fst = r.spans pe
+ | _, .nil, _ => rfl
+ | _ :: _, .cons x rest, pe => by
+ simp only [cells, List.map_append, cells_fst refinement rest pe, RVals.spans]
+ rfl
+
+theorem cells_snd (refinement : ExecRefinement W) : {symbols : List SpanGrammar.Sym} →
+ (r : RVals symbols) → (pe : Pos) →
+ (cells refinement r pe).map Prod.snd = ((RVals.eval r pe).encode refinement.encodeValue).reverse
+ | _, .nil, _ => rfl
+ | _ :: _, .cons x rest, pe => by
+ simp only [cells, List.map_append, cells_snd refinement rest pe, RVals.eval, Values.encode,
+ List.reverse_cons]
+ rfl
+
+end RValsR
+
+private inductive Pops : (symbols : List SpanGrammar.Sym) → Runtime.Stack →
+ Runtime.Stack → RVals symbols → Prop
| nil (stack : Runtime.Stack) : Pops [] stack stack .nil
- | cons {symbol : Grammar.Sym} {symbols : List Grammar.Sym}
- {state : A.NonInitState} {value : G.semT (A.lastSymb state)}
- {stack rest : Runtime.Stack} {values : Values symbols}
+ | cons {symbol : SpanGrammar.Sym} {symbols : List SpanGrammar.Sym}
+ {state : A.NonInitState} {value : semR (A.lastSymb state)}
+ {stack rest : Runtime.Stack} {values : RVals symbols}
(head : A.lastSymb state = symbol) (tail : Pops symbols stack rest values) :
Pops (symbol :: symbols) (⟨state, value⟩ :: stack) rest
- (.cons (castSem head value) values)
+ (.cons (castSem (G := SG.toGrammar) head value) values)
-private theorem pop_of_pops {Result : Type} {symbols : List Grammar.Sym}
- {stack rest : Runtime.Stack} {values : Values symbols}
+private theorem pop_of_pops {Result : Type} {symbols : List SpanGrammar.Sym}
+ {stack rest : Runtime.Stack} {values : RVals symbols}
(pops : Pops symbols stack rest values)
- (action : arrowsRight Result (symbols.map G.semT)) :
- Runtime.pop symbols stack action = some (rest, values.apply action) := by
+ (action : arrowsRight Result (symbols.map semR)) :
+ Runtime.pop symbols stack action = some (rest, RValsR.applyFn values action) := by
induction pops generalizing Result with
| nil => rfl
| @cons symbol symbols state value stack rest values head tail ih =>
@@ -134,31 +191,49 @@ private theorem pop_of_pops {Result : Type} {symbols : List Grammar.Sym}
exact ih (action (castSem head value))
next mismatch => exact (mismatch head).elim
-private theorem Exec.popNGo_of_pops (refinement : ExecRefinement V) {symbols : List Grammar.Sym}
- {stack rest : Runtime.Stack} {values : Values symbols}
- (pops : Pops symbols stack rest values) (accumulator : List V) :
+private theorem stackEnd_of_pops (refinement : ExecRefinement W) {symbols : List SpanGrammar.Sym}
+ {stack rest : Runtime.Stack} {values : RVals symbols}
+ (pops : Pops symbols stack rest values) :
+ Exec.stackEnd (eraseStack refinement stack) =
+ values.endPos (Exec.stackEnd (eraseStack refinement rest)) := by
+ induction pops with
+ | nil => rfl
+ | @cons symbol symbols state value stack rest values head tail ih =>
+ show (refinement.encodeCell (A.lastSymb state)
+ ((value : semR (A.lastSymb state)) (Exec.stackEnd (eraseStack refinement stack)))).1.endPos = _
+ rw [ih]
+ show _ = ((castSem (G := SG.toGrammar) head value : semR symbol)
+ (values.endPos (Exec.stackEnd (eraseStack refinement rest)))).1.endPos
+ subst head
+ rfl
+
+private theorem Exec.popNGo_of_pops (refinement : ExecRefinement W) {symbols : List SpanGrammar.Sym}
+ {stack rest : Runtime.Stack} {values : RVals symbols}
+ (pops : Pops symbols stack rest values) (accumulator : List (Span × W)) :
Exec.popN.go symbols.length (eraseStack refinement stack) accumulator =
- some ((values.encode refinement.encodeValue).reverse ++ accumulator,
+ some (RValsR.cells refinement values (Exec.stackEnd (eraseStack refinement rest)) ++ accumulator,
eraseStack refinement rest) := by
induction pops generalizing accumulator with
| nil => rfl
| @cons symbol symbols state value stack rest values head tail ih =>
simp only [List.length_cons, eraseStack, Exec.popN.go]
- rw [ih (refinement.encodeValue (A.lastSymb state) value :: accumulator)]
- simp only [Values.encode, List.reverse_cons, List.append_assoc, List.singleton_append]
+ rw [ih]
+ rw [stackEnd_of_pops refinement tail]
+ simp only [RValsR.cells, List.append_assoc, List.singleton_append]
rw [encode_cast refinement head]
-private theorem Exec.popN_of_pops (refinement : ExecRefinement V) {symbols : List Grammar.Sym}
- {stack rest : Runtime.Stack} {values : Values symbols}
+private theorem Exec.popN_of_pops (refinement : ExecRefinement W) {symbols : List SpanGrammar.Sym}
+ {stack rest : Runtime.Stack} {values : RVals symbols}
(pops : Pops symbols stack rest values) :
Exec.popN symbols.length (eraseStack refinement stack) =
- some ((values.encode refinement.encodeValue).reverse, eraseStack refinement rest) := by
+ some (RValsR.cells refinement values (Exec.stackEnd (eraseStack refinement rest)),
+ eraseStack refinement rest) := by
unfold Exec.popN
simpa using popNGo_of_pops refinement pops []
-private theorem pops_of_prefix : ∀ (symbols : List Grammar.Sym) (stack : Runtime.Stack),
+private theorem pops_of_prefix : ∀ (symbols : List SpanGrammar.Sym) (stack : Runtime.Stack),
Prefix symbols (symbStackOfStack stack) →
- ∃ (rest : Runtime.Stack) (values : Values symbols), Pops symbols stack rest values := by
+ ∃ (rest : Runtime.Stack) (values : RVals symbols), Pops symbols stack rest values := by
intro symbols
induction symbols with
| nil =>
@@ -174,7 +249,7 @@ private theorem pops_of_prefix : ∀ (symbols : List Grammar.Sym) (stack : Runti
obtain ⟨rest, values, pops⟩ := ih stack tail
exact ⟨rest, .cons (castSem head.symm value) values, .cons head.symm pops⟩
-private theorem top_state_agrees (refinement : ExecRefinement V) (init : A.InitState)
+private theorem top_state_agrees (refinement : ExecRefinement W) (init : A.InitState)
(stack : Runtime.Stack) :
Exec.topState refinement.table (eraseStack refinement stack) =
refinement.stateIndex (stateOfStack init stack) := by
@@ -182,39 +257,65 @@ private theorem top_state_agrees (refinement : ExecRefinement V) (init : A.InitS
| nil => exact refinement.start_agrees init
| cons cell _ => cases cell; rfl
-private def eraseReductionResult (refinement : ExecRefinement V) (init : A.InitState) :
- StepResult (NatStream G.Token) init → Exec.Result V ⊕ Exec.Stack V
+/-- The executable value of the semantic action of `production` on popped values. -/
+private theorem sem_of_pops (refinement : ExecRefinement W) (production : SG.Production)
+ {stack rest : Runtime.Stack} {values : RVals (SG.prodRhsRev production)}
+ (pops : Pops (SG.prodRhsRev production) stack rest values) :
+ refinement.table.sem (refinement.productionIndex production) (eraseStack refinement rest)
+ (RValsR.cells refinement values (Exec.stackEnd (eraseStack refinement rest))) =
+ refinement.encodeCell (.NT (SG.prodLhs production))
+ ((RValsR.applyFn values (Grammar.prodAction production) : semR _)
+ (Exec.stackEnd (eraseStack refinement rest))) := by
+ have _ := pops
+ rw [refinement.sem_agrees]
+ show _ = refinement.encodeCell _ ((RValsR.applyFn values (readerAction production) : semR _) _)
+ have hc : (RValsR.applyFn values (readerAction production) : semR _) = fun pe =>
+ (Span.fold pe (values.spans pe), (values.eval pe).apply (SG.prodAction production (values.spans pe))) := by
+ unfold readerAction
+ refine (RValsR.applyFn_collect values _).trans ?_
+ funext pe
+ rw [RVals.run_eq]
+ rw [hc]
+ unfold Exec.spanSem
+ simp only [RValsR.cells_fst, RValsR.cells_snd]
+ rw [refinement.semantic_agrees]
+ rfl
+
+private def eraseReductionResult (refinement : ExecRefinement W) (init : A.InitState) :
+ StepResult (NatStream (Positioned SG.Tok)) init → Exec.Result (Span × W) ⊕ Exec.Stack (Span × W)
| .Fail state token =>
- .inl (.reject (refinement.stateIndex state) (refinement.terminalIndex (G.tokenTerm token)))
- | .Accept value _ => .inl (.ok (refinement.encodeValue (.NT (A.startNt init)) value))
+ .inl (.reject (refinement.stateIndex state) (refinement.terminalIndex (SG.tokenTerm token.val)))
+ | .Accept value _ =>
+ .inl (.ok (refinement.encodeCell (.NT (A.startNt init)) ((value : semR _) ⟨0⟩)))
| .Progress stack _ => .inr (eraseStack refinement stack)
| .Err message => .inl (.err message)
-private theorem reduce_agrees (refinement : ExecRefinement V)
- (init : A.InitState) (stack : Runtime.Stack) (input : List G.Token)
- (production : G.Production) (invariant : StackInvariant init stack)
+private theorem reduce_agrees (refinement : ExecRefinement W)
+ (init : A.InitState) (stack : Runtime.Stack) (input : List (Positioned SG.Tok))
+ (production : SG.Production) (invariant : StackInvariant init stack)
(valid : ValidForReduce (stateOfStack init stack) production) :
Exec.reduce refinement.table (refinement.productionIndex production) (eraseStack refinement stack) =
eraseReductionResult refinement init
(Runtime.reduceStep init stack production (listStream refinement input)) := by
have hPrefix := valid.1.trans invariant.symbs
obtain ⟨rest, values, pops⟩ := pops_of_prefix _ _ hPrefix
- have dependentPop := pop_of_pops pops (G.prodAction production)
+ have dependentPop := pop_of_pops pops (Grammar.prodAction production)
have executablePop := Exec.popN_of_pops refinement pops
obtain ⟨safeRest, safeValue, safePop, _, stateValid⟩ :=
- pop_safe init (G.prodRhsRev production) stack (G.prodAction production)
+ pop_safe init (SG.prodRhsRev production) stack (Grammar.prodAction production)
(headStates (stateOfStack init stack)) invariant hPrefix invariant.states
rw [dependentPop] at safePop
have pairEq := Option.some.inj safePop
have restEq : rest = safeRest := congrArg Prod.fst pairEq
subst safeRest
+ have hsem := sem_of_pops refinement production pops
unfold Exec.reduce Runtime.reduceStep
rw [refinement.production_length_agrees, executablePop]
simp only
- rw [refinement.semantic_agrees, refinement.production_lhs_agrees, dependentPop]
+ rw [hsem, refinement.production_lhs_agrees, dependentPop]
simp only
rw [top_state_agrees refinement init rest, refinement.goto_agrees]
- cases gotoResult : A.gotoTable (stateOfStack init rest) (G.prodLhs production) with
+ cases gotoResult : A.gotoTable (stateOfStack init rest) (SG.prodLhs production) with
| some target =>
obtain ⟨target, equality⟩ := target
simp only [Option.map_some, eraseReductionResult, eraseStack]
@@ -225,68 +326,69 @@ private theorem reduce_agrees (refinement : ExecRefinement V)
simp only [Option.map_none]
cases rest with
| nil =>
- have startEq : G.prodLhs production = A.startNt init := by
+ have startEq : SG.prodLhs production = A.startNt init := by
simpa only [stateOfStack] using missing
simp only [startEq, eraseReductionResult]
congr 2
exact (encode_cast refinement
- (congrArg (fun nt => (Symbol.NT nt : Grammar.Sym)) startEq)
- (values.apply (G.prodAction production))).symm
+ (congrArg (fun nt => (Symbol.NT nt : SpanGrammar.Sym)) startEq)
+ (RValsR.applyFn values (Grammar.prodAction production)) ⟨0⟩).symm
| cons cell tail =>
obtain ⟨state, value⟩ := cell
exact missing.elim
/-- Relation between one dependent result and one executable result/configuration. -/
-inductive StepRel (refinement : ExecRefinement V) (init : A.InitState) :
- (input : List G.Token) → StepResult (NatStream G.Token) init →
- Exec.Result V ⊕ (Exec.Stack V × List (Nat × V)) → Prop
- | fail (input : List G.Token) (state : AState) (token : G.Token) :
+inductive StepRel (refinement : ExecRefinement W) (init : A.InitState) :
+ (input : List (Positioned SG.Tok)) → StepResult (NatStream (Positioned SG.Tok)) init →
+ Exec.Result (Span × W) ⊕ (Exec.Stack (Span × W) × List (Nat × (Span × W))) → Prop
+ | fail (input : List (Positioned SG.Tok)) (state : AState) (token : Positioned SG.Tok) :
StepRel refinement init input (.Fail state token)
- (.inl (.reject (refinement.stateIndex state) (refinement.terminalIndex (G.tokenTerm token))))
- | accept (input : List G.Token) (value : G.semT (.NT (A.startNt init)))
- (stream : NatStream G.Token) :
+ (.inl (.reject (refinement.stateIndex state) (refinement.terminalIndex (SG.tokenTerm token.val))))
+ | accept (input : List (Positioned SG.Tok)) (value : semR (.NT (A.startNt init)))
+ (stream : NatStream (Positioned SG.Tok)) :
StepRel refinement init input (.Accept value stream)
- (.inl (.ok (refinement.encodeValue (.NT (A.startNt init)) value)))
- | same (input : List G.Token) (stack : Runtime.Stack) :
+ (.inl (.ok (refinement.encodeCell (.NT (A.startNt init)) ((value : semR _) ⟨0⟩))))
+ | same (input : List (Positioned SG.Tok)) (stack : Runtime.Stack) :
StepRel refinement init input (.Progress stack (listStream refinement input))
(.inr (eraseStack refinement stack, input.map refinement.decode))
- | shift (input : List G.Token) (stack : Runtime.Stack) :
+ | shift (input : List (Positioned SG.Tok)) (stack : Runtime.Stack) :
StepRel refinement init input (.Progress stack (listStream refinement (input.drop 1)))
(.inr (eraseStack refinement stack, (input.drop 1).map refinement.decode))
- | error (input : List G.Token) (message : String) :
+ | error (input : List (Positioned SG.Tok)) (message : String) :
StepRel refinement init input (.Err message) (.inl (.err message))
-private def liftReduction (refinement : ExecRefinement V) (input : List G.Token) :
- Exec.Result V ⊕ Exec.Stack V → Exec.Result V ⊕ (Exec.Stack V × List (Nat × V))
+private def liftReduction (refinement : ExecRefinement W) (input : List (Positioned SG.Tok)) :
+ Exec.Result (Span × W) ⊕ Exec.Stack (Span × W) →
+ Exec.Result (Span × W) ⊕ (Exec.Stack (Span × W) × List (Nat × (Span × W)))
| .inl result => .inl result
| .inr stack => .inr (stack, input.map refinement.decode)
private theorem reduceStep_preserves_stream (init : A.InitState)
- (stack : Runtime.Stack) (production : G.Production) (stream : NatStream G.Token) :
+ (stack : Runtime.Stack) (production : SG.Production) (stream : NatStream (Positioned SG.Tok)) :
match Runtime.reduceStep init stack production stream with
| .Progress _ next => next = stream
| .Accept _ next => next = stream
| _ => True := by
unfold Runtime.reduceStep
- cases hpop : Runtime.pop (G.prodRhsRev production) stack (G.prodAction production) with
+ cases hpop : Runtime.pop (SG.prodRhsRev production) stack (Grammar.prodAction production) with
| none => simp
| some popped =>
obtain ⟨rest, value⟩ := popped
simp only
- cases hgoto : A.gotoTable (stateOfStack init rest) (G.prodLhs production) with
+ cases hgoto : A.gotoTable (stateOfStack init rest) (SG.prodLhs production) with
| some target => simp only
| none =>
simp only
cases rest with
| nil =>
- by_cases start : G.prodLhs production = A.startNt init
+ by_cases start : SG.prodLhs production = A.startNt init
· simp [start]
· simp [start]
| cons _ _ => simp only
-private theorem reduction_related (refinement : ExecRefinement V)
- (init : A.InitState) (stack : Runtime.Stack) (input : List G.Token)
- (production : G.Production) (invariant : StackInvariant init stack)
+private theorem reduction_related (refinement : ExecRefinement W)
+ (init : A.InitState) (stack : Runtime.Stack) (input : List (Positioned SG.Tok))
+ (production : SG.Production) (invariant : StackInvariant init stack)
(valid : ValidForReduce (stateOfStack init stack) production) :
StepRel refinement init input
(Runtime.reduceStep init stack production (listStream refinement input))
@@ -313,20 +415,20 @@ private theorem reduction_related (refinement : ExecRefinement V)
simp only [eraseReductionResult, liftReduction]
exact .error input message
-private theorem listStream_head (refinement : ExecRefinement V) (input : List G.Token) :
+private theorem listStream_head (refinement : ExecRefinement W) (input : List (Positioned SG.Tok)) :
TokenStream.head (listStream refinement input) = input.getD 0 refinement.eof := by
rfl
-private theorem listStream_tail (refinement : ExecRefinement V) (input : List G.Token) :
+private theorem listStream_tail (refinement : ExecRefinement W) (input : List (Positioned SG.Tok)) :
TokenStream.tail (listStream refinement input) = listStream refinement (input.drop 1) := by
funext index
cases input <;> rfl
-private theorem decoded_head (refinement : ExecRefinement V) (input : List G.Token) :
+private theorem decoded_head (refinement : ExecRefinement W) (input : List (Positioned SG.Tok)) :
(input.map refinement.decode).getD 0 refinement.table.eof =
- (refinement.terminalIndex (G.tokenTerm (input.getD 0 refinement.eof)),
- refinement.encodeValue (.T (G.tokenTerm (input.getD 0 refinement.eof)))
- (G.tokenSem (input.getD 0 refinement.eof))) := by
+ (refinement.terminalIndex (Grammar.tokenTerm (input.getD 0 refinement.eof)),
+ refinement.encodeCell (.T (Grammar.tokenTerm (input.getD 0 refinement.eof)))
+ ((Grammar.tokenSem (input.getD 0 refinement.eof) : semR _) ⟨0⟩)) := by
cases input with
| nil =>
rw [refinement.eof_agrees]
@@ -334,13 +436,13 @@ private theorem decoded_head (refinement : ExecRefinement V) (input : List G.Tok
exact refinement.decode_agrees refinement.eof
| cons token rest => exact refinement.decode_agrees token
-private theorem decoded_tail (refinement : ExecRefinement V) (input : List G.Token) :
+private theorem decoded_tail (refinement : ExecRefinement W) (input : List (Positioned SG.Tok)) :
(input.map refinement.decode).drop 1 = (input.drop 1).map refinement.decode := by
cases input <;> rfl
/-- One executable parser step simulates the dependent step on an EOF-padded finite list. -/
-theorem step_refines (refinement : ExecRefinement V) (hSafe : Safe) (init : A.InitState)
- (stack : Runtime.Stack) (input : List G.Token) (invariant : StackInvariant init stack) :
+theorem step_refines (refinement : ExecRefinement W) (hSafe : Safe) (init : A.InitState)
+ (stack : Runtime.Stack) (input : List (Positioned SG.Tok)) (invariant : StackInvariant init stack) :
StepRel refinement init input
(Runtime.step init stack (listStream refinement input))
(Exec.step refinement.table (eraseStack refinement stack) (input.map refinement.decode)) := by
@@ -373,11 +475,12 @@ theorem step_refines (refinement : ExecRefinement V) (hSafe : Safe) (init : A.In
have defaultEq := refinement.default_agrees current
rw [actionEq] at defaultEq
let token := input.getD 0 refinement.eof
- have executableAction := refinement.lookahead_agrees current actions actionEq (G.tokenTerm token)
+ have executableAction := refinement.lookahead_agrees current actions actionEq (Grammar.tokenTerm token)
have headEq := decoded_head refinement input
- cases lookEq : actions (G.tokenTerm token) with
+ cases lookEq : actions (Grammar.tokenTerm token) with
| Shift target equality =>
- have encoded := encode_cast refinement equality (G.tokenSem token)
+ have encoded := encode_cast refinement equality (Grammar.tokenSem token)
+ (Exec.stackEnd (eraseStack refinement stack))
unfold Runtime.step Exec.step
rw [show stateOfStack init stack = current from rfl, actionEq,
listStream_head, top]
@@ -386,14 +489,14 @@ theorem step_refines (refinement : ExecRefinement V) (hSafe : Safe) (init : A.In
rw [lookEq]
rw [listStream_tail, decoded_tail]
have related := StepRel.shift (refinement := refinement) (init := init) input
- (⟨target, castSem equality (G.tokenSem token)⟩ :: stack)
+ (⟨target, castSem equality (Grammar.tokenSem token)⟩ :: stack)
simp only [eraseStack] at related
rw [encoded] at related
exact related
| Reduce production =>
have valid := hSafe.2.2.2.2 current
rw [actionEq] at valid
- have validProduction := valid (G.tokenTerm token)
+ have validProduction := valid (Grammar.tokenTerm token)
rw [lookEq] at validProduction
unfold Runtime.step Exec.step
rw [show stateOfStack init stack = current from rfl, actionEq,
@@ -425,23 +528,23 @@ theorem step_refines (refinement : ExecRefinement V) (hSafe : Safe) (init : A.In
exact .fail input current token
/-- Relation used after iteration has consumed an unknown finite prefix. -/
-inductive FixRel (refinement : ExecRefinement V) (init : A.InitState) :
- StepResult (NatStream G.Token) init →
- Exec.Result V ⊕ (Exec.Stack V × List (Nat × V)) → Prop
- | fail (state : AState) (token : G.Token) :
+inductive FixRel (refinement : ExecRefinement W) (init : A.InitState) :
+ StepResult (NatStream (Positioned SG.Tok)) init →
+ Exec.Result (Span × W) ⊕ (Exec.Stack (Span × W) × List (Nat × (Span × W))) → Prop
+ | fail (state : AState) (token : Positioned SG.Tok) :
FixRel refinement init (.Fail state token)
- (.inl (.reject (refinement.stateIndex state) (refinement.terminalIndex (G.tokenTerm token))))
- | accept (value : G.semT (.NT (A.startNt init))) (stream : NatStream G.Token) :
+ (.inl (.reject (refinement.stateIndex state) (refinement.terminalIndex (SG.tokenTerm token.val))))
+ | accept (value : semR (.NT (A.startNt init))) (stream : NatStream (Positioned SG.Tok)) :
FixRel refinement init (.Accept value stream)
- (.inl (.ok (refinement.encodeValue (.NT (A.startNt init)) value)))
- | progress (input : List G.Token) (stack : Runtime.Stack) :
+ (.inl (.ok (refinement.encodeCell (.NT (A.startNt init)) ((value : semR _) ⟨0⟩))))
+ | progress (input : List (Positioned SG.Tok)) (stack : Runtime.Stack) :
FixRel refinement init (.Progress stack (listStream refinement input))
(.inr (eraseStack refinement stack, input.map refinement.decode))
| error (message : String) :
FixRel refinement init (.Err message) (.inl (.err message))
-private theorem fixRel_of_stepRel (refinement : ExecRefinement V) (init : A.InitState)
- {input : List G.Token} {dependent executable}
+private theorem fixRel_of_stepRel (refinement : ExecRefinement W) (init : A.InitState)
+ {input : List (Positioned SG.Tok)} {dependent executable}
(related : StepRel refinement init input dependent executable) :
FixRel refinement init dependent executable := by
cases related with
@@ -452,8 +555,8 @@ private theorem fixRel_of_stepRel (refinement : ExecRefinement V) (init : A.Init
| error message => exact .error message
/-- Matching logarithmic fuel preserves the parser configuration relation. -/
-theorem parseFix_refines (refinement : ExecRefinement V) (hSafe : Safe) (init : A.InitState) :
- ∀ (logN : Nat) (stack : Runtime.Stack) (input : List G.Token),
+theorem parseFix_refines (refinement : ExecRefinement W) (hSafe : Safe) (init : A.InitState) :
+ ∀ (logN : Nat) (stack : Runtime.Stack) (input : List (Positioned SG.Tok)),
StackInvariant init stack →
FixRel refinement init
(Runtime.parseFix init stack (listStream refinement input) logN)
@@ -487,21 +590,23 @@ theorem parseFix_refines (refinement : ExecRefinement V) (hSafe : Safe) (init :
simpa only [Runtime.parseFix, Exec.parseFix, hDep, hExec] using
ih next suffix nextInvariant
-/-- Relation between complete dependent and executable parser results. -/
-inductive ResultRel (refinement : ExecRefinement V) (init : A.InitState) :
- ParseResult (NatStream G.Token) init → Exec.Result V → Prop
- | fail (state : AState) (token : G.Token) :
+/-- Relation between complete dependent and executable parser results. An accepted
+ derived value `value` corresponds to the executable cell `value ⟨0⟩`: the span and
+ value of the start symbol at the start of the input. -/
+inductive ResultRel (refinement : ExecRefinement W) (init : A.InitState) :
+ ParseResult (NatStream (Positioned SG.Tok)) init → Exec.Result (Span × W) → Prop
+ | fail (state : AState) (token : Positioned SG.Tok) :
ResultRel refinement init (.Fail state token)
- (.reject (refinement.stateIndex state) (refinement.terminalIndex (G.tokenTerm token)))
- | parsed (value : G.semT (.NT (A.startNt init))) (stream : NatStream G.Token) :
+ (.reject (refinement.stateIndex state) (refinement.terminalIndex (SG.tokenTerm token.val)))
+ | parsed (value : semR (.NT (A.startNt init))) (stream : NatStream (Positioned SG.Tok)) :
ResultRel refinement init (.Parsed value stream)
- (.ok (refinement.encodeValue (.NT (A.startNt init)) value))
+ (.ok (refinement.encodeCell (.NT (A.startNt init)) ((value : semR _) ⟨0⟩)))
| timeout : ResultRel refinement init .Timeout .timeout
| error (message : String) : ResultRel refinement init (.Err message) (.err message)
/-- The executable runner refines the dependent parser at the same logarithmic fuel. -/
-theorem run_refines (refinement : ExecRefinement V) (hSafe : Safe) (init : A.InitState)
- (input : List G.Token) (logN : Nat) :
+theorem run_refines (refinement : ExecRefinement W) (hSafe : Safe) (init : A.InitState)
+ (input : List (Positioned SG.Tok)) (logN : Nat) :
ResultRel refinement init
(Runtime.parse init (listStream refinement input) logN)
(Exec.run refinement.table (input.map refinement.decode) logN) := by
diff --git a/LeanParserGenerator/Runtime/Span.lean b/LeanParserGenerator/Runtime/Span.lean
index 0e1552c..5e29e5a 100644
--- a/LeanParserGenerator/Runtime/Span.lean
+++ b/LeanParserGenerator/Runtime/Span.lean
@@ -57,6 +57,30 @@ structure Span where
current input point (Menhir's "between the previous and next tokens"). -/
@[reducible] def Span.point (p : String.Pos.Raw) : Span := ⟨p, p⟩
+/-- The end of the last span of `l`, or `pe` when `l` is empty. -/
+def Span.listEnd (pe : String.Pos.Raw) : List Span → String.Pos.Raw
+ | [] => pe
+ | s :: rest => Span.listEnd s.endPos rest
+
+/-- The span of a node from the spans of its right-hand-side symbols, in source order.
+ This is the convention of the Rust backend: an empty right-hand side gives the empty
+ span `(pe, pe)` at `pe`, the end of the last token shifted before the reduction (byte 0
+ when no token was shifted); otherwise the span runs from the start of the first symbol
+ to the end of the last. -/
+def Span.fold (pe : String.Pos.Raw) : List Span → Span
+ | [] => ⟨pe, pe⟩
+ | s :: rest => ⟨s.startPos, Span.listEnd s.endPos rest⟩
+
+theorem Span.listEnd_append (pe : String.Pos.Raw) (a b : List Span) :
+ Span.listEnd pe (a ++ b) = Span.listEnd (Span.listEnd pe a) b := by
+ induction a generalizing pe with
+ | nil => rfl
+ | cons s rest ih => exact ih s.endPos
+
+theorem Span.fold_endPos (pe : String.Pos.Raw) (l : List Span) :
+ (Span.fold pe l).endPos = Span.listEnd pe l := by
+ cases l <;> rfl
+
/-- A value paired with its source span. The generated lexer emits
`List (Positioned Tok)`; a caller that does not need positions drops them with
`·.val`. -/
@@ -70,6 +94,20 @@ structure Positioned (α : Type) where
/-- Wrap a value with the dummy span, for a caller with no real positions. -/
@[reducible] def Positioned.dummy (x : α) : Positioned α := Positioned.mk x Span.dummy
+/-- The end of the last token of `w`, or `pe` when `w` is empty. -/
+def Positioned.wordEnd (pe : String.Pos.Raw) (w : List (Positioned α)) : String.Pos.Raw :=
+ Span.listEnd pe (w.map (·.span))
+
+theorem Positioned.wordEnd_append (pe : String.Pos.Raw) (a b : List (Positioned α)) :
+ Positioned.wordEnd pe (a ++ b) = Positioned.wordEnd (Positioned.wordEnd pe a) b := by
+ simp only [Positioned.wordEnd, List.map_append, Span.listEnd_append]
+
+@[simp] theorem Positioned.wordEnd_nil (pe : String.Pos.Raw) :
+ Positioned.wordEnd pe ([] : List (Positioned α)) = pe := rfl
+
+@[simp] theorem Positioned.wordEnd_singleton (pe : String.Pos.Raw) (t : Positioned α) :
+ Positioned.wordEnd pe [t] = t.span.endPos := rfl
+
/-- Convert a byte offset into a 1-based `(line, column)` in `source`, counting
characters. Offsets past the end clamp to the final position. Unverified;
used only for human-readable error rendering. -/
diff --git a/LeanParserGenerator/Runtime/SpanGrammar.lean b/LeanParserGenerator/Runtime/SpanGrammar.lean
new file mode 100644
index 0000000..685f4b1
--- /dev/null
+++ b/LeanParserGenerator/Runtime/SpanGrammar.lean
@@ -0,0 +1,527 @@
+/-
+ Copyright Cedar Contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-/
+
+module
+/-
+Grammars whose semantic actions receive the source spans of their right-hand-side
+symbols (docs/DESIGN.md §6.2).
+
+A `SpanGrammar` is a `Grammar` whose tokens are positioned (`Positioned Tok`) and whose
+production actions take, before the curried semantic values, the list of the spans of
+the right-hand-side symbols in source order. The semantic types (`semT`) carry no span.
+
+Spans live in the parse tree and in the interpreter:
+
+ * a leaf is a positioned token, so it carries its span;
+ * the span of a node is `Span.fold pe (spans of its children)` (`ptSpan`), where `pe`
+ is the end of the token before the node (`Positioned.wordEnd` of the preceding
+ word, byte 0 at the start of the input). For an empty right-hand side this is the
+ empty span `(pe, pe)`, the convention of the Rust backend;
+ * `ptSem pe tree` passes each production action the spans of the children.
+
+The verified interpreter (`Runtime.Interpreter`) and its theorems (`parseCorrect`,
+`parseComplete`, `unambiguity`) are stated for a `Grammar`. A `SpanGrammar` is run on the
+derived grammar `toGrammar`, whose semantic value for a symbol `s` is a function
+`semR s = Pos → Span × semT s`: given the end `pe` of the token before the symbol, it
+returns the symbol's span and value. The function is what an `ε` subtree needs, since its
+span is the point `pe`, which its own word does not determine. `ptSem_toGrammar` proves
+that the derived semantics is `fun pe => (ptSpan pe t, ptSem pe t)`, so the generic
+theorems transfer without being proved again (`parseCorrect`, `parseComplete`,
+`unambiguity` below).
+-/
+public import LeanParserGenerator.Runtime.Grammar
+public import LeanParserGenerator.Runtime.Span
+public import LeanParserGenerator.Runtime.Correct
+public import LeanParserGenerator.Runtime.Complete
+
+
+@[expose] public section
+
+namespace Runtime
+
+/-- A grammar whose actions receive the spans of their right-hand-side symbols and whose
+ tokens are positioned. `prodAction p spans` is curried over the reversed right-hand
+ side, like `Grammar.prodAction`; `spans` lists the spans of the right-hand-side
+ symbols in source order (an action reads the span of symbol `i` as
+ `spans.getD i Span.dummy`). -/
+class SpanGrammar extends GrammarSig where
+ /-- The semantic-value type of each symbol. It carries no span. -/
+ semT : Symbol Terminal NonTerminal → Type
+ /-- The semantic action of a production, given the spans of its right-hand side in
+ source order. -/
+ prodAction : (p : Production) → List Span →
+ arrowsRight (semT (.NT (prodLhs p))) ((prodRhsRev p).map semT)
+ /-- The token type, without positions. The parse tree's tokens are `Positioned Tok`. -/
+ Tok : Type
+ tokenTerm : Tok → Terminal
+ tokenSem : (tok : Tok) → semT (.T (tokenTerm tok))
+
+namespace SpanGrammar
+
+variable [SG : SpanGrammar]
+
+/-- Byte offsets into the input. -/
+abbrev Pos := String.Pos.Raw
+
+/-- The symbol type of the ambient span grammar. -/
+abbrev Sym := GrammarSig.Sym (G := SG.toGrammarSig)
+
+/-- The semantic value of a symbol in the derived grammar: given the end of the token
+ before the symbol, its span and its value. -/
+def semR (s : Sym) : Type := Pos → Span × SG.semT s
+
+/-- A heterogeneous list of derived values, indexed by symbols (top of stack first, as
+ the right-hand side is stored reversed). -/
+inductive RVals : List Sym → Type
+ | nil : RVals []
+ | cons {s : Sym} {ss : List Sym} (x : semR s) (rest : RVals ss) : RVals (s :: ss)
+
+/-- Build a curried function over `syms` from a function of the whole value list. -/
+def collect {B : Type} : (syms : List Sym) → (RVals syms → B) → arrowsRight B (syms.map semR)
+ | [], k => k .nil
+ | _ :: ss, k => fun x => collect ss (fun r => k (.cons x r))
+
+namespace RVals
+
+/-- The end of the last symbol of a value list evaluated from `pe` (`pe` itself when the
+ list is empty). The list is reversed, so the earlier symbols are in `rest`. -/
+def endPos : {syms : List Sym} → RVals syms → Pos → Pos
+ | _, .nil, pe => pe
+ | _, .cons x rest, pe => (x (rest.endPos pe)).1.endPos
+
+/-- The spans of a value list evaluated from `pe`, in source order. -/
+def spans : {syms : List Sym} → RVals syms → Pos → List Span
+ | _, .nil, _ => []
+ | _, .cons x rest, pe => rest.spans pe ++ [(x (rest.endPos pe)).1]
+
+/-- Feed the values of a value list evaluated from `pe` to a curried action. -/
+def apply {A : Type} : {syms : List Sym} → RVals syms → Pos →
+ arrowsRight A (syms.map SG.semT) → A
+ | _, .nil, _, act => act
+ | s :: _, .cons x rest, pe, act =>
+ have act' : SG.semT s → arrowsRight A _ := act
+ rest.apply pe (act' (x (rest.endPos pe)).2)
+
+end RVals
+
+/-- A heterogeneous list of span-free semantic values indexed by symbols (top first). -/
+inductive Values : List Sym → Type
+ | nil : Values []
+ | cons {symbol : Sym} {symbols : List Sym}
+ (value : SG.semT symbol) (rest : Values symbols) : Values (symbol :: symbols)
+
+/-- Apply a curried action to a heterogeneous value list. -/
+def Values.apply {Result : Type} : {symbols : List Sym} →
+ Values symbols → arrowsRight Result (symbols.map SG.semT) → Result
+ | [], .nil, action => action
+ | s :: _, .cons value rest, action =>
+ have action' : SG.semT s → arrowsRight Result _ := action
+ rest.apply (action' value)
+
+namespace RVals
+
+/-- The span-free values of a derived value list evaluated from `pe`, top first. -/
+def eval : {syms : List Sym} → RVals syms → Pos → Values syms
+ | _, .nil, _ => .nil
+ | _, .cons x rest, pe => .cons (x (rest.endPos pe)).2 (eval rest pe)
+
+/-- Evaluate a derived value list from `pe` in one pass, applying each value once: the end
+ position, the spans in source order, and the values. -/
+def run : {syms : List Sym} → RVals syms → Pos → Pos × List Span × Values syms
+ | _, .nil, pe => (pe, [], .nil)
+ | _, .cons x rest, pe =>
+ match rest.run pe with
+ | (e, sps, vs) =>
+ match x e with
+ | (sp, v) => (sp.endPos, sps ++ [sp], .cons v vs)
+
+theorem run_eq : {syms : List Sym} → (r : RVals syms) → (pe : Pos) →
+ r.run pe = (r.endPos pe, r.spans pe, r.eval pe)
+ | _, .nil, _ => rfl
+ | _, .cons x rest, pe => by
+ simp only [run, run_eq rest pe, endPos, spans, eval]
+
+theorem apply_eval {Result : Type} : {syms : List Sym} →
+ (r : RVals syms) → (pe : Pos) → (act : arrowsRight Result (syms.map SG.semT)) →
+ r.apply pe act = (r.eval pe).apply act
+ | _, .nil, _, _ => rfl
+ | _ :: _, .cons _ rest, pe, _ => apply_eval rest pe _
+
+end RVals
+
+/-- The derived action of a production: evaluate the children left to right, each from
+ the end of the previous one, and return the folded span and the action's value. Each
+ child is evaluated once (`RVals.run`). -/
+def readerAction (p : SG.Production) :
+ arrowsRight (semR (.NT (SG.prodLhs p))) ((SG.prodRhsRev p).map semR) :=
+ collect _ fun r pe =>
+ match r.run pe with
+ | (_, sp, vs) => (Span.fold pe sp, vs.apply (SG.prodAction p sp))
+
+/-- The derived `Grammar` the verified interpreter runs on: positioned tokens, and
+ semantic values `semR s`. -/
+@[reducible] def toGrammar : Grammar := { SG.toGrammarSig with
+ semT := semR
+ prodAction := readerAction
+ Token := Positioned SG.Tok
+ tokenTerm := fun t => SG.tokenTerm t.val
+ tokenSem := fun t _ => (t.span, SG.tokenSem t.val) }
+
+attribute [local instance] toGrammar
+
+/-- Parse trees of a span grammar: the parse trees of `toGrammar`, whose leaves are
+ positioned tokens. -/
+abbrev ParseTree := Grammar.ParseTree (G := SG.toGrammar)
+abbrev ParseTreeList := Grammar.ParseTreeList (G := SG.toGrammar)
+
+/-- The end of the last token of `w`, or `pe` when `w` is empty. -/
+abbrev wordEnd (pe : Pos) (w : List (Positioned SG.Tok)) : Pos := Positioned.wordEnd pe w
+
+mutual
+/-- The span of a parse tree whose preceding token ends at `pe`: a leaf's token span, or
+ `Span.fold pe` of the children's spans. -/
+def ptSpan (pe : Pos) : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTree head word → Span
+ | _, _, .terminal tok => tok.span
+ | _, _, .nonTerminal _ ptl => Span.fold pe (ptlSpans pe ptl)
+
+/-- The spans of a parse-tree list, in source order. Each child starts after the end of
+ the word before it. -/
+def ptlSpans (pe : Pos) : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTreeList heads word → List Span
+ | _, _, .nil => []
+ | _, _, .cons (wordQ := wq) q t => ptlSpans pe q ++ [ptSpan (wordEnd pe wq) t]
+end
+
+mutual
+/-- The semantic value of a parse tree whose preceding token ends at `pe`. Each action
+ receives the spans of its children (`ptlSpans`). -/
+def ptSem (pe : Pos) : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTree head word → SG.semT head
+ | _, _, .terminal tok => SG.tokenSem tok.val
+ | _, _, .nonTerminal p ptl => ptlSem pe ptl (SG.prodAction p (ptlSpans pe ptl))
+
+/-- Fold a parse-tree list through a curried action. -/
+def ptlSem (pe : Pos) : {A : Type} → {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTreeList heads word → arrowsRight A (heads.map SG.semT) → A
+ | _, _, _, .nil, act => act
+ | A, _ :: _, _, .cons (headSymT := hT) (wordQ := wq) q t, act =>
+ have act' : SG.semT hT → arrowsRight A _ := act
+ ptlSem pe q (act' (ptSem (wordEnd pe wq) t))
+end
+
+@[simp] theorem ptSpan_terminal (pe : Pos) (tok : Positioned SG.Tok) :
+ ptSpan pe (Grammar.ParseTree.terminal (G := SG.toGrammar) tok) = tok.span := by
+ rw [ptSpan.eq_def]
+
+@[simp] theorem ptSpan_nonTerminal (pe : Pos) (p : SG.Production)
+ {word : List (Positioned SG.Tok)} (ptl : ParseTreeList (SG.prodRhsRev p) word) :
+ ptSpan pe (Grammar.ParseTree.nonTerminal (G := SG.toGrammar) p ptl) =
+ Span.fold pe (ptlSpans pe ptl) := by
+ rw [ptSpan.eq_def]
+
+@[simp] theorem ptlSpans_nil (pe : Pos) :
+ ptlSpans pe (Grammar.ParseTreeList.nil (G := SG.toGrammar)) = [] := by
+ rw [ptlSpans.eq_def]
+
+@[simp] theorem ptlSpans_cons (pe : Pos) {headSymsQ : List Sym}
+ {wordQ : List (Positioned SG.Tok)} (q : ParseTreeList headSymsQ wordQ)
+ {headSymT : Sym} {wordT : List (Positioned SG.Tok)} (t : ParseTree headSymT wordT) :
+ ptlSpans pe (Grammar.ParseTreeList.cons (G := SG.toGrammar) q t) =
+ ptlSpans pe q ++ [ptSpan (wordEnd pe wordQ) t] := by
+ rw [ptlSpans.eq_def]
+
+@[simp] theorem ptSem_terminal (pe : Pos) (tok : Positioned SG.Tok) :
+ ptSem pe (Grammar.ParseTree.terminal (G := SG.toGrammar) tok) = SG.tokenSem tok.val := by
+ rw [ptSem.eq_def]
+
+@[simp] theorem ptSem_nonTerminal (pe : Pos) (p : SG.Production)
+ {word : List (Positioned SG.Tok)} (ptl : ParseTreeList (SG.prodRhsRev p) word) :
+ ptSem pe (Grammar.ParseTree.nonTerminal (G := SG.toGrammar) p ptl) =
+ ptlSem pe ptl (SG.prodAction p (ptlSpans pe ptl)) := by
+ rw [ptSem.eq_def]
+
+@[simp] theorem ptlSem_nil (pe : Pos) {A : Type} (act : arrowsRight A ([].map SG.semT)) :
+ ptlSem pe (Grammar.ParseTreeList.nil (G := SG.toGrammar)) act = act := by
+ rw [ptlSem.eq_def]
+
+@[simp] theorem ptlSem_cons (pe : Pos) {A : Type} {headSymsQ : List Sym}
+ {wordQ : List (Positioned SG.Tok)} (q : ParseTreeList headSymsQ wordQ)
+ {headSymT : Sym} {wordT : List (Positioned SG.Tok)} (t : ParseTree headSymT wordT)
+ (act : arrowsRight A ((headSymT :: headSymsQ).map SG.semT)) :
+ ptlSem pe (Grammar.ParseTreeList.cons (G := SG.toGrammar) q t) act =
+ ptlSem pe q (act (ptSem (wordEnd pe wordQ) t)) := by
+ rw [ptlSem.eq_def]
+
+/-- Cast a parse tree along an equality of words. -/
+def castWord {head : Sym} {w w' : List (Positioned SG.Tok)} (h : w = w') (t : ParseTree head w) :
+ ParseTree head w' := h ▸ t
+
+@[simp] theorem ptSem_castWord (pe : Pos) {head : Sym} {w w' : List (Positioned SG.Tok)}
+ (h : w = w') (t : ParseTree head w) : ptSem pe (castWord h t) = ptSem pe t := by
+ subst h; rfl
+
+@[simp] theorem ptSpan_castWord (pe : Pos) {head : Sym} {w w' : List (Positioned SG.Tok)}
+ (h : w = w') (t : ParseTree head w) : ptSpan pe (castWord h t) = ptSpan pe t := by
+ subst h; rfl
+
+/-! ### Node spans -/
+
+mutual
+/-- **A node's span ends where its word ends**: at the end of its last token, or at `pe`
+ when its word is empty. -/
+theorem ptSpan_endPos (pe : Pos) : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ (t : ParseTree head word) → (ptSpan pe t).endPos = wordEnd pe word
+ | _, _, .terminal tok => rfl
+ | _, _, .nonTerminal _ ptl => by
+ rw [ptSpan_nonTerminal, Span.fold_endPos]
+ exact ptlSpans_listEnd pe ptl
+
+theorem ptlSpans_listEnd (pe : Pos) : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ (ptl : ParseTreeList heads word) → Span.listEnd pe (ptlSpans pe ptl) = wordEnd pe word
+ | _, _, .nil => rfl
+ | _, _, .cons (wordQ := wq) (wordT := wt) q t => by
+ rw [ptlSpans_cons, Span.listEnd_append, ptlSpans_listEnd pe q]
+ show (ptSpan (wordEnd pe wq) t).endPos = wordEnd pe (wq ++ wt)
+ rw [ptSpan_endPos (wordEnd pe wq) t]
+ exact (Positioned.wordEnd_append pe wq wt).symm
+end
+
+mutual
+/-- **A node's span starts at its first token or at `pe`.** When its word is empty the
+ span starts at `pe`. Otherwise it starts at the start of the first token of its word,
+ or, when the leftmost children of the node derive the empty word, at `pe`. -/
+theorem ptSpan_startPos (pe : Pos) : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ (t : ParseTree head word) →
+ (ptSpan pe t).startPos = pe ∨ (∃ tok rest, word = tok :: rest ∧ (ptSpan pe t).startPos = tok.span.startPos)
+ | _, _, .terminal tok => .inr ⟨tok, [], rfl, rfl⟩
+ | _, _, .nonTerminal _ ptl => by
+ rw [ptSpan_nonTerminal]
+ exact ptlSpans_head pe ptl
+
+theorem ptlSpans_head (pe : Pos) : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ (ptl : ParseTreeList heads word) →
+ (Span.fold pe (ptlSpans pe ptl)).startPos = pe ∨
+ (∃ tok rest, word = tok :: rest ∧ (Span.fold pe (ptlSpans pe ptl)).startPos = tok.span.startPos)
+ | _, _, .nil => .inl rfl
+ | _, _, .cons (wordQ := wq) (wordT := wt) q t => by
+ rw [ptlSpans_cons]
+ cases hq : ptlSpans pe q with
+ | cons s rest =>
+ have ih := ptlSpans_head pe q
+ rw [hq] at ih
+ rcases ih with h | ⟨tok, r, hw, h⟩
+ · exact .inl h
+ · exact .inr ⟨tok, r ++ wt, by rw [hw]; rfl, h⟩
+ | nil =>
+ -- The earlier children have no span, so `q` is `nil`.
+ cases q with
+ | nil =>
+ have ht := ptSpan_startPos pe t
+ rcases ht with h | ⟨tok, r, hw, h⟩
+ · exact .inl h
+ · exact .inr ⟨tok, r, by rw [hw]; rfl, h⟩
+ | cons q' t' => simp at hq
+end
+
+/-- A tree with an empty word has the empty span at `pe`. -/
+theorem ptSpan_of_nil (pe : Pos) {head : Sym} (t : ParseTree head []) :
+ ptSpan pe t = ⟨pe, pe⟩ := by
+ have he := ptSpan_endPos pe t
+ have hs := ptSpan_startPos pe t
+ rcases hs with hs | ⟨_, _, hw, _⟩
+ · cases h : ptSpan pe t
+ rw [h] at he hs
+ simp only at he hs
+ rw [he, hs]
+ rfl
+ · cases hw
+
+/-- The span facts of one node whose preceding token ends at `pe`: its span ends at the end
+ of its word (at `pe` when the word is empty), and starts at `pe` or at the start of the
+ first token of its word. -/
+def SpanFacts (pe : Pos) (word : List (Positioned SG.Tok)) (sp : Span) : Prop :=
+ sp.endPos = wordEnd pe word ∧
+ (sp.startPos = pe ∨ ∃ tok rest, word = tok :: rest ∧ sp.startPos = tok.span.startPos)
+
+mutual
+/-- Every node of a tree satisfies `SpanFacts`, each at the end of the word before it. -/
+def AllSpanFacts (pe : Pos) : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTree head word → Prop
+ | _, _, .terminal tok => SpanFacts pe [tok] tok.span
+ | _, _, .nonTerminal (word := w) _ ptl =>
+ SpanFacts pe w (Span.fold pe (ptlSpans pe ptl)) ∧ AllSpanFactsL pe ptl
+
+/-- Every node of a parse-tree list satisfies `SpanFacts`. -/
+def AllSpanFactsL (pe : Pos) : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTreeList heads word → Prop
+ | _, _, .nil => True
+ | _, _, .cons (wordQ := wq) q t => AllSpanFactsL pe q ∧ AllSpanFacts (wordEnd pe wq) t
+end
+
+mutual
+/-- **Every node's span is the span of its word.** In every tree, each node's span ends at
+ the end of its last token (at the end `pe` of the token before it, when its word is
+ empty), and starts at the start of its first token, or at `pe` when its word is empty or
+ its leftmost children derive the empty word (the Rust convention). -/
+theorem allSpanFacts (pe : Pos) : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ (t : ParseTree head word) → AllSpanFacts pe t
+ | _, _, .terminal tok => by
+ rw [AllSpanFacts.eq_def]
+ exact ⟨rfl, .inr ⟨tok, [], rfl, rfl⟩⟩
+ | _, _, .nonTerminal p ptl => by
+ rw [AllSpanFacts.eq_def]
+ refine ⟨⟨?_, ?_⟩, allSpanFactsL pe ptl⟩
+ · have := ptSpan_endPos pe (Grammar.ParseTree.nonTerminal (G := SG.toGrammar) p ptl)
+ rw [ptSpan_nonTerminal] at this
+ exact this
+ · have := ptSpan_startPos pe (Grammar.ParseTree.nonTerminal (G := SG.toGrammar) p ptl)
+ rw [ptSpan_nonTerminal] at this
+ exact this
+
+theorem allSpanFactsL (pe : Pos) : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ (ptl : ParseTreeList heads word) → AllSpanFactsL pe ptl
+ | _, _, .nil => by rw [AllSpanFactsL.eq_def]; trivial
+ | _, _, .cons (wordQ := wq) q t => by
+ rw [AllSpanFactsL.eq_def]
+ exact ⟨allSpanFactsL pe q, allSpanFacts (wordEnd pe wq) t⟩
+end
+
+/-! ### The derived semantics -/
+
+/-- The derived values of the children of a parse-tree list. -/
+def ptlRVals : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ ParseTreeList heads word → RVals heads
+ | _, _, .nil => .nil
+ | _, _, .cons q t => .cons (Grammar.ptSem (G := SG.toGrammar) t) (ptlRVals q)
+
+theorem ptlSem_collect {B : Type} : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ (ptl : ParseTreeList heads word) → (k : RVals heads → B) →
+ Grammar.ptlSem (G := SG.toGrammar) ptl (collect heads k) = k (ptlRVals ptl)
+ | _, _, .nil, k => by rw [Grammar.ptlSem.eq_def]; rfl
+ | _ :: _, _, .cons q t, k => by
+ rw [Grammar.ptlSem.eq_def]
+ exact ptlSem_collect q (fun r => k (.cons (Grammar.ptSem (G := SG.toGrammar) t) r))
+
+mutual
+/-- **The derived semantics of a tree** is its span and its value: the verified
+ interpreter run on `toGrammar` computes `ptSpan` and `ptSem`. -/
+theorem ptSem_toGrammar : {head : Sym} → {word : List (Positioned SG.Tok)} →
+ (t : ParseTree head word) →
+ Grammar.ptSem (G := SG.toGrammar) t = fun pe => (ptSpan pe t, ptSem pe t)
+ | _, _, .terminal tok => by
+ funext pe
+ rw [Grammar.ptSem.eq_def]
+ simp only [ptSpan_terminal, ptSem_terminal]
+ rfl
+ | _, _, .nonTerminal p ptl => by
+ funext pe
+ rw [Grammar.ptSem.eq_def]
+ simp only
+ show Grammar.ptlSem (G := SG.toGrammar) ptl (readerAction p) pe = _
+ unfold readerAction
+ refine (congrFun (ptlSem_collect ptl _) pe).trans ?_
+ obtain ⟨hs, _, ha⟩ := ptlRVals_spec ptl pe
+ simp only [RVals.run_eq, ← RVals.apply_eval, hs, ha, ptSpan_nonTerminal, ptSem_nonTerminal]
+
+theorem ptlRVals_spec : {heads : List Sym} → {word : List (Positioned SG.Tok)} →
+ (ptl : ParseTreeList heads word) → (pe : Pos) →
+ (ptlRVals ptl).spans pe = ptlSpans pe ptl ∧
+ (ptlRVals ptl).endPos pe = wordEnd pe word ∧
+ (∀ {A : Type} (act : arrowsRight A (heads.map SG.semT)),
+ (ptlRVals ptl).apply pe act = ptlSem pe ptl act)
+ | _, _, .nil, pe => ⟨rfl, rfl, fun act => by rw [ptlSem_nil]; rfl⟩
+ | _ :: _, _, .cons (wordQ := wq) (wordT := wt) q t, pe => by
+ obtain ⟨hs, he, ha⟩ := ptlRVals_spec q pe
+ have ht := ptSem_toGrammar t
+ refine ⟨?_, ?_, ?_⟩
+ · show (ptlRVals q).spans pe ++ [(Grammar.ptSem (G := SG.toGrammar) t ((ptlRVals q).endPos pe)).1] = _
+ rw [hs, he, ht, ptlSpans_cons]
+ · show (Grammar.ptSem (G := SG.toGrammar) t ((ptlRVals q).endPos pe)).1.endPos = _
+ rw [he, ht]
+ simp only
+ rw [ptSpan_endPos]
+ exact (Positioned.wordEnd_append pe wq wt).symm
+ · intro A act
+ show (ptlRVals q).apply pe (act (Grammar.ptSem (G := SG.toGrammar) t ((ptlRVals q).endPos pe)).2) = _
+ rw [ha, he, ht, ptlSem_cons]
+end
+
+theorem ptSem_toGrammar_apply {head : Sym} {word : List (Positioned SG.Tok)}
+ (t : ParseTree head word) (pe : Pos) :
+ Grammar.ptSem (G := SG.toGrammar) t pe = (ptSpan pe t, ptSem pe t) := by
+ rw [ptSem_toGrammar]
+
+/-! ### The generic theorems for span grammars -/
+
+variable [A : Automaton (G := SG.toGrammarSig)]
+
+/-- **Soundness.** If the verified interpreter accepts with the derived value `F`, the
+ consumed prefix has a parse tree whose span and value at every `pe` are `F pe`. -/
+theorem parseCorrect {S : Type} [AppStream S (Positioned SG.Tok)] (init : A.InitState)
+ (s : S) (logN : Nat) :
+ match Runtime.parse (G := SG.toGrammar) (S := S) init s logN with
+ | .Parsed sem s' =>
+ ∃ (word : List (Positioned SG.Tok)) (pt : ParseTree (.NT (A.startNt init)) word),
+ s = AppStream.appList word s' ∧ ∀ pe, sem pe = (ptSpan pe pt, ptSem pe pt)
+ | _ => True := by
+ have h := Runtime.parseCorrect (G := SG.toGrammar) (S := S) init s logN
+ revert h
+ cases Runtime.parse (G := SG.toGrammar) (S := S) init s logN with
+ | Parsed sem s' =>
+ intro h
+ obtain ⟨word, pt, hs, hsem⟩ := h
+ refine ⟨word, pt, hs, fun pe => ?_⟩
+ rw [← hsem, ptSem_toGrammar_apply]
+ | _ => intro _; trivial
+
+/-- **Completeness.** A parse tree of the start symbol is accepted with fuel at least its
+ size, and the derived value is its span and value. -/
+theorem parseComplete {S : Type} [AppStream S (Positioned SG.Tok)] (hComplete : Complete)
+ (init : A.InitState) (logN : Nat) {word : List (Positioned SG.Tok)} (bufEnd : S)
+ (tree : ParseTree (.NT (A.startNt init)) word) :
+ match Runtime.parse (G := SG.toGrammar) (S := S) init (AppStream.appList word bufEnd) logN with
+ | .Parsed sem rest =>
+ (∀ pe, sem pe = (ptSpan pe tree, ptSem pe tree)) ∧ rest = bufEnd ∧
+ Grammar.ptSize tree ≤ 2 ^ logN
+ | .Timeout => 2 ^ logN < Grammar.ptSize tree
+ | .Fail _ _ => False
+ | .Err _ => False := by
+ have h := Runtime.parseComplete (G := SG.toGrammar) (S := S) hComplete init logN bufEnd tree
+ revert h
+ cases Runtime.parse (G := SG.toGrammar) (S := S) init (AppStream.appList word bufEnd) logN with
+ | Parsed sem rest =>
+ intro h
+ obtain ⟨hsem, hrest, hsize⟩ := h
+ exact ⟨fun pe => by rw [hsem, ptSem_toGrammar_apply], hrest, hsize⟩
+ | _ => intro h; exact h
+
+/-- **Unambiguity.** Two parse trees of the start symbol over the same word have the
+ same span and value. -/
+theorem unambiguity (hComplete : Complete) [Inhabited SG.Tok] (init : A.InitState)
+ {word : List (Positioned SG.Tok)} (tree1 tree2 : ParseTree (.NT (A.startNt init)) word)
+ (pe : Pos) :
+ ptSpan pe tree1 = ptSpan pe tree2 ∧ ptSem pe tree1 = ptSem pe tree2 := by
+ letI : Inhabited (Positioned SG.Tok) := ⟨Positioned.dummy default⟩
+ have h := Runtime.unambiguity (G := SG.toGrammar) hComplete init tree1 tree2
+ rw [ptSem_toGrammar, ptSem_toGrammar] at h
+ have := congrFun h pe
+ simp only [Prod.mk.injEq] at this
+ exact this
+
+end SpanGrammar
+
+end Runtime
diff --git a/README.md b/README.md
index 4e5fdb6..66cab39 100644
--- a/README.md
+++ b/README.md
@@ -121,7 +121,7 @@ The generator infers the outputs from the input path and writes them next to the
| `%option compress_tables` | none | Write the executable parser's tables in a compact form. The tables hold the same values at runtime and the proofs are unchanged, but the generated source is smaller and compiles faster. See [`docs/DESIGN.md`](docs/DESIGN.md) §10. |
| `%option gen_rust ` takes the list of right-hand-side spans first
+and binds the span variables its action names (`x_span := spans.getD i Span.dummy`);
+`ParserStartTree word` is a tree over a word of positioned tokens. The parser theorems
+are stated on the positioned tokens the executable parser reads:
+
+- `parse_eq_dependent input k : E.parse input k = parse input k` for every
+ `input : List (Positioned Tok)`;
+- `parser_sound`: an accepted input starts with the word of a tree whose value at byte 0,
+ `SpanGrammar.ptSem ⟨0⟩ tree`, is the result;
+- `parser_complete`: a tree over `word` within the fuel is accepted with that value;
+- `parser_unambiguous tree₁ tree₂ pe`: two trees over the same word have the same span
+ and value at every `pe`;
+- `parser_err_free`, `parser_ne_err`.
+
With `%option parseStr`, a `%lexer` block and a paired executable module, the
-specification module also states two hypotheses and the theorems that take them
-(§13, "The stream engines"):
+specification module also relates `parseStr` to `tokenize`, the dependent parser and the
+lexer specification (§13, "The stream engines"). No theorem takes a hypothesis about
+spans or the lexer:
-- `abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees L.cbyte L.tokenize`: the
+- `abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees L.cbyte L.tokenize` and
+ `posLexerAgrees : PosLexerAgrees`, from `L.posLexerAgrees` in the lexer module: the
positioned byte lexer `lexPos` and `tokenize` give the same `toOption` on every input;
-- `abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => E.parse ts k)`:
- `parse` gives the same result when every token span is replaced by `Span.dummy`. When
- no action names a span variable, it is proved: `spanIndependent` (from
- `E.parse_spanIndependent`, §6.2), with the corollary
- `parse_eq_dependent_spans input k : E.parse input k = parse (input.map (·.val)) k` for
- any spans, and the two theorems below do not take `hspan`;
-- `parseStr_eq (hlex) s k ts (h : L.tokenize s = .ok ts) : E.parseStr s k = E.parse ts k`;
-- `parseStr_eq_dependent (hspan) (hlex) …`: `E.parseStr s k = parse (ts.map (·.val)) k`,
- the dependent parser on the token values;
-- `parseStr_sound (hspan) (hlex) …`: an accepted `parseStr` has a parse tree, through
- `parser_sound`;
-- `parseStr_of_tokenize_error (hlex) … (h : L.tokenize s = .error e)`: the pull source
- delivers a prefix `ts` and fails, and `parseStr` is `none` or `parse` of an extension of
- `ts`.
-
-Here `L` is the lexer namespace and `E` the parser namespace. The transfer theorems
-use `parse_eq_dependent` and `parser_sound` and add no axiom.
+- `parseStr_eq s k ts (h : L.tokenize s = .ok ts) : E.parseStr s k = E.parse ts k`;
+- `parseStr_eq_dependent … : E.parseStr s k = parse ts k`, the dependent parser on the
+ positioned tokens;
+- `parseStr_sound …`: an accepted `parseStr` has a parse tree, through `parser_sound`;
+- `parseStr_of_tokenize_error … (h : L.tokenize s = .error e)`: the pull source delivers a
+ prefix `ts` and fails, and `parseStr` is `none` or `parse` of an extension of `ts`;
+- `parseStr_eq_none_of_tokenize_error s k e (h : L.tokenize s = .error e) :
+ E.parseStr s k = none`, and `parseStr_eq_none_of_lexPos` for a failing `lexPos`;
+- `runStream_ne_ok_of_tokenize_error s k e h : ∀ v, E.runStream s k ≠ .ok v`. The result
+ can be `.reject` or `.timeout` as well as `.err`: the parser can stop on a syntax error
+ before it reaches the lex error;
+- `parseStr_sound_tokenize s k p (accepted : E.parseStr s k = some p)`: some `ts` with
+ `L.tokenize s = .ok ts`, and a parse tree over a prefix of `ts` (followed by EOF
+ padding) with value `p`.
+
+For a lexer with one mode whose rules all `stay`:
+
+- `parseStr_sound_tokenization` adds `Lexer.Tokenization L.rules0 s.toList` and
+ `Lexer.tokenize L.lexer s = .ok (ts.map (·.val))`, and `tokenize_parse_sound s k ts p h
+ accepted` is the same for `L.tokenize s = .ok ts` followed by `E.parse ts k = some p`;
+- completeness and unambiguity at the string level, value level (the tokenization is a
+ `Lexer.Lexing` with its steps, §9.8): `parseStr_complete s k ts h tree fuel`
+ (`E.parseStr s k = some (ptSem ⟨0⟩ tree)` for a tree over the tokens of `tokenize s`),
+ `parseStr_complete_lexing` (from a `Lexing` of `s` with steps `steps`: `tokenize s` is
+ `ts` with `ts.map (·.val) = Lexer.lexingTokens L.lexer L.lexer.start s.toList steps`,
+ and every tree over `ts` within the fuel is accepted), `parseStr_unambiguous s h₁ h₂
+ tree₁ tree₂` (two derivations of `s`, each the tokens of `L.tokenize s = .ok tsᵢ` and a
+ tree over them, have `ts₁ = ts₂` and the same value). The value-level statement ties the
+ tokens to `s` through `tokenize`, not through a `Lexing` alone: a `Lexing` fixes the
+ token values but not their spans, and an action that reads a span can give different
+ values for different spans. `Lexer.Lexing.unique` states that the steps of `s` are
+ unique;
+- the same over positioned tokens, where `L.Lexes s ts` is the positioned tokenization of
+ `s` (`Lexer.PosLexing`, §9.8: each token's span delimits its lexeme and skip rules
+ consume the bytes between tokens): `parseStr_sound_lexes` (an accepted `s` has
+ `L.Lexes s ts` and a tree over a prefix of `ts` with the result as value),
+ `parseStr_complete_lexes`, `parseStr_unambiguous_lexes` (two derivations of `s`, each a
+ positioned tokenization and a tree over it, have the same tokens, and their trees the
+ same span and value), and `parseStr_node_spans s ts h tree`
+ (`Lexer.AllNodeText (Lexer.modeAct L.lexer L.lexer.start) L.lexer.eofToken s ⟨0⟩ tree`,
+ `Lexer/SpanText.lean`: every leaf's span is `[a, b)` for positions `a ≤ b` of `s` and a
+ rule's action emits its token from the lexeme `s.extract a b`, or it is the end-of-input
+ token at the end of `s` (`Lexer.TokenLexeme`); every inner node's span is `[a, b)` for
+ positions `a ≤ b` of `s` (`Lexer.SpanIn`) that satisfy `SpanFacts`: `b` is the end of the
+ lexeme of its last token, and `a` is the start of the lexeme of its first token or, when
+ its word is empty or its leftmost children derive the empty word, the end of the token
+ before it);
+- the tree covers the tokens: `word_eq_of_lexes s ts h tree rest hs` (if `L.Lexes s ts` and
+ `toStream ts = appList word rest` for a start tree over `word`, then `word = ts`) and
+ `parseStr_sound_exact s k p accepted` (an accepted `s` has `L.tokenize s = .ok ts`,
+ `L.Lexes s ts` and a tree over exactly `ts` with value `p`). They use the lexer module's
+ `L.lexes_eof_last` (the positioned tokenization ends with the `%eof` token at the end of
+ `s`, and no other token is the `%eof` token, from `L.noEofEmit`) and `endMarker_last`
+ (`native_decide`: `$` is the last symbol of every `S'` production, and no other
+ position of a right-hand side holds `$` or `S'`). The library lemma is
+ `Runtime.start_word_eq` (`Runtime/ParseEnd.lean`): a start tree's word ends with its only
+ `$` token, so a word that begins the stream of a list whose only `$` token is the last
+ one is that list. `endMarker_last` holds for every grammar the frontend accepts: `$` and
+ `S'` come from the augmentation, and a production that names the `%eof` token is
+ rejected.
+
+The other soundness theorems (`parser_sound`, `parseStr_sound`, `parseStr_sound_tokenize`,
+`parseStr_sound_tokenization`, `tokenize_parse_sound`, `parseStr_sound_lexes`) give a tree
+over a prefix of the EOF-padded token stream (`toStream ts = appList word rest`). They
+hold at the token level, for any token list, without the lexer facts above.
+
+The lex-failure theorems use `startProds_end` (every production of `S'` has `$` on its
+right-hand side, by `native_decide`), `tokenTerm_eq_end` (only the `%eof` token has
+terminal `$`, by a case split on the token type) and the lexer module's `L.noEofEmit`.
+They are emitted when the `%eof` token carries no value.
+
+Here `L` is the lexer namespace and `E` the parser namespace. `#print axioms` on these
+theorems shows the standard axioms and per-grammar `native_decide` axioms only.
### 6.2 Parser module
@@ -296,13 +429,18 @@ The executable output contains:
semantic value together with its source span;
- token decoding `decode : Runtime.Positioned Tok → Nat × VP`, attaching each
token's span;
-- semantic actions over `List VP`: `sem` and the fused reduces `fuse ` bind, for a symbol `x`, both the
- value `x` and its span `x_span`, and fold the production's span as
- `Runtime.Span.merge (first symbol) (last symbol)` (Menhir's `$startpos`/
- `$endpos`; a single symbol folds to its own span, an empty RHS to the dummy
- span). An action that never mentions `x_span` pays nothing — generated `sem`/
- `fuse ` set `linter.unusedVariables false` so an ignored span binder is not a
- warning;
+- semantic actions: `semV : Nat → List Span → List V → V` runs the action of a
+ production on the values of its right-hand side and, when the action names
+ `x_span`, binds it from the span list (`spans.getD i Span.dummy`). The engine's action
+ is `sem := Runtime.Exec.spanSem semV`, which computes the node span in the library:
+ `Span.fold (stackEnd rest) spans`, where `stackEnd rest` is the end of the cell below
+ the popped cells (byte 0 on the empty stack). That is the end of the last shifted
+ token, so an empty right-hand side gets the empty span there, as in the Rust backend.
+ The fused reduces `fuse ` compute the same span inline from the cell offsets; for an
+ empty right-hand side they read the top state and the end of the top cell with one
+ match (`Stk.withTop`, with `Stk.withTop_eq`). An action that never mentions `x_span`
+ pays nothing — generated `semV`/`fuse ` set `linter.unusedVariables false` so an
+ ignored span binder is not a warning;
- flat Pager action/goto arrays;
- `run : List (Runtime.Positioned Tok) → Runtime.Exec.Result VP` and
`parse : List (Runtime.Positioned Tok) → Option StartTy`, which drops the span;
@@ -320,28 +458,20 @@ The executable output contains:
the lexer delivers a prefix and fails, and `parseStr` is `none` or `parse` of an
extension of the prefix). Each proof unfolds the entry points and applies one library
lemma with `L.fastActs_agree_byte`;
-- with `%option parseStr`, a `%lexer` block and no action that names a span variable
- (`x_span` or `__s`), `sem p args` is emitted as `(semS p args, semV p (args.map
- Prod.snd))`: `semS` has the patterns of `sem` and returns the span fold, `semV` matches
- the values only and runs the action, and the fallback of each gives the same result as
- the one-match `sem`. `semSpanFree : Runtime.Exec.SemSpanFree sem` then holds by
- `SemSpanFree.of_split`, and `parse_spanIndependent` follows from
- `Runtime.Exec.SpanIndependent.of_run` (§13). At run time the accept production calls
- `sem`; the other productions run `fuse `, which falls back to `sem` only when its
- stack pattern does not match;
- Menhir-style diagnostics wrappers `terminalName`/`diagnose`/`diagnoseSpanned`/
`errorMessage` (§ error messages), where `diagnoseSpanned` recovers the
offending token's span from `VP` for `line:col` rendering.
Both modules are generated from identical augmented grammar, state graph, and
parse tables. The paired specification module additionally emits a symbol-indexed
-encoding into `VP` — `refinementEncodeValue` wraps each dependent value as
-`(Runtime.Span.dummy, .ctor value)` — native-checked table/decoder obligations,
-per-production semantic-action proofs, `parserRunRefines`, and
-`parse_eq_dependent`. The dependent side has no spans: the refinement feeds
-`Span.dummy`-tagged values, and because `Span.merge dummy dummy` reduces to
-`dummy`, the per-production `refinementSemanticAgrees` still closes by `rfl`, so
-the span machinery does not disturb the verified refinement.
+encoding into `V` (`refinementEncodeValue s v = .ctor v`), native-checked table/decoder
+obligations, per-production semantic-action proofs, `parserRunRefines`, and
+`parse_eq_dependent`. The per-production obligation is span-free:
+`refinementSemanticAgrees : ∀ spans values, E.semV p spans (values.encode …).reverse =
+refinementEncodeValue _ (values.apply (prodAction' p spans))`, closed by `rfl`. The spans
+are handled once in the library: `Runtime.Refinement.eraseStack` evaluates each derived
+stack value (a function of a position, §4.4) at the end of the erased cell below it,
+which is where `spanSem` reads the position of an empty right-hand side.
The generic simulation in `Runtime/Refinement.lean` relates stacks, shifts,
reductions, finite EOF-padded inputs, matching logarithmic fuel, and final parser
results. The sum representation uses no `unsafeCast`.
@@ -776,7 +906,7 @@ intermediate `List Tok` is one file-sized allocation; that is a
memory-residency question a 49 KB corpus cannot surface, and fusion there should be
re-measured before committing.
-### 9.6.3 A byte-level scanner (implemented; proved-default pending)
+### 9.6.3 A byte-level scanner (implemented and proved)
The `~72 us` Lean lex figure and the `~1.65x` fused gap both *exclude* the
bytes-to-`Char` decode layer (§2, §9.6.1), which is a separate pass over the input
@@ -792,10 +922,11 @@ refinement: the parser theorem still begins at tokens.
The scanner is implemented as a byte-expansion of the already-verified `FlatDFA`,
not a fresh automaton against `Regex` semantics, so the soundness chain
(`FlatDFA = DFA.scan = MatchStep`) is inherited rather than rebuilt. The runtime and
-construction are done, the byte↔flat scan simulation is proved up to a Boolean
-agreement, and the scanner is emitted into every lexer as a `native_decide`-validated
-fast path; the one remaining piece is deriving that Boolean agreement for all `Char`,
-so `tokenizeByte` can become the proved default. The details follow.
+construction are done, and the byte scanner is proved equal to the flat scanner on every
+input, given a per-lexer Boolean check over all of Unicode (`byteUnicodeValid`,
+`Lexer/ByteUnicode.lean`) that the lexer module discharges by `native_decide`. The
+positioned byte lexer `lexPos` is therefore proved equal to `tokenize`
+(`PosLexerAgrees`, §13). The details follow.
`Lexer/ByteScan.lean` defines `ByteDFA` (a flat `state × 256` byte-transition table
plus a boundary/intermediate state split — boundary states are the char-DFA states
@@ -816,20 +947,20 @@ lifts this by induction over the input to show the byte scan and the flat char s
record the same rule. These are proved with no `sorry` and only the standard axiom
budget, up to `byteScan_rule_eq_flatScanArr`: given the agreements, the byte scan over
`s.toUTF8` records the same rule as the flat scan over `s.toList` (which
-`flatScanArr_eq_scan` ties to `DFA.scan`). The remaining piece is a Boolean validator
-deriving the abstract byte agreements (`ByteStepAgree`/`ByteNoMidAccept`, quantified
-over all `Char`) that these theorems assume. The obstacle is real and is the "real
-work" flagged above: a flat class holds code points with different UTF-8 byte
-sequences, so a single class-representative check does not cover the class the way it
-does for the char-level `FlatDFA`, and the byte run is not constant across a class at
-the byte level. Full code-point enumeration is not a way out — validating
-`runList = f.step` at every scalar value for every state measures ~250 s of native
-evaluation on Cedar (57 states × ~1.1M code points), far past what `native_decide` can
-discharge. The provable route is to certify the byte automaton recognizes each class's
-UTF-8 byte ranges (`Utf8Ranges.compile` correctness). The ASCII fragment of this is
-proved (`runList_utf8EncodeChar_ascii`: a single-byte code point's run is one validated
-byte step); the multi-byte fragment (byte-range coverage of the non-ASCII classes — for
-Cedar the single catch-all class) is what remains. The runtime `String.toUTF8`
+`flatScanArr_eq_scan` ties to `DFA.scan`). The abstract byte agreements
+(`ByteStepAgree`/`ByteNoMidAccept`, quantified over all `Char`) do not follow from
+`byteValidate`: a flat class holds code points with different UTF-8 byte sequences, so
+one representative per class does not cover the class. Full code-point enumeration is
+too slow (validating `runList = f.step` at every scalar value for every state measured
+~250 s of native evaluation on Cedar, 57 states × ~1.1M code points). The check that is
+used, `byteUnicodeValid` (`Lexer/ByteUnicode.lean`), walks the UTF-8 prefix tree from each
+flat state and stops at any node whose code points lie in one flat class and whose byte
+state reaches that class's target uniformly over all continuations; it does not prove
+`Utf8Ranges.compile` correct, it checks its output. `agreements_of_byteUnicodeValid`
+derives all four agreements from it, and `Lexer/ByteAgree.lean` extends the scan
+simulation to the end positions, to scans from any position, and to the tokenizer loop
+(§13, "The two hypotheses"). On Cedar the check takes 70 ms of `native_decide`
+interpretation. The runtime `String.toUTF8`
input is bridged to the `encodeChars` list model by `toUTF8_size_eq`/`toUTF8_getElem_eq`
(via `String.utf8Encode_toList`), the one place `String`/`ByteArray` internals appear.
@@ -847,21 +978,20 @@ byte-for-byte identical (Cedar 28/28):
So folding the UTF-8 decode into the scan removes ~15% of lex time on these ASCII
corpora, where the `String.Pos` cursor's per-char UTF-8 stepping is pure overhead. The
win would be larger on multi-byte input (the byte scanner reads each byte once; the
-`String.Pos` path decodes a code point per step). This is the throughput half of the
-goal; the verified half (the byte validator deriving the agreements) is the remaining
-work noted above.
+`String.Pos` path decodes a code point per step).
The emitter (`Emit/CodegenLexer.lean`) now generates the byte scanner into every
-lexer: per mode a `ByteDFA` (`FooLexer.cbyte = CompiledByte.ofFlat cflat`), a
-`FooLexer.byteValidated{m} : byteValidate … = true := by native_decide` check, and a
+lexer: per mode a `ByteDFA` (`FooLexer.cbyte = CompiledByte.ofFlat cflat`) and a
`FooLexer.tokenizeByte` entry point. The proven `FooLexer.tokenize` stays on the flat
-`String.Pos` scanner, so all existing guarantees are unchanged; the byte path is an
-additional, per-lexer `native_decide`-validated fast path (the same a-posteriori
-discharge the flat tables use). The generated lexers (calculator, Cedar,
-CedarSchema, CedarEntities) regenerate, compile, and discharge `byteValidated{m}`, and their
-`Verified` proofs (Cedar checked directly) still check. Making `tokenizeByte` the
-proved default awaits `agreements_of_byteValidate` (the derivation noted above); until
-then `tokenize` remains the proved path and `tokenizeByte` the validated fast path.
+`String.Pos` scanner. Every lexer module also emits `FooLexer.byteUnicodeValidated :
+Lexer.byteValidAll FooLexer.cbyte = true` (all modes, `native_decide`) and
+`FooLexer.posLexerAgrees : Lexer.PosLexerAgrees FooLexer.cbyte FooLexer.tokenize`, which
+is what `parseStr` (the stream engine over `lexPos`) uses. `tokenizeByte` is `lexPos`
+without the spans (`Lexer.tokenizeByte_eq_lexPos`, by induction on the fuel), so
+`FooLexer.tokenizeByte_toOption` gives `(tokenizeByte s).toOption =
+(tokenize s).toOption.map (List.map (·.val))` from `posLexerAgrees`. The earlier
+one-character-per-class check `byteValidated{m}` (`Lexer.byteValidate`) is no longer
+emitted: it does not imply the agreements and no theorem used it.
### 9.6.4 Further lexer optimization candidates
@@ -1156,13 +1286,14 @@ code points — so no code-point budget gate is needed.
`tokenizeStr_eq_tokenize`) is the `String.Pos` cursor the flat scanner builds on.
- **Byte scanner (§9.6.3).** A `UInt8`/`ByteArray` scanner (`Lexer/ByteScan.lean`,
- `Lexer/ByteTokenize.lean`) is emitted into every lexer as `FooLexer.tokenizeByte`
- and validated per lexer by `FooLexer.byteValidated⟨m⟩` (`native_decide`, same axiom
- budget as `flatValidated⟨m⟩`). It is ~1.17x faster than the flat scanner on
- Cedar (tokens identical). The byte↔flat scan simulation is proved up to that
- Boolean (`byteScan_rule_eq_flatScanArr`, `Lexer/ByteValidator.lean`); the proved
- `tokenize` stays on the flat scanner and `tokenizeByte` is the validated fast path.
- Making it the proved default awaits `agreements_of_byteValidate` (§9.6.3).
+ `Lexer/ByteTokenize.lean`) is emitted into every lexer as `FooLexer.tokenizeByte`.
+ It is ~1.17x faster than the flat scanner on Cedar (tokens identical).
+ `FooLexer.byteUnicodeValidated` (`byteValidAll`, every
+ mode, `Lexer/ByteUnicode.lean`) checks every `Char`, and from it
+ `posLexerAgrees_of_byteValidAll` (`Lexer/ByteAgree.lean`) proves that the positioned
+ byte lexer `lexPos` returns what `tokenize` returns, spans included, or both fail
+ (§13). `FooLexer.tokenizeByte_toOption` carries this to `tokenizeByte`. `tokenize`
+ stays on the flat scanner.
- **Action table and pull step** (`Lexer/FastAct.lean`, `Lexer/BytePull.lean`,
`Lexer/ByteTokenize.lean`).
@@ -1205,6 +1336,47 @@ code points — so no code-point budget gate is needed.
`pullSource_denotes` (if `lexPosAux` returns `ts`, the source denotes `ts`),
`lexPosAux_of_denotes` (the converse), and `pullSource_total` (every state denotes
a list or delivers a prefix and fails, by strong induction on the fuel).
+ `pullSource_fails_tokens` (`Lexer/LexerSound.lean`): every token delivered before a
+ lex error was emitted by a rule.
+
+- **Lexer soundness from `tokenize`** (`Lexer/LexerSound.lean`).
+ `tokenizeFlatStrPos_sound` chains `tokenizeFlatStrPos_val`,
+ `tokenizeFlatStr_eq_tokenize` and `tokenize_sound`: for a validated start mode whose
+ rules all `stay`, a successful positioned flat tokenization is a maximal-munch
+ `Tokenization`, and the spec `tokenize` returns the same token values. The per-rule
+ premises are stated over `FastActs` and proved one rule at a time (`AllL`,
+ `FastActs.get_of_allL`, `FastActs.textIndep_of_forall₂`). Each single-mode lexer whose
+ rules all `stay` emits `FooLexer.stay0`, `FooLexer.textIndep0` and
+ `FooLexer.tokenize_sound`; every lexer with a valueless `%eof` token emits
+ `FooLexer.noEofEmit` (no rule emits it).
+- **Completeness and uniqueness of tokenization** (`Lexer/Lexing.lean`). `Tokenization`
+ is a `Prop` without data, so it has nothing to be unique about; `Lexing rules cs steps`
+ is the same derivation with its steps `(rule, len)`, each consuming at most the
+ remaining input. `Lexing.unique` (the steps are determined by `cs`, from
+ `matchStep_unique`), `tokenize_complete` (a `Lexing` makes `tokenize` succeed with
+ `lexingTokens`, the tokens the actions emit plus the end-of-input token; the fuel
+ `length + 1` covers every step since each consumes at least one character),
+ `tokenize_lexing` (the converse, with steps) and `tokenizeFlatStrPos_complete`.
+ Over byte positions, `PosLexing rules act eof s p ts` is the positioned tokenization
+ of `s` from `p`: a step from `p` to `q` is the maximal-munch winner on `charsFrom p`,
+ `q` is `len` characters further, the lexeme is `s.extract p q`, and an emitted token
+ has the span `⟨p.offset, q.offset⟩`; a skip step emits nothing, so the bytes between
+ two tokens are consumed by skip steps; the end-of-input token has the empty span at
+ the end. `tokenizeFlatStrPos_iff_posLexing` (and `…'` with fast actions):
+ `tokenizeFlatStrPos cf s = .ok ts ↔ PosLexing … s s.startPos ts`, by one induction per
+ direction over the loop, using the scan facts of `tokenizeStrAux_eq`
+ (`scanStr_eq_scan_at`, `scanStrGo_pos`, `scanStrGo_pos_le`) and `charsFrom_inj` (two
+ positions with the same remaining characters are equal). `PosLexing.unique` and
+ `PosLexing.tokenLexeme` (each token's span is `[a, b)` for positions of `s`, and the
+ action of a rule emits it from `s.extract a b`, or it is the end-of-input token),
+ `PosLexing.eof_last` (the end-of-input token is last, and no action emits it, so no
+ other token is it) and
+ `PosLexing.spans_ordered` (spans lie in the input, are not reversed, and each ends at
+ or before the next starts). `lexPos_ok_iff` carries the result to the byte lexer
+ through `PosLexerAgrees`. Each single-mode `stay` lexer emits `FooLexer.tokenize_complete`,
+ `FooLexer.Lexes`, `FooLexer.tokenize_iff_lexes`, `FooLexer.lexPos_iff_lexes` and
+ `FooLexer.lexes_unique`, and, with a valueless `%eof` token, `FooLexer.lexes_eof_last`
+ (from `PosLexing.eof_last`, `modeAct_emit_of_agrees` and `noEofEmit`).
## 10. Build and validation
@@ -1319,6 +1491,26 @@ split: `CalcParser` 1.49 → 1.55 s, `CalcVerified` 2.04 → 2.04 s, `CedarParse
`CedarEntitiesVerified` 4.13 → 4.23 s, `AsmParser` 6.83 → 7.2–7.3 s, `AsmVerified`
7.63 → 7.95 s. The new library modules (`ExecStream`, `FastAct`, `BytePull`,
`StreamRun`, and `ByteTokenize` with `lexPos`) check in 1.5–1.6 s each.
+The span-grammar change (§4.4) removed this split again: `sem` is
+`Runtime.Exec.spanSem semV`.
+
+Closing `PosLexerAgrees` and the lex-failure case (§13) adds `byteUnicodeValidated`,
+`posLexerAgrees`, `noEofEmit` and `tokenize_sound` to each lexer module and the
+end-to-end theorems to each verified module. Cold time as reported by Lake under
+`taskset -c 0-7`, before → after: `CalcLexer` 0.66 → 0.72 s, `CedarLexer` 1.9 → 2.2 s,
+`AsmLexer` 3.7 → 3.0 s, `CedarEntitiesLexer` 0.92 → 1.0 s, `CalcVerified` 1.5 → 1.5 s,
+`CedarEntitiesVerified` 5.0 → 4.6 s, `AsmVerified` 8.3 → 8.4 s, `CedarVerified` 17 → 17 s.
+The `native_decide` interpretation of `byteUnicodeValidated` is 143 ms for asm, 71 ms for
+Cedar, 29 ms for CedarEntities and 8 ms for calc. The new library modules
+`ByteUnicode`, `ByteAgree`, `LexerSound` and `ParseEnd` check in 1.5, 0.9, 0.6 and 0.7 s.
+
+Spans in the specification (§4.4) and the string-level completeness and unambiguity
+theorems (§6.1) change every verified module: a span grammar instance, actions over span
+lists, the span refinement, and seven `parseStr_*` theorems. Cold time as reported by
+Lake under `taskset -c 0-7`, at `89a1931` → after: `CalcVerified` 1.3 → 1.4 s,
+`AsmVerified` 8.1 → 7.8 s, `CedarVerified` 17 → 17 s, `CedarEntitiesVerified` 3.7 →
+3.6 s; `SpanUseVerified` (did not compile before) 0.96 s; `C99Verified` 28 s, peak RSS
+1.8 GB with one Lake job.
## 11. Parser refinement against the dependent specification
@@ -1663,46 +1855,85 @@ differs from `tokenize` followed by `parse` in three ways:
It also differs from the Rust `parse_str`, which lexes the rest of the input after a
parse error.
-**The two hypotheses.** The `*Verified` theorems that relate `parseStr` to
-`tokenize` and the dependent parser (§6.1) take the hypotheses they need as explicit
-arguments. They are `def`s in the library and `abbrev`s in the generated module, not
-axioms, so `#print axioms` on these theorems shows only the standard axioms and the
-`native_decide` axioms `parser_sound` already has. `SpanIndependent` is proved for every
-grammar whose actions name no span variable; `PosLexerAgrees` is not proved for any
-grammar.
+**No hypotheses.** The `*Verified` theorems that relate `parseStr` to `tokenize` and the
+dependent parser (§6.1) used to take `PosLexerAgrees` and `SpanIndependent` as arguments.
+`PosLexerAgrees` is now a theorem for every generated lexer, multi-mode ones included.
+`SpanIndependent` is gone: the dependent specification has spans (§4.4), so the
+refinement holds on the real positioned tokens and no theorem compares a run with real
+spans to a run with dummy spans.
- `PosLexerAgrees` is `Lexer.PosLexerAgrees L.cbyte L.tokenize`:
`∀ s, (lexPos L.cbyte s).toOption = (L.tokenize s).toOption`. It relates the byte
scanner to the flat `String.Pos` scanner `tokenize` runs. It compares `toOption`
because the error payloads differ (`lexPos` reports a byte offset and
`char := none`, `tokenize` a character count and `char := some c`), so equality of
- the `Except` values would be false on inputs that fail to lex.
- `byteScan_rule_eq_flatScanArr` (§9.6.3) is the scan-level piece of a proof. The rest is
- open: the byte agreements `ByteStepAgree`/`ByteNoMidAccept` for all `Char` (the
- `Utf8Ranges.compile` coverage noted in §9.6.3), agreement of the scan end positions
- (byte offset against the UTF-8 length of the character prefix), and a loop-level
- simulation of `lexPosAux` against `tokenizeFlatStrPosAux` with modes, lexemes
- (`String.fromUTF8!` of a byte slice against `String.extract`) and the EOF token.
-- `SpanIndependent` is `Runtime.Exec.SpanIndependent (fun ts k => E.parse ts k)`:
- `∀ ts k, E.parse ts k = E.parse (ts.map fun t => ⟨t.val, Span.dummy⟩) k`. It is needed
- because the dependent specification has no spans (§6.2). The library proves it from
- `SemSpanFree tbl.sem` (`sem` builds the value of its result from the values of its
- arguments): `run_erase` runs `Exec.run` on two inputs that differ only in spans in
- lockstep and shows the results agree after `Result.eraseSpan`, and
- `SpanIndependent.of_run` lifts that to a `parse` that reads only the erased result. The
- generator emits `SemSpanFree` by construction (the `semS`/`semV` split of §6.2), so the
- per-grammar proof is one application of `SemSpanFree.of_split` and a case split on the
- result. Proving `SemSpanFree` for the one-match `sem` instead is too slow: `split` on the
- Cedar or asm `sem` exceeds the heartbeat limit, and a case analysis on the argument
- list and value constructors took 12 minutes for Cedar. `SpanIndependent` is false for a
- grammar whose actions read `x_span`: `test/spanuse` returns the width of `w_span`, so
- its `sem` keeps the one-match form, it keeps `hspan`, and its `parseStr_eq_dependent`
- and `parseStr_sound` are vacuous.
-
-`parseStr_eq` and `parseStr_of_tokenize_error` need only `PosLexerAgrees`, and so
-do `parseStr_eq_dependent` and `parseStr_sound` when `SpanIndependent` is proved.
-`runStream_eq_lexPos`, `runStream_eq_run` and `parseStr_total` in the parser module
-need neither: they are stated over `lexPos` directly.
+ the `Except` values would be false on inputs that fail to lex. The lexer module proves
+ it as `L.posLexerAgrees`, one application of `Lexer.posLexerAgrees_of_byteValidAll`
+ (`Lexer/ByteAgree.lean`) to the Boolean check `L.byteUnicodeValidated :
+ Lexer.byteValidAll L.cbyte = true` (`native_decide`). The proof has three layers:
+ 1. *Byte agreements for every `Char`* (`Lexer/ByteUnicode.lean`,
+ `agreements_of_byteUnicodeValid`): `ByteStepAgree`, `ByteNoMidAccept`,
+ `ByteAcceptAgree`, `ByteStatesInRange`. `byteValidate` (§9.6.3) checks one character
+ per flat class, which does not cover a class, because characters of one class have
+ different bytes. `byteUnicodeValid` walks the UTF-8 prefix tree from every flat
+ state instead: the 128 one-byte characters, then for each 2-, 3- and 4-byte lead
+ byte the continuation bytes, where a node at depth `r` stands for a block of `64^r`
+ code points. A node is accepted without descending when none of its code points is
+ a scalar value of that length, or when all of them lie in one flat class
+ (`FlatDFA.clsOfRange`, sound for sorted boundaries through a `bsearch` lemma) and
+ every `r`-byte continuation from the node's byte state ends at that class's target
+ through non-accepting states (per-state tables `uniTable` for `r = 1, 2, 3`,
+ computed once per byte table). The byte values come from core's
+ `String.utf8EncodeChar_eq_cons_cons` and siblings, restated as `Nat` arithmetic
+ (`Utf8.enc2`–`enc4`). The construction `byteOfFlat` and `Utf8Ranges.compile` stay
+ untrusted.
+ 2. *One scan from any position* (`byteScan_eq_flatScanStr`): the byte scan from byte
+ `p.offset.byteIdx` returns the flat scan from `p`, with the end position as a byte
+ offset. The induction consumes one character per flat step
+ (`byteScanListGo_consume`); `encodeChars_drop_offset` identifies the bytes from `p`
+ with the encoding of `charsFrom p`.
+ 3. *The loop* (`lexPosAux_toOption_eq`): `lexPosAux` from `p.offset.byteIdx` and
+ `tokenizeFlatStrPosAux` from `p` take the same branch at every step, for any mode
+ stack, since every mode's byte table is checked against that mode's flat table. The
+ scans match, `len = 0` exactly when the byte end does not pass the start
+ (`flatScanStr_len_zero_iff`), the lexemes are equal (`fromUTF8_extract_eq`:
+ `String.fromUTF8!` of the byte slice `[p, q)` is `String.extract p q`), the spans are
+ equal, and so is the EOF token's span. Both loops spend one fuel per token from the
+ same starting fuel (`utf8ByteSize + 1`).
+
+ `byteUnicodeValidated` takes 70 ms of `native_decide` interpretation for Cedar (57 flat
+ states, 59 classes, 71 byte states).
+- Spans. The dependent specification is a span grammar (§4.4); `parse_eq_dependent` holds
+ on every positioned token list, and the executable parser computes node spans with
+ `Runtime.Exec.spanSem`, the same fold as `SpanGrammar.ptSpan`. The previous design kept
+ the dependent side span-free and transferred results to real spans through
+ `SpanIndependent`, which was proved only for grammars whose actions read no span; it
+ was false for `test/spanuse`, whose theorems took it as the hypothesis `hspan` and
+ were vacuous. `SpanIndependent`, `SemSpanFree`, `run_erase`, `runFast_ok_dummy`,
+ `parse_eq_dependent_spans` and the `semS`/`semV` split were removed.
+
+**Lex failure.** If the lexer fails, `parseStr` is `none`
+(`parseStr_eq_none_of_tokenize_error`). `parseStr_total` gives, in that case, a prefix `ts`
+that the pull lexer delivered before the error and, for every continuation `tail`,
+`parseStr = none` or `parseStr = E.parse (ts ++ tail) k`. Take `tail` to be `2^k + 1`
+copies of the first token. No token of `ts` is the `%eof` token
+(`Lexer.pullSource_fails_tokens` with `L.noEofEmit`, one proof per rule; for a rule that
+calls a helper, see `docs/LEXER.md`), so the padded
+list has no `$` token and more than `2^k` tokens. `Runtime.parse_ne_parsed_of_no_end`
+(`Runtime/ParseEnd.lean`) shows that `parse` does not accept it: `parse` reads at most one
+token per step (`parseFix_consumed`), and every word a start tree yields contains a `$`
+token, because `S' → S $` is the only production of `S'` (`parseTree_has_end`), so by
+`parseCorrect` an accepted run would have read past the list. For `runStream` the same
+argument gives `runStream_ne_ok_of_tokenize_error`, through the refinement on the padded
+positioned list. The result is not always `.err`: a syntax error before the lex error is
+`.reject`.
+
+If a rule emits the `%eof` token, the lex-failure theorems are false (the parser can
+accept on that token before the lexer reaches the error), and `L.noEofEmit` does not
+compile.
+
+`runStream_eq_lexPos`, `runStream_eq_run` and `parseStr_total` in the parser module are
+stated over `lexPos` directly.
### `%option compress_tables`: compressed table literals for the executable parser
diff --git a/docs/GUARANTEES.md b/docs/GUARANTEES.md
index 14a2037..944c345 100644
--- a/docs/GUARANTEES.md
+++ b/docs/GUARANTEES.md
@@ -4,7 +4,7 @@ This page states what Lean proves about a generated parser, how to read the gram
## Proven parser properties
-The theorems are about the `Grammar` in the generated specification module (`ExprVerified` in the README example). They are exported from that module:
+The theorems are about the grammar in the generated specification module (`ExprVerified` in the README example), a `Runtime.SpanGrammar`. Its parse trees have positioned tokens (`Runtime.Positioned Tok`) as leaves, and each production action receives the spans of its right-hand-side symbols. The value of a tree is `Runtime.SpanGrammar.ptSem ⟨0⟩ tree`, and its span is `Runtime.SpanGrammar.ptSpan ⟨0⟩ tree` ([`DESIGN.md`](DESIGN.md) §4.4). The theorems are exported from that module:
```text
parser_sound
@@ -15,9 +15,9 @@ parser_unambiguous
parse_eq_dependent
```
-If `ExprParser.parse` returns a value, `parser_sound` gives a parse tree for the input whose semantics is that value. `parser_err_free` and its equality form `parser_ne_err` state that `ExprParser.run`, the internal function that `parse` is built on, never returns `.err`, the result that would mean the generated tables are inconsistent.
+The theorems are stated on the positioned tokens `ExprParser.parse` reads, with their real spans. If `ExprParser.parse` returns a value, `parser_sound` gives a parse tree for the input whose semantics is that value. `parser_err_free` and its equality form `parser_ne_err` state that `ExprParser.run`, the internal function that `parse` is built on, never returns `.err`, the result that would mean the generated tables are inconsistent.
-In the other direction, `parser_complete` says that the parser accepts any input that has a start parse tree (`ParserStartTree`), as long as `2 ^ logNSteps` is at least the size of the tree. The README section "Fuel" shows what this means for the size of the input. The type `ParserStartTree` is rooted at the augmented start symbol `S'`, so its word includes EOF. `parser_unambiguous` says that two start parse trees for the same token word have equal semantics. `parse_eq_dependent` says that `ExprParser` and the dependent specification parser return the same result at the same fuel.
+In the other direction, `parser_complete` says that the parser accepts any input that has a start parse tree (`ParserStartTree`), as long as `2 ^ logNSteps` is at least the size of the tree. The README section "Fuel" shows what this means for the size of the input. The type `ParserStartTree` is rooted at the augmented start symbol `S'`, so its word includes EOF. `parser_unambiguous` says that two start parse trees for the same token word have equal spans and semantics. `parse_eq_dependent` says that `ExprParser` and the dependent specification parser return the same result at the same fuel.
A caller does not have to assemble a validator proof or a refinement witness. The lower-level declarations are still available for proofs that need them.
@@ -25,7 +25,7 @@ A caller does not have to assemble a validator proof or a refinement witness. Th
The `.lig` frontend is not verified. The theorems are about the grammar that the frontend emitted into the Lean file. If the frontend misreads the `.lig` file, the proofs hold for the grammar it misread. The generator parses `.lig` files with a hand-written parser. A second parser, generated from `lig.lig`, reads the structure of a `.lig` file (directives, rules, alternatives) and has the proofs that every generated parser has. The Lean code inside `%header`, `%lexer` and the action bodies is still read by a hand-written scanner, so the generated parser covers the structure only. `lig-bootstrap-test` checks that the two parsers give the same result on the `.lig` files in this repository. That is a test on those files, not a proof. To check what the generator read, use the grammar view in the next section. [`DESIGN.md`](DESIGN.md) §15 has the details.
-The theorems start at tokens, not characters. The generated lexer has its own maximal-munch soundness theorem against its DFA tables, checked with `native_decide` (see [`LEXER.md`](LEXER.md)). That theorem is not connected to the parser theorems. The decoding of bytes into characters and the `lexre` regex frontend are not verified.
+The parser theorems start at tokens, not characters. The generated lexer has its own maximal-munch soundness theorem against its DFA tables, checked with `native_decide` (see [`LEXER.md`](LEXER.md)). For a grammar with `%option parseStr` and a lexer with one mode whose rules all stay in it, the specification module connects the two: `parseStr_sound_tokenization` states that when `parseStr s k = some v`, the input `s` has a maximal-munch tokenization, the lexer's `tokenize s` returns the tokens, and their values have a parse tree with semantics `v`. `parseStr_eq_none_of_tokenize_error` states that `parseStr` returns `none` when `tokenize` fails. For such a lexer the module also proves completeness and unambiguity at the string level: `parseStr_complete_lexing` (a maximal-munch tokenization of `s` and a parse tree over its tokens within the fuel make `parseStr` return the tree's value), `parseStr_unambiguous` (two derivations of `s`, each the tokens `tokenize s` returns and a parse tree over them, have the same tokens and the same value), and the same over positioned tokens with `L.Lexes s ts` (the positioned tokenization, in which each token's span delimits its lexeme in `s`): `parseStr_sound_lexes`, `parseStr_complete_lexes`, `parseStr_unambiguous_lexes` and `parseStr_node_spans` (every leaf's span is the byte range of its lexeme in `s`, from which a rule's action emits the token; every inner node's span is a byte range `[a, b)` of `s` with `a ≤ b`, where `b` is the end of the lexeme of its last token and `a` is the start of the lexeme of its first token, or the end of the token before it for a node whose word is empty or whose leftmost children derive the empty word, the convention of the Rust backend). `parseStr_sound_exact` states that when `parseStr s k = some v`, `tokenize s` returns `ts`, `ts` is the positioned tokenization of `s`, and a parse tree over exactly `ts` has semantics `v`. These theorems take no hypothesis, also when an action reads a token span ([`DESIGN.md`](DESIGN.md) §6.1, §13). The other soundness theorems give a tree over a prefix of the token stream padded with EOF; they hold for any token list. `parseStr_sound_exact` adds the per-grammar `native_decide` check `endMarker_last` (`$` is the last symbol of every start production, and no other right-hand-side position holds `$` or the start symbol). Without `%option parseStr` the connection is not emitted, though `tokenize_sound` is emitted in the lexer module. The `lexre` regex frontend is not verified.
## Looking at the grammar that was checked
@@ -54,7 +54,8 @@ The large checks are discharged with `native_decide`. This is what makes Cedar-s
The repository contains no `sorry`. I checked the axioms of the six exported theorems on the calc grammar with `#print axioms`:
-- `parser_sound`, `parser_err_free`, `parser_ne_err`, `parser_unambiguous` and `parse_eq_dependent` depend on `propext`, `Quot.sound`, and the `native_decide` axioms of the generated safety and refinement checks.
+- `parser_sound`, `parser_err_free`, `parser_ne_err` and `parse_eq_dependent` depend on `propext`, `Quot.sound`, and the `native_decide` axioms of the generated safety and refinement checks.
+- `parser_unambiguous` depends on `propext`, `Quot.sound`, and the `native_decide` axiom of the generated completeness check.
- `parser_complete` additionally depends on `Classical.choice` and on the `native_decide` axiom of the generated completeness check.
## The module system
@@ -62,7 +63,7 @@ The repository contains no `sorry`. I checked the axioms of the six exported the
The library and every generated module use Lean's module system. Each file has a `module` header, and imports are `public import`. The generated code separates its public API from its internals:
- A generated parser exposes its value type, `parse`, `diagnose` and `errorMessage`. It also exposes `run`, because the theorems are stated about it, but `run` is not a stable interface. The LR tables, `decode` and `sem` are internal, so a caller that imports the parser sees only the API. The specification module reaches the internals with `import all`, which is allowed because both modules are in the same package, and uses them in its refinement proofs.
-- A generated lexer exposes the token type, `tokenize` and `tokenizeByte`. The DFA tables and validator certificates are internal.
+- A generated lexer exposes the token type, `tokenize` and `tokenizeByte`. The DFA tables and validator certificates are internal. `tokenizeByte_toOption` relates `tokenizeByte` to `tokenize`: both succeed on the same inputs, with the same token values.
- The specification module is exposed in full, because its grammar, automaton, dependent types and exported theorems are what proofs use.
`native_decide` runs at the meta phase, so a module that a generated `native_decide` certificate reduces is also imported with `meta import`. This does not change the trust boundary or the axioms listed above. [`DESIGN.md`](DESIGN.md) §16.2 has the full design.
diff --git a/docs/LEXER.md b/docs/LEXER.md
index 989e3d3..7cbe279 100644
--- a/docs/LEXER.md
+++ b/docs/LEXER.md
@@ -123,4 +123,21 @@ The generated module does not state constructor coverage or synthesize reachabil
## Byte runtime
-`FooLexer.tokenizeByte` is the byte-oriented path. Its tables are derived from the validated flat character tables, and `byteValidatedN` checks their agreement. This path is separate from the current roundtrip theorem, which is stated about `tokenizeBare`.
+`FooLexer.tokenizeByte` is the byte-oriented path. Its tables are derived from the validated flat character tables. `byteUnicodeValidated` (`Lexer.byteValidAll`, all modes) checks their agreement at every character, and `posLexerAgrees` proves from it that `Lexer.lexPos cbyte`, the positioned byte lexer that `parseStr` pulls from, returns what `tokenize` returns (tokens and spans), or both fail. `tokenizeByte` is `lexPos` without the spans (`Lexer.tokenizeByte_eq_lexPos`), and `tokenizeByte_toOption` states `(tokenizeByte s).toOption = (tokenize s).toOption.map (List.map (·.val))`. This path is separate from the current roundtrip theorem, which is stated about `tokenizeBare`.
+
+A lexer module also emits `noEofEmit` (no rule emits the `%eof` token) when that token carries no value, and, for one mode whose rules all stay:
+
+- `tokenize_sound`: a successful `tokenize` is a maximal-munch `Lexer.Tokenization` of the input and the spec `Lexer.tokenize lexer` returns the same token values;
+- `tokenize_complete`: if the input has a maximal-munch `Lexer.Lexing` with steps `steps` (each step a rule and a length, `Lexer/Lexing.lean`), `tokenize` succeeds and its token values are `Lexer.lexingTokens lexer lexer.start input.toList steps`. `Lexer.Lexing.unique` states that the steps are determined by the input;
+- `Lexes s ts`, the positioned tokenization of `s` (`Lexer.PosLexing`): each token's span `⟨p.offset, q.offset⟩` delimits its lexeme `s.extract p q`, the maximal-munch match at `p`; a rule whose action emits nothing (a skip) consumes the bytes between two tokens; the end-of-input token has the empty span at the end. `Lexer.PosLexing.spans_ordered` states that the spans lie in the input and that each ends at or before the next starts;
+- `tokenize_iff_lexes : tokenize s = .ok ts ↔ Lexes s ts`, `lexPos_iff_lexes` (the same for the byte lexer `lexPos`, through `posLexerAgrees`), and `lexes_unique`;
+- `lexes_eof_last`, when the `%eof` token carries no value: `Lexes s ts` gives `ts = ts0 ++ [⟨EOF, Span.point s.endPos.offset⟩]` with no `EOF` in `ts0` (from `noEofEmit`). The verified module uses it to show that an accepting parse tree covers all of `ts`.
+
+`noEofEmit` is one proof per rule. A constructor application is closed by `nofun`. For a rule whose action calls a helper `h` (for example keyword folding), the proof tries two tactics in order:
+
+1. `unfold h`, split on every `match`/`if`, and close each branch by `contradiction`. Each branch must then be a constructor application. This covers Cedar's `keywordOrIdentifier`.
+2. `simp [h, d₁, …, dₙ]`, where `d₁ … dₙ` are the names after `def`/`abbrev` in `%lexerheader`, then split and close each branch by `simp_all`. This covers a helper that calls another `%lexerheader` helper, or that branches on a `let`-bound value.
+
+The second tactic only runs when the first fails, so it adds no check time to the fixture lexers. If both fail, the generated lexer does not compile. That is the case for a helper whose result comes from a lookup in a table (`List.lookup`, `Option.getD` over a list of tokens), from a `partial def`, or from a definition outside `%lexerheader`. It is also the case when a rule can emit the `%eof` token, where the lex-failure theorems are false.
+
+I looked for a decidable check on the rule actions that would replace these proofs, and did not find one. The property is `∀ s : String, tok s ≠ EOF`, a statement about every string, and a helper is an arbitrary Lean function given as source text, not data the generator or `native_decide` can evaluate on all inputs. A check on the action text could only accept the shapes the two tactics above already prove. I also tried `grind` on a scratch copy of Cedar's helper and on nested and table-lookup helpers. `grind [h, d₁, …, dₙ]` failed on the Cedar-shaped helper, the nested helper and the `Option.getD` lookup. `unfold h; grind` proved the Cedar-shaped helper, in 57 ms against 28 ms for the split proof, and adds nothing the second tactic does not cover, so it is not used.
diff --git a/lakefile.lean b/lakefile.lean
index 5ce8b87..0d6a4f8 100644
--- a/lakefile.lean
+++ b/lakefile.lean
@@ -201,6 +201,8 @@ lean_lib «VerifiedSmoke» where
`calc.CalcLexerRoundtripSupport, `calc.CalcLexerRoundtrip,
`calc.CalcUnparse, `calc.CalcParserRoundtrip, `calc.CalcParserRoundtripProof,
`asm.AsmAst, `asm.AsmLexer, `asm.AsmParser, `asm.AsmVerified,
+ -- A grammar whose actions read spans (`w_span`).
+ `spanuse.SpanUseLexer, `spanuse.SpanUseParser, `spanuse.SpanUseVerified,
]
needs := #[parsers]
diff --git a/test/README.md b/test/README.md
index 3e415af..38d69c8 100644
--- a/test/README.md
+++ b/test/README.md
@@ -103,12 +103,14 @@ a small recursive function in `imp/ParserTestImp.lean`.
`asm/asm.lig`, `calc/calc.lig`, `cedar/cedar.lig`, `cedarentities/CedarEntities.lig`
and `spanuse/SpanUse.lig` set `%option parseStr`, so their `*Parser.lean` modules also
define `runStream`/`parseStr : String → …` with their theorems, and their
-`*Verified.lean` modules the transfer theorems over `PosLexerAgrees` and
-`SpanIndependent` (DESIGN §13). `SpanIndependent` is proved for `asm`, `calc`, `cedar`
-and `cedarentities` (`spanIndependent`, `parse_eq_dependent_spans`); `PosLexerAgrees`
-is not proved for any of them. `cedarschema` and `rustactions` do not opt in, and
-`imp` and `c99` have no `%lexer` block. `SpanIndependent` is false for `spanuse`, whose
-action reads `w_span`; no target builds `spanuse/SpanUseVerified.lean`.
+`*Verified.lean` modules the transfer theorems to `parseStr` and the end-to-end
+corollaries (DESIGN §13), including completeness and unambiguity from the string
+(`parseStr_complete_lexing`, `parseStr_unambiguous`, `parseStr_*_lexes`,
+`parseStr_node_spans`). `PosLexerAgrees` is a theorem of every lexer module
+(`posLexerAgrees`), and the dependent specification has spans, so these theorems take no
+hypothesis. `spanuse`'s action reads `w_span`; `spanuse/SpanUseVerified.lean` is in
+`VerifiedSmoke`. `cedarschema` and `rustactions` do not opt in, and `imp` and `c99` have
+no `%lexer` block.
`BENCH_STREAM=1 lake exe asm-bench …` runs `--dump` and the lex+parse phase through
`AsmParser.parseStr` instead of `tokenize` followed by `parse`; see `asm/README.md`.
diff --git a/test/asm/AsmLexer.lean b/test/asm/AsmLexer.lean
index c59e7f0..93cc41d 100644
--- a/test/asm/AsmLexer.lean
+++ b/test/asm/AsmLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
public import asm.AsmAst
@@ -473,9 +477,93 @@ theorem AsmLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees AsmLexer.fastActs AsmLexer.cbyte.flat.base.acts :=
AsmLexer.fastActs_agree
-theorem AsmLexer.byteValidated0 :
- Lexer.byteValidate (AsmLexer.cbyte.bytes.getD 0 default)
- (AsmLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def AsmLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte AsmLexer.cbyte input
+
+theorem AsmLexer.byteUnicodeValidated : Lexer.byteValidAll AsmLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem AsmLexer.posLexerAgrees : Lexer.PosLexerAgrees AsmLexer.cbyte AsmLexer.tokenize := by
+ intro s
+ rw [AsmLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll AsmLexer.cbyte AsmLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem AsmLexer.tokenizeByte_toOption (s : String) :
+ (AsmLexer.tokenizeByte s).toOption = (AsmLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption AsmLexer.cbyte AsmLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem AsmLexer.noEofEmit :
+ ∀ m r, (AsmLexer.fastActs.get m r).emit = true → ∀ s, (AsmLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL AsmLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) Lexer.AllL.nil))))))))))))))))))))))))))))))))))))))))))))
+ Lexer.AllL.nil)
+
+theorem AsmLexer.stay0 : ∀ r, (AsmLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL AsmLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil)))))))))))))))))))))))))))))))))))))))))))) Lexer.AllL.nil) 0
+
+theorem AsmLexer.textIndep0 : ∀ r, AsmLexer.cflat.needsText 0 r = false →
+ ∀ s, (AsmLexer.fastActs.get 0 r).toAct s = (AsmLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ AsmLexer.fastActs (AsmLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun Lexer.Forall₂.nil))))))))))))))))))))))))))))))))))))))))))))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem AsmLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : AsmLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization AsmLexer.rules0 input.toList ∧
+ Lexer.tokenize AsmLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound AsmLexer.cflat AsmLexer.fastActs AsmLexer.fastActs_agree
+ AsmLexer.validated0 rfl AsmLexer.flatValidated0 (by decide) AsmLexer.stay0
+ AsmLexer.textIndep0 (by rw [← AsmLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem AsmLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing AsmLexer.rules0 input.toList steps) :
+ ∃ ts, AsmLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens AsmLexer.lexer AsmLexer.lexer.start input.toList steps := by
+ rw [AsmLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete AsmLexer.cflat AsmLexer.fastActs AsmLexer.fastActs_agree
+ AsmLexer.validated0 rfl AsmLexer.flatValidated0 (by decide) AsmLexer.stay0
+ AsmLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev AsmLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing AsmLexer.rules0 (Lexer.modeAct AsmLexer.lexer AsmLexer.lexer.start)
+ AsmLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem AsmLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ AsmLexer.tokenize s = .ok ts ↔ AsmLexer.Lexes s ts := by
+ rw [AsmLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' AsmLexer.cflat AsmLexer.fastActs
+ AsmLexer.fastActs_agree AsmLexer.validated0 rfl AsmLexer.flatValidated0 (by decide)
+ AsmLexer.stay0 AsmLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem AsmLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos AsmLexer.cbyte s = .ok ts ↔ AsmLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff AsmLexer.posLexerAgrees s ts).trans (AsmLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem AsmLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : AsmLexer.Lexes s ts₁) (h₂ : AsmLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem AsmLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : AsmLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees AsmLexer.lexer AsmLexer.fastActs AsmLexer.fastActs_agree
+ _ AsmLexer.noEofEmit _) h
diff --git a/test/asm/AsmParser.lean b/test/asm/AsmParser.lean
index 46acf67..3ef4a81 100644
--- a/test/asm/AsmParser.lean
+++ b/test/asm/AsmParser.lean
@@ -153,222 +153,115 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def semS : Nat → List VP → Runtime.Span
- | 0, [(ss_span, .v15 ss)] => ss_span
- | 1, [(__s0, _), (n_span, .v28 n)] => Runtime.Span.merge __s0 n_span
- | 2, [(__s0, _), (n_span, .v29 n)] => Runtime.Span.merge __s0 n_span
- | 3, [(__s0, _), (n_span, .v28 n)] => Runtime.Span.merge __s0 n_span
- | 4, [(__s0, _), (__s1, _), (xs_span, .v16 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 5, [(__s0, _), (__s1, _), (xs_span, .v16 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 6, [(__s0, _), (__s1, _), (xs_span, .v16 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 7, [(__s0, _), (__s1, _), (xs_span, .v17 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 8, [(__s0, _), (__s1, _), (xs_span, .v18 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 9, [(__s0, _), (__s1, _), (xs_span, .v19 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 10, [(__s0, _), (__s1, _), (xs_span, .v20 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 11, [(__s0, _), (__s1, _), (xs_span, .v21 xs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 12, [(__s0, _), (es_span, .v9 es)] => Runtime.Span.merge __s0 es_span
- | 13, [(n_span, .v28 n), (__s1, _), (t_span, .v28 t), (__s3, _), (ds_span, .v22 ds), (__s5, _), (p_span, .v23 p)] => Runtime.Span.merge n_span p_span
- | 14, [(n_span, .v28 n), (__s1, _), (t_span, .v28 t), (__s3, _), (ds_span, .v22 ds), (__s5, _), (__s6, _), (v_span, .v7 v)] => Runtime.Span.merge n_span v_span
- | 15, [(n_span, .v28 n), (__s1, _), (__s2, _), (rs_span, .v19 rs), (__s4, _)] => Runtime.Span.merge n_span __s4
- | 16, [(__s0, _), (xs_span, .v22 xs), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 17, [(k_span, .v28 k), (__s1, _), (v_span, .v7 v)] => Runtime.Span.merge k_span v_span
- | 18, [(n_span, .v29 n)] => n_span
- | 19, [(__s0, _), (n_span, .v29 n)] => Runtime.Span.merge __s0 n_span
- | 20, [(h_span, .v28 h)] => h_span
- | 21, [(f_span, .v28 f)] => f_span
- | 22, [(s_span, .v28 s)] => s_span
- | 23, [(x_span, .v28 x)] => x_span
- | 24, [(__s0, _), (vs_span, .v24 vs), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 25, [(n_span, .v28 n), (__s1, _), (ms_span, .v25 ms)] => Runtime.Span.merge n_span ms_span
- | 26, [(xs_span, .v9 xs), (e_span, .v10 e)] => Runtime.Span.merge xs_span e_span
- | 27, [] => Runtime.Span.dummy
- | 28, [(l_span, .v28 l)] => l_span
- | 29, [(__s0, _), (n_span, .v29 n)] => Runtime.Span.merge __s0 n_span
- | 30, [(__s0, _), (n_span, .v29 n)] => Runtime.Span.merge __s0 n_span
- | 31, [(i_span, .v11 i)] => i_span
- | 32, [(op_span, .v28 op), (ty_span, .v23 ty), (os_span, .v26 os)] => Runtime.Span.merge op_span os_span
- | 33, [(r_span, .v28 r)] => r_span
- | 34, [(r_span, .v28 r)] => r_span
- | 35, [(r_span, .v28 r)] => r_span
- | 36, [(r_span, .v28 r)] => r_span
- | 37, [(a_span, .v28 a)] => a_span
- | 38, [(__s0, _), (n_span, .v28 n)] => Runtime.Span.merge __s0 n_span
- | 39, [(__s0, _), (n_span, .v28 n), (__s2, _), (k_span, .v29 k)] => Runtime.Span.merge __s0 k_span
- | 40, [(l_span, .v13 l)] => l_span
- | 41, [(x_span, .v28 x)] => x_span
- | 42, [(x_span, .v28 x), (__s1, _), (ixs_span, .v27 ixs), (__s3, _)] => Runtime.Span.merge x_span __s3
- | 43, [(__s0, _), (rs_span, .v25 rs), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 44, [(n_span, .v29 n)] => n_span
- | 45, [(h_span, .v28 h)] => h_span
- | 46, [(b_span, .v28 b)] => b_span
- | 47, [(f_span, .v28 f)] => f_span
- | 48, [(__s0, _), (l_span, .v13 l)] => Runtime.Span.merge __s0 l_span
- | 49, [(a_span, .v14 a)] => a_span
- | 50, [(x_span, .v14 x), (__s1, _), (a_span, .v14 a)] => Runtime.Span.merge x_span a_span
- | 51, [(x_span, .v14 x), (__s1, _), (a_span, .v14 a)] => Runtime.Span.merge x_span a_span
- | 52, [(r_span, .v28 r)] => r_span
- | 53, [(x_span, .v28 x)] => x_span
- | 54, [(n_span, .v29 n)] => n_span
- | 55, [] => Runtime.Span.dummy
- | 56, [(xs_span, .v15 xs), (x_span, .v1 x)] => Runtime.Span.merge xs_span x_span
- | 57, [] => Runtime.Span.dummy
- | 58, [(xs_span, .v16 xs)] => xs_span
- | 59, [(x_span, .v2 x)] => x_span
- | 60, [(xs_span, .v16 xs), (__s1, _), (x_span, .v2 x)] => Runtime.Span.merge xs_span x_span
- | 61, [] => Runtime.Span.dummy
- | 62, [(xs_span, .v17 xs)] => xs_span
- | 63, [(x_span, .v3 x)] => x_span
- | 64, [(xs_span, .v17 xs), (__s1, _), (x_span, .v3 x)] => Runtime.Span.merge xs_span x_span
- | 65, [] => Runtime.Span.dummy
- | 66, [(xs_span, .v18 xs)] => xs_span
- | 67, [(x_span, .v4 x)] => x_span
- | 68, [(xs_span, .v18 xs), (__s1, _), (x_span, .v4 x)] => Runtime.Span.merge xs_span x_span
- | 69, [] => Runtime.Span.dummy
- | 70, [(xs_span, .v19 xs)] => xs_span
- | 71, [(x_span, .v5 x)] => x_span
- | 72, [(xs_span, .v19 xs), (__s1, _), (x_span, .v5 x)] => Runtime.Span.merge xs_span x_span
- | 73, [] => Runtime.Span.dummy
- | 74, [(xs_span, .v20 xs)] => xs_span
- | 75, [(x_span, .v6 x)] => x_span
- | 76, [(xs_span, .v20 xs), (__s1, _), (x_span, .v6 x)] => Runtime.Span.merge xs_span x_span
- | 77, [] => Runtime.Span.dummy
- | 78, [(xs_span, .v21 xs)] => xs_span
- | 79, [(x_span, .v8 x)] => x_span
- | 80, [(xs_span, .v21 xs), (__s1, _), (x_span, .v8 x)] => Runtime.Span.merge xs_span x_span
- | 81, [] => Runtime.Span.dummy
- | 82, [(xs_span, .v22 xs)] => xs_span
- | 83, [(x_span, .v29 x)] => x_span
- | 84, [(xs_span, .v22 xs), (__s1, _), (x_span, .v29 x)] => Runtime.Span.merge xs_span x_span
- | 85, [] => Runtime.Span.dummy
- | 86, [(x_span, .v28 x)] => x_span
- | 87, [] => Runtime.Span.dummy
- | 88, [(xs_span, .v24 xs)] => xs_span
- | 89, [(x_span, .v7 x)] => x_span
- | 90, [(xs_span, .v24 xs), (__s1, _), (x_span, .v7 x)] => Runtime.Span.merge xs_span x_span
- | 91, [(x_span, .v28 x)] => x_span
- | 92, [(xs_span, .v25 xs), (__s1, _), (x_span, .v28 x)] => Runtime.Span.merge xs_span x_span
- | 93, [] => Runtime.Span.dummy
- | 94, [(x_span, .v28 x)] => x_span
- | 95, [] => Runtime.Span.dummy
- | 96, [(xs_span, .v26 xs)] => xs_span
- | 97, [(x_span, .v12 x)] => x_span
- | 98, [(xs_span, .v26 xs), (__s1, _), (x_span, .v12 x)] => Runtime.Span.merge xs_span x_span
- | 99, [(x_span, .v14 x)] => x_span
- | 100, [(xs_span, .v27 xs), (__s1, _), (x_span, .v14 x)] => Runtime.Span.merge xs_span x_span
- | 101, [(x_span, .v28 x)] => x_span
- | 102, [(xs_span, .v25 xs), (__s1, _), (x_span, .v28 x)] => Runtime.Span.merge xs_span x_span
- | 103, [x, _] => x.1
- | _, _ => Runtime.Span.dummy
-
-def semV : Nat → List V → V
- | 0, [.v15 ss] => .v0 (ss)
- | 1, [_, .v28 n] => .v1 (Section.arch n)
- | 2, [_, .v29 n] => .v1 (Section.unit n)
- | 3, [_, .v28 n] => .v1 (Section.entry n)
- | 4, [_, _, .v16 xs, _] => .v1 (Section.buffers xs)
- | 5, [_, _, .v16 xs, _] => .v1 (Section.params xs)
- | 6, [_, _, .v16 xs, _] => .v1 (Section.temps xs)
- | 7, [_, _, .v17 xs, _] => .v1 (Section.consts xs)
- | 8, [_, _, .v18 xs, _] => .v1 (Section.layout xs)
- | 9, [_, _, .v19 xs, _] => .v1 (Section.groups xs)
- | 10, [_, _, .v20 xs, _] => .v1 (Section.settings xs)
- | 11, [_, _, .v21 xs, _] => .v1 (Section.links xs)
- | 12, [_, .v9 es] => .v1 (Section.code es)
- | 13, [.v28 n, _, .v28 t, _, .v22 ds, _, .v23 p] => .v2 ({ name := n, ty := t, dims := ds, place := p })
- | 14, [.v28 n, _, .v28 t, _, .v22 ds, _, _, .v7 v] => .v3 ({ name := n, ty := t, dims := ds, init := v })
- | 15, [.v28 n, _, _, .v19 rs, _] => .v4 ({ name := n, rows := rs })
- | 16, [_, .v22 xs, _] => .v5 (xs)
- | 17, [.v28 k, _, .v7 v] => .v6 ({ key := k, value := v })
- | 18, [.v29 n] => .v7 (Value.num n)
- | 19, [_, .v29 n] => .v7 (Value.neg n)
- | 20, [.v28 h] => .v7 (Value.hex h)
- | 21, [.v28 f] => .v7 (Value.real f)
- | 22, [.v28 s] => .v7 (Value.str s)
- | 23, [.v28 x] => .v7 (Value.id x)
- | 24, [_, .v24 vs, _] => .v7 (Value.list vs)
- | 25, [.v28 n, _, .v25 ms] => .v8 ({ name := n, members := ms })
- | 26, [.v9 xs, .v10 e] => .v9 (xs.push e)
- | 27, [] => .v9 (#[])
- | 28, [.v28 l] => .v10 (Entry.label l)
- | 29, [_, .v29 n] => .v10 (Entry.mark n)
- | 30, [_, .v29 n] => .v10 (Entry.align n)
- | 31, [.v11 i] => .v10 (Entry.instr i)
- | 32, [.v28 op, .v23 ty, .v26 os] => .v11 ({ op := op, ty := ty, args := os })
- | 33, [.v28 r] => .v12 (Operand.greg r)
- | 34, [.v28 r] => .v12 (Operand.vreg r)
- | 35, [.v28 r] => .v12 (Operand.vpair r)
- | 36, [.v28 r] => .v12 (Operand.preg r)
- | 37, [.v28 a] => .v12 (Operand.addr a)
- | 38, [_, .v28 n] => .v12 (Operand.symAddr n 0)
- | 39, [_, .v28 n, _, .v29 k] => .v12 (Operand.symAddr n k)
- | 40, [.v13 l] => .v12 (Operand.imm l)
- | 41, [.v28 x] => .v12 (Operand.sym x)
- | 42, [.v28 x, _, .v27 ixs, _] => .v12 (Operand.tensor x ixs)
- | 43, [_, .v25 rs, _] => .v12 (Operand.regSet rs)
- | 44, [.v29 n] => .v13 (Lit.dec n)
- | 45, [.v28 h] => .v13 (Lit.hex h)
- | 46, [.v28 b] => .v13 (Lit.bin b)
- | 47, [.v28 f] => .v13 (Lit.real f)
- | 48, [_, .v13 l] => .v13 (Lit.neg l)
- | 49, [.v14 a] => .v14 (a)
- | 50, [.v14 x, _, .v14 a] => .v14 (Ix.add x a)
- | 51, [.v14 x, _, .v14 a] => .v14 (Ix.mul x a)
- | 52, [.v28 r] => .v14 (Ix.reg r)
- | 53, [.v28 x] => .v14 (Ix.var x)
- | 54, [.v29 n] => .v14 (Ix.lit n)
- | 55, [] => .v15 (#[])
- | 56, [.v15 xs, .v1 x] => .v15 (xs.push x)
- | 57, [] => .v16 (#[])
- | 58, [.v16 xs] => .v16 (xs)
- | 59, [.v2 x] => .v16 ((Array.emptyWithCapacity 4).push x)
- | 60, [.v16 xs, _, .v2 x] => .v16 (xs.push x)
- | 61, [] => .v17 (#[])
- | 62, [.v17 xs] => .v17 (xs)
- | 63, [.v3 x] => .v17 ((Array.emptyWithCapacity 4).push x)
- | 64, [.v17 xs, _, .v3 x] => .v17 (xs.push x)
- | 65, [] => .v18 (#[])
- | 66, [.v18 xs] => .v18 (xs)
- | 67, [.v4 x] => .v18 ((Array.emptyWithCapacity 4).push x)
- | 68, [.v18 xs, _, .v4 x] => .v18 (xs.push x)
- | 69, [] => .v19 (#[])
- | 70, [.v19 xs] => .v19 (xs)
- | 71, [.v5 x] => .v19 ((Array.emptyWithCapacity 4).push x)
- | 72, [.v19 xs, _, .v5 x] => .v19 (xs.push x)
- | 73, [] => .v20 (#[])
- | 74, [.v20 xs] => .v20 (xs)
- | 75, [.v6 x] => .v20 ((Array.emptyWithCapacity 4).push x)
- | 76, [.v20 xs, _, .v6 x] => .v20 (xs.push x)
- | 77, [] => .v21 (#[])
- | 78, [.v21 xs] => .v21 (xs)
- | 79, [.v8 x] => .v21 ((Array.emptyWithCapacity 4).push x)
- | 80, [.v21 xs, _, .v8 x] => .v21 (xs.push x)
- | 81, [] => .v22 (#[])
- | 82, [.v22 xs] => .v22 (xs)
- | 83, [.v29 x] => .v22 ((Array.emptyWithCapacity 4).push x)
- | 84, [.v22 xs, _, .v29 x] => .v22 (xs.push x)
- | 85, [] => .v23 (none)
- | 86, [.v28 x] => .v23 (some x)
- | 87, [] => .v24 (#[])
- | 88, [.v24 xs] => .v24 (xs)
- | 89, [.v7 x] => .v24 ((Array.emptyWithCapacity 4).push x)
- | 90, [.v24 xs, _, .v7 x] => .v24 (xs.push x)
- | 91, [.v28 x] => .v25 ((Array.emptyWithCapacity 4).push x)
- | 92, [.v25 xs, _, .v28 x] => .v25 (xs.push x)
- | 93, [] => .v23 (none)
- | 94, [.v28 x] => .v23 (some x)
- | 95, [] => .v26 (#[])
- | 96, [.v26 xs] => .v26 (xs)
- | 97, [.v12 x] => .v26 ((Array.emptyWithCapacity 4).push x)
- | 98, [.v26 xs, _, .v12 x] => .v26 (xs.push x)
- | 99, [.v14 x] => .v27 ((Array.emptyWithCapacity 4).push x)
- | 100, [.v27 xs, _, .v14 x] => .v27 (xs.push x)
- | 101, [.v28 x] => .v25 ((Array.emptyWithCapacity 4).push x)
- | 102, [.v25 xs, _, .v28 x] => .v25 (xs.push x)
- | 103, [x, _] => x
- | _, _ => .unit ()
-
-def sem (p : Nat) (args : List VP) : VP :=
- (semS p args, semV p (args.map Prod.snd))
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v15 ss] => .v0 (ss)
+ | 1, _, [_, .v28 n] => .v1 (Section.arch n)
+ | 2, _, [_, .v29 n] => .v1 (Section.unit n)
+ | 3, _, [_, .v28 n] => .v1 (Section.entry n)
+ | 4, _, [_, _, .v16 xs, _] => .v1 (Section.buffers xs)
+ | 5, _, [_, _, .v16 xs, _] => .v1 (Section.params xs)
+ | 6, _, [_, _, .v16 xs, _] => .v1 (Section.temps xs)
+ | 7, _, [_, _, .v17 xs, _] => .v1 (Section.consts xs)
+ | 8, _, [_, _, .v18 xs, _] => .v1 (Section.layout xs)
+ | 9, _, [_, _, .v19 xs, _] => .v1 (Section.groups xs)
+ | 10, _, [_, _, .v20 xs, _] => .v1 (Section.settings xs)
+ | 11, _, [_, _, .v21 xs, _] => .v1 (Section.links xs)
+ | 12, _, [_, .v9 es] => .v1 (Section.code es)
+ | 13, _, [.v28 n, _, .v28 t, _, .v22 ds, _, .v23 p] => .v2 ({ name := n, ty := t, dims := ds, place := p })
+ | 14, _, [.v28 n, _, .v28 t, _, .v22 ds, _, _, .v7 v] => .v3 ({ name := n, ty := t, dims := ds, init := v })
+ | 15, _, [.v28 n, _, _, .v19 rs, _] => .v4 ({ name := n, rows := rs })
+ | 16, _, [_, .v22 xs, _] => .v5 (xs)
+ | 17, _, [.v28 k, _, .v7 v] => .v6 ({ key := k, value := v })
+ | 18, _, [.v29 n] => .v7 (Value.num n)
+ | 19, _, [_, .v29 n] => .v7 (Value.neg n)
+ | 20, _, [.v28 h] => .v7 (Value.hex h)
+ | 21, _, [.v28 f] => .v7 (Value.real f)
+ | 22, _, [.v28 s] => .v7 (Value.str s)
+ | 23, _, [.v28 x] => .v7 (Value.id x)
+ | 24, _, [_, .v24 vs, _] => .v7 (Value.list vs)
+ | 25, _, [.v28 n, _, .v25 ms] => .v8 ({ name := n, members := ms })
+ | 26, _, [.v9 xs, .v10 e] => .v9 (xs.push e)
+ | 27, _, [] => .v9 (#[])
+ | 28, _, [.v28 l] => .v10 (Entry.label l)
+ | 29, _, [_, .v29 n] => .v10 (Entry.mark n)
+ | 30, _, [_, .v29 n] => .v10 (Entry.align n)
+ | 31, _, [.v11 i] => .v10 (Entry.instr i)
+ | 32, _, [.v28 op, .v23 ty, .v26 os] => .v11 ({ op := op, ty := ty, args := os })
+ | 33, _, [.v28 r] => .v12 (Operand.greg r)
+ | 34, _, [.v28 r] => .v12 (Operand.vreg r)
+ | 35, _, [.v28 r] => .v12 (Operand.vpair r)
+ | 36, _, [.v28 r] => .v12 (Operand.preg r)
+ | 37, _, [.v28 a] => .v12 (Operand.addr a)
+ | 38, _, [_, .v28 n] => .v12 (Operand.symAddr n 0)
+ | 39, _, [_, .v28 n, _, .v29 k] => .v12 (Operand.symAddr n k)
+ | 40, _, [.v13 l] => .v12 (Operand.imm l)
+ | 41, _, [.v28 x] => .v12 (Operand.sym x)
+ | 42, _, [.v28 x, _, .v27 ixs, _] => .v12 (Operand.tensor x ixs)
+ | 43, _, [_, .v25 rs, _] => .v12 (Operand.regSet rs)
+ | 44, _, [.v29 n] => .v13 (Lit.dec n)
+ | 45, _, [.v28 h] => .v13 (Lit.hex h)
+ | 46, _, [.v28 b] => .v13 (Lit.bin b)
+ | 47, _, [.v28 f] => .v13 (Lit.real f)
+ | 48, _, [_, .v13 l] => .v13 (Lit.neg l)
+ | 49, _, [.v14 a] => .v14 (a)
+ | 50, _, [.v14 x, _, .v14 a] => .v14 (Ix.add x a)
+ | 51, _, [.v14 x, _, .v14 a] => .v14 (Ix.mul x a)
+ | 52, _, [.v28 r] => .v14 (Ix.reg r)
+ | 53, _, [.v28 x] => .v14 (Ix.var x)
+ | 54, _, [.v29 n] => .v14 (Ix.lit n)
+ | 55, _, [] => .v15 (#[])
+ | 56, _, [.v15 xs, .v1 x] => .v15 (xs.push x)
+ | 57, _, [] => .v16 (#[])
+ | 58, _, [.v16 xs] => .v16 (xs)
+ | 59, _, [.v2 x] => .v16 ((Array.emptyWithCapacity 4).push x)
+ | 60, _, [.v16 xs, _, .v2 x] => .v16 (xs.push x)
+ | 61, _, [] => .v17 (#[])
+ | 62, _, [.v17 xs] => .v17 (xs)
+ | 63, _, [.v3 x] => .v17 ((Array.emptyWithCapacity 4).push x)
+ | 64, _, [.v17 xs, _, .v3 x] => .v17 (xs.push x)
+ | 65, _, [] => .v18 (#[])
+ | 66, _, [.v18 xs] => .v18 (xs)
+ | 67, _, [.v4 x] => .v18 ((Array.emptyWithCapacity 4).push x)
+ | 68, _, [.v18 xs, _, .v4 x] => .v18 (xs.push x)
+ | 69, _, [] => .v19 (#[])
+ | 70, _, [.v19 xs] => .v19 (xs)
+ | 71, _, [.v5 x] => .v19 ((Array.emptyWithCapacity 4).push x)
+ | 72, _, [.v19 xs, _, .v5 x] => .v19 (xs.push x)
+ | 73, _, [] => .v20 (#[])
+ | 74, _, [.v20 xs] => .v20 (xs)
+ | 75, _, [.v6 x] => .v20 ((Array.emptyWithCapacity 4).push x)
+ | 76, _, [.v20 xs, _, .v6 x] => .v20 (xs.push x)
+ | 77, _, [] => .v21 (#[])
+ | 78, _, [.v21 xs] => .v21 (xs)
+ | 79, _, [.v8 x] => .v21 ((Array.emptyWithCapacity 4).push x)
+ | 80, _, [.v21 xs, _, .v8 x] => .v21 (xs.push x)
+ | 81, _, [] => .v22 (#[])
+ | 82, _, [.v22 xs] => .v22 (xs)
+ | 83, _, [.v29 x] => .v22 ((Array.emptyWithCapacity 4).push x)
+ | 84, _, [.v22 xs, _, .v29 x] => .v22 (xs.push x)
+ | 85, _, [] => .v23 (none)
+ | 86, _, [.v28 x] => .v23 (some x)
+ | 87, _, [] => .v24 (#[])
+ | 88, _, [.v24 xs] => .v24 (xs)
+ | 89, _, [.v7 x] => .v24 ((Array.emptyWithCapacity 4).push x)
+ | 90, _, [.v24 xs, _, .v7 x] => .v24 (xs.push x)
+ | 91, _, [.v28 x] => .v25 ((Array.emptyWithCapacity 4).push x)
+ | 92, _, [.v25 xs, _, .v28 x] => .v25 (xs.push x)
+ | 93, _, [] => .v23 (none)
+ | 94, _, [.v28 x] => .v23 (some x)
+ | 95, _, [] => .v26 (#[])
+ | 96, _, [.v26 xs] => .v26 (xs)
+ | 97, _, [.v12 x] => .v26 ((Array.emptyWithCapacity 4).push x)
+ | 98, _, [.v26 xs, _, .v12 x] => .v26 (xs.push x)
+ | 99, _, [.v14 x] => .v27 ((Array.emptyWithCapacity 4).push x)
+ | 100, _, [.v27 xs, _, .v14 x] => .v27 (xs.push x)
+ | 101, _, [.v28 x] => .v25 ((Array.emptyWithCapacity 4).push x)
+ | 102, _, [.v25 xs, _, .v28 x] => .v25 (xs.push x)
+ | 103, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
def buildDense {α : Type} (n : Nat) (dflt : α) (cells : Array (Nat × α)) : Array α := Id.run do
let mut a : Array α := Array.replicate n dflt
@@ -524,6 +417,84 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c28 st _ _ _ _ => st
| .c29 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+ | .c7 _ _ e _ _ => e
+ | .c8 _ _ e _ _ => e
+ | .c9 _ _ e _ _ => e
+ | .c10 _ _ e _ _ => e
+ | .c11 _ _ e _ _ => e
+ | .c12 _ _ e _ _ => e
+ | .c13 _ _ e _ _ => e
+ | .c14 _ _ e _ _ => e
+ | .c15 _ _ e _ _ => e
+ | .c16 _ _ e _ _ => e
+ | .c17 _ _ e _ _ => e
+ | .c18 _ _ e _ _ => e
+ | .c19 _ _ e _ _ => e
+ | .c20 _ _ e _ _ => e
+ | .c21 _ _ e _ _ => e
+ | .c22 _ _ e _ _ => e
+ | .c23 _ _ e _ _ => e
+ | .c24 _ _ e _ _ => e
+ | .c25 _ _ e _ _ => e
+ | .c26 _ _ e _ _ => e
+ | .c27 _ _ e _ _ => e
+ | .c28 _ _ e _ _ => e
+ | .c29 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+ | .c7 st _ e _ _ => k st e
+ | .c8 st _ e _ _ => k st e
+ | .c9 st _ e _ _ => k st e
+ | .c10 st _ e _ _ => k st e
+ | .c11 st _ e _ _ => k st e
+ | .c12 st _ e _ _ => k st e
+ | .c13 st _ e _ _ => k st e
+ | .c14 st _ e _ _ => k st e
+ | .c15 st _ e _ _ => k st e
+ | .c16 st _ e _ _ => k st e
+ | .c17 st _ e _ _ => k st e
+ | .c18 st _ e _ _ => k st e
+ | .c19 st _ e _ _ => k st e
+ | .c20 st _ e _ _ => k st e
+ | .c21 st _ e _ _ => k st e
+ | .c22 st _ e _ _ => k st e
+ | .c23 st _ e _ _ => k st e
+ | .c24 st _ e _ _ => k st e
+ | .c25 st _ e _ _ => k st e
+ | .c26 st _ e _ _ => k st e
+ | .c27 st _ e _ _ => k st e
+ | .c28 st _ e _ _ => k st e
+ | .c29 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -621,6 +592,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionCells : Array (Nat × Runtime.Exec.Act) :=
#[(0, .reduce 55), (1, .reduce 55), (2, .reduce 55), (3, .reduce 55), (4, .reduce 55), (5, .reduce 55),
@@ -1014,7 +986,7 @@ def fuse26 : Stk → Stk :=
| _ => .fail stk
def fuse27 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 9 (Stk.top 0 __tail) (fun __st => .c9 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 9 __top (fun __st => .c9 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse28 : Stk → Stk :=
fun stk => match stk with
@@ -1152,7 +1124,7 @@ def fuse54 : Stk → Stk :=
| _ => .fail stk
def fuse55 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 16 (Stk.top 0 __tail) (fun __st => .c15 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 16 __top (fun __st => .c15 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse56 : Stk → Stk :=
fun stk => match stk with
@@ -1160,7 +1132,7 @@ def fuse56 : Stk → Stk :=
| _ => .fail stk
def fuse57 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 17 (Stk.top 0 __tail) (fun __st => .c16 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 17 __top (fun __st => .c16 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse58 : Stk → Stk :=
fun stk => match stk with
@@ -1178,7 +1150,7 @@ def fuse60 : Stk → Stk :=
| _ => .fail stk
def fuse61 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 19 (Stk.top 0 __tail) (fun __st => .c17 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 19 __top (fun __st => .c17 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse62 : Stk → Stk :=
fun stk => match stk with
@@ -1196,7 +1168,7 @@ def fuse64 : Stk → Stk :=
| _ => .fail stk
def fuse65 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 21 (Stk.top 0 __tail) (fun __st => .c18 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 21 __top (fun __st => .c18 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse66 : Stk → Stk :=
fun stk => match stk with
@@ -1214,7 +1186,7 @@ def fuse68 : Stk → Stk :=
| _ => .fail stk
def fuse69 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 23 (Stk.top 0 __tail) (fun __st => .c19 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 23 __top (fun __st => .c19 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse70 : Stk → Stk :=
fun stk => match stk with
@@ -1232,7 +1204,7 @@ def fuse72 : Stk → Stk :=
| _ => .fail stk
def fuse73 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 25 (Stk.top 0 __tail) (fun __st => .c20 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 25 __top (fun __st => .c20 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse74 : Stk → Stk :=
fun stk => match stk with
@@ -1250,7 +1222,7 @@ def fuse76 : Stk → Stk :=
| _ => .fail stk
def fuse77 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 27 (Stk.top 0 __tail) (fun __st => .c21 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 27 __top (fun __st => .c21 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse78 : Stk → Stk :=
fun stk => match stk with
@@ -1268,7 +1240,7 @@ def fuse80 : Stk → Stk :=
| _ => .fail stk
def fuse81 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 29 (Stk.top 0 __tail) (fun __st => .c22 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 29 __top (fun __st => .c22 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse82 : Stk → Stk :=
fun stk => match stk with
@@ -1286,7 +1258,7 @@ def fuse84 : Stk → Stk :=
| _ => .fail stk
def fuse85 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 31 (Stk.top 0 __tail) (fun __st => .c23 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 31 __top (fun __st => .c23 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse86 : Stk → Stk :=
fun stk => match stk with
@@ -1294,7 +1266,7 @@ def fuse86 : Stk → Stk :=
| _ => .fail stk
def fuse87 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 32 (Stk.top 0 __tail) (fun __st => .c24 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 32 __top (fun __st => .c24 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse88 : Stk → Stk :=
fun stk => match stk with
@@ -1322,7 +1294,7 @@ def fuse92 : Stk → Stk :=
| _ => .fail stk
def fuse93 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 35 (Stk.top 0 __tail) (fun __st => .c23 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 35 __top (fun __st => .c23 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse94 : Stk → Stk :=
fun stk => match stk with
@@ -1330,7 +1302,7 @@ def fuse94 : Stk → Stk :=
| _ => .fail stk
def fuse95 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 41 36 (Stk.top 0 __tail) (fun __st => .c26 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 41 36 __top (fun __st => .c26 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse96 : Stk → Stk :=
fun stk => match stk with
@@ -1395,6 +1367,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -1641,9 +1614,9 @@ theorem fuseOK26 : Runtime.Exec.FuseOKAt stackOps flat 26 fuse26 := by
theorem fuseOK27 : Runtime.Exec.FuseOKAt stackOps flat 27 fuse27 := by
intro stk
- unfold fuse27
+ simp only [fuse27, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 27
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 27
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK28 : Runtime.Exec.FuseOKAt stackOps flat 28 fuse28 := by
@@ -1891,9 +1864,9 @@ theorem fuseOK54 : Runtime.Exec.FuseOKAt stackOps flat 54 fuse54 := by
theorem fuseOK55 : Runtime.Exec.FuseOKAt stackOps flat 55 fuse55 := by
intro stk
- unfold fuse55
+ simp only [fuse55, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 55
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 55
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK56 : Runtime.Exec.FuseOKAt stackOps flat 56 fuse56 := by
@@ -1907,9 +1880,9 @@ theorem fuseOK56 : Runtime.Exec.FuseOKAt stackOps flat 56 fuse56 := by
theorem fuseOK57 : Runtime.Exec.FuseOKAt stackOps flat 57 fuse57 := by
intro stk
- unfold fuse57
+ simp only [fuse57, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 57
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 57
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK58 : Runtime.Exec.FuseOKAt stackOps flat 58 fuse58 := by
@@ -1941,9 +1914,9 @@ theorem fuseOK60 : Runtime.Exec.FuseOKAt stackOps flat 60 fuse60 := by
theorem fuseOK61 : Runtime.Exec.FuseOKAt stackOps flat 61 fuse61 := by
intro stk
- unfold fuse61
+ simp only [fuse61, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 61
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 61
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK62 : Runtime.Exec.FuseOKAt stackOps flat 62 fuse62 := by
@@ -1975,9 +1948,9 @@ theorem fuseOK64 : Runtime.Exec.FuseOKAt stackOps flat 64 fuse64 := by
theorem fuseOK65 : Runtime.Exec.FuseOKAt stackOps flat 65 fuse65 := by
intro stk
- unfold fuse65
+ simp only [fuse65, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 65
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 65
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK66 : Runtime.Exec.FuseOKAt stackOps flat 66 fuse66 := by
@@ -2009,9 +1982,9 @@ theorem fuseOK68 : Runtime.Exec.FuseOKAt stackOps flat 68 fuse68 := by
theorem fuseOK69 : Runtime.Exec.FuseOKAt stackOps flat 69 fuse69 := by
intro stk
- unfold fuse69
+ simp only [fuse69, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 69
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 69
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK70 : Runtime.Exec.FuseOKAt stackOps flat 70 fuse70 := by
@@ -2043,9 +2016,9 @@ theorem fuseOK72 : Runtime.Exec.FuseOKAt stackOps flat 72 fuse72 := by
theorem fuseOK73 : Runtime.Exec.FuseOKAt stackOps flat 73 fuse73 := by
intro stk
- unfold fuse73
+ simp only [fuse73, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 73
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 73
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK74 : Runtime.Exec.FuseOKAt stackOps flat 74 fuse74 := by
@@ -2077,9 +2050,9 @@ theorem fuseOK76 : Runtime.Exec.FuseOKAt stackOps flat 76 fuse76 := by
theorem fuseOK77 : Runtime.Exec.FuseOKAt stackOps flat 77 fuse77 := by
intro stk
- unfold fuse77
+ simp only [fuse77, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 77
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 77
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK78 : Runtime.Exec.FuseOKAt stackOps flat 78 fuse78 := by
@@ -2111,9 +2084,9 @@ theorem fuseOK80 : Runtime.Exec.FuseOKAt stackOps flat 80 fuse80 := by
theorem fuseOK81 : Runtime.Exec.FuseOKAt stackOps flat 81 fuse81 := by
intro stk
- unfold fuse81
+ simp only [fuse81, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 81
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 81
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK82 : Runtime.Exec.FuseOKAt stackOps flat 82 fuse82 := by
@@ -2145,9 +2118,9 @@ theorem fuseOK84 : Runtime.Exec.FuseOKAt stackOps flat 84 fuse84 := by
theorem fuseOK85 : Runtime.Exec.FuseOKAt stackOps flat 85 fuse85 := by
intro stk
- unfold fuse85
+ simp only [fuse85, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 85
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 85
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK86 : Runtime.Exec.FuseOKAt stackOps flat 86 fuse86 := by
@@ -2161,9 +2134,9 @@ theorem fuseOK86 : Runtime.Exec.FuseOKAt stackOps flat 86 fuse86 := by
theorem fuseOK87 : Runtime.Exec.FuseOKAt stackOps flat 87 fuse87 := by
intro stk
- unfold fuse87
+ simp only [fuse87, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 87
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 87
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK88 : Runtime.Exec.FuseOKAt stackOps flat 88 fuse88 := by
@@ -2213,9 +2186,9 @@ theorem fuseOK92 : Runtime.Exec.FuseOKAt stackOps flat 92 fuse92 := by
theorem fuseOK93 : Runtime.Exec.FuseOKAt stackOps flat 93 fuse93 := by
intro stk
- unfold fuse93
+ simp only [fuse93, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 93
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 93
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK94 : Runtime.Exec.FuseOKAt stackOps flat 94 fuse94 := by
@@ -2229,9 +2202,9 @@ theorem fuseOK94 : Runtime.Exec.FuseOKAt stackOps flat 94 fuse94 := by
theorem fuseOK95 : Runtime.Exec.FuseOKAt stackOps flat 95 fuse95 := by
intro stk
- unfold fuse95
+ simp only [fuse95, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 95
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 95
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK96 : Runtime.Exec.FuseOKAt stackOps flat 96 fuse96 := by
@@ -2360,19 +2333,6 @@ theorem parseStr_total (input : String) (k : Nat) :
· left; rw [h]
· right; rw [h]
-theorem semSpanFree : Runtime.Exec.SemSpanFree sem :=
- Runtime.Exec.SemSpanFree.of_split semS semV
-
-theorem parse_spanIndependent : Runtime.Exec.SpanIndependent (fun ts k => parse ts k) :=
- Runtime.Exec.SpanIndependent.of_run flat.toExecTable semSpanFree termOf valOf
- (fun r => match r with | .ok (.v0 x) => some x | _ => none) (by
- intro ts k
- unfold parse run
- rw [Runtime.Exec.runFast_eq_run stackOps flat fuse termOf valOf stackLawful fuseOK]
- cases Runtime.Exec.run flat.toExecTable (ts.map (Runtime.Exec.decodeWith termOf valOf)) k with
- | ok v => obtain ⟨_, v⟩ := v; cases v <;> rfl
- | _ => rfl)
-
/-- The readable name of a terminal index (EOF is "end of input"). -/
def terminalName : Nat → String
| 0 => "D_ARCH"
diff --git a/test/asm/AsmVerified.lean b/test/asm/AsmVerified.lean
index a29b88c..dc2fcf9 100644
--- a/test/asm/AsmVerified.lean
+++ b/test/asm/AsmVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -28,6 +30,9 @@ public import asm.AsmParser
import all asm.AsmParser
meta import asm.AsmParser
public import LeanParserGenerator.Lexer.StreamRun
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.SpanText
+public import LeanParserGenerator.Runtime.ParseEnd
public import asm.AsmLexer
@@ -44,6 +49,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace AsmVerified
abbrev Terminal := Fin 41
@@ -301,91 +308,91 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 40
augmentedProduction := 103 }
-def semTbl : List (Σ T : Type, T → AsmParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v29 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Program : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Section : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(BufDecl : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(ConstDecl : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Grid : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Array Nat : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(Setting : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Value : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(Link : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(Array Entry : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(Entry : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(Instr : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(Operand : Type), fun v => (Runtime.Span.dummy, .v12 v)⟩,
- ⟨(Lit : Type), fun v => (Runtime.Span.dummy, .v13 v)⟩,
- ⟨(Ix : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Ix : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Array (Section) : Type), fun v => (Runtime.Span.dummy, .v15 v)⟩,
- ⟨(Array (BufDecl) : Type), fun v => (Runtime.Span.dummy, .v16 v)⟩,
- ⟨(Array (BufDecl) : Type), fun v => (Runtime.Span.dummy, .v16 v)⟩,
- ⟨(Array (ConstDecl) : Type), fun v => (Runtime.Span.dummy, .v17 v)⟩,
- ⟨(Array (ConstDecl) : Type), fun v => (Runtime.Span.dummy, .v17 v)⟩,
- ⟨(Array (Grid) : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Array (Grid) : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Array (Array Nat) : Type), fun v => (Runtime.Span.dummy, .v19 v)⟩,
- ⟨(Array (Array Nat) : Type), fun v => (Runtime.Span.dummy, .v19 v)⟩,
- ⟨(Array (Setting) : Type), fun v => (Runtime.Span.dummy, .v20 v)⟩,
- ⟨(Array (Setting) : Type), fun v => (Runtime.Span.dummy, .v20 v)⟩,
- ⟨(Array (Link) : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(Array (Link) : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(Array (Nat) : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(Array (Nat) : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(Option (String) : Type), fun v => (Runtime.Span.dummy, .v23 v)⟩,
- ⟨(Array (Value) : Type), fun v => (Runtime.Span.dummy, .v24 v)⟩,
- ⟨(Array (Value) : Type), fun v => (Runtime.Span.dummy, .v24 v)⟩,
- ⟨(Array (String) : Type), fun v => (Runtime.Span.dummy, .v25 v)⟩,
- ⟨(Option (String) : Type), fun v => (Runtime.Span.dummy, .v23 v)⟩,
- ⟨(Array (Operand) : Type), fun v => (Runtime.Span.dummy, .v26 v)⟩,
- ⟨(Array (Operand) : Type), fun v => (Runtime.Span.dummy, .v26 v)⟩,
- ⟨(Array (Ix) : Type), fun v => (Runtime.Span.dummy, .v27 v)⟩,
- ⟨(Array (String) : Type), fun v => (Runtime.Span.dummy, .v25 v)⟩,
- ⟨(Program : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → AsmParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → AsmParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(String : Type), fun v => .v28 v⟩,
+ ⟨(Nat : Type), fun v => .v29 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Program : Type), fun v => .v0 v⟩,
+ ⟨(Section : Type), fun v => .v1 v⟩,
+ ⟨(BufDecl : Type), fun v => .v2 v⟩,
+ ⟨(ConstDecl : Type), fun v => .v3 v⟩,
+ ⟨(Grid : Type), fun v => .v4 v⟩,
+ ⟨(Array Nat : Type), fun v => .v5 v⟩,
+ ⟨(Setting : Type), fun v => .v6 v⟩,
+ ⟨(Value : Type), fun v => .v7 v⟩,
+ ⟨(Link : Type), fun v => .v8 v⟩,
+ ⟨(Array Entry : Type), fun v => .v9 v⟩,
+ ⟨(Entry : Type), fun v => .v10 v⟩,
+ ⟨(Instr : Type), fun v => .v11 v⟩,
+ ⟨(Operand : Type), fun v => .v12 v⟩,
+ ⟨(Lit : Type), fun v => .v13 v⟩,
+ ⟨(Ix : Type), fun v => .v14 v⟩,
+ ⟨(Ix : Type), fun v => .v14 v⟩,
+ ⟨(Array (Section) : Type), fun v => .v15 v⟩,
+ ⟨(Array (BufDecl) : Type), fun v => .v16 v⟩,
+ ⟨(Array (BufDecl) : Type), fun v => .v16 v⟩,
+ ⟨(Array (ConstDecl) : Type), fun v => .v17 v⟩,
+ ⟨(Array (ConstDecl) : Type), fun v => .v17 v⟩,
+ ⟨(Array (Grid) : Type), fun v => .v18 v⟩,
+ ⟨(Array (Grid) : Type), fun v => .v18 v⟩,
+ ⟨(Array (Array Nat) : Type), fun v => .v19 v⟩,
+ ⟨(Array (Array Nat) : Type), fun v => .v19 v⟩,
+ ⟨(Array (Setting) : Type), fun v => .v20 v⟩,
+ ⟨(Array (Setting) : Type), fun v => .v20 v⟩,
+ ⟨(Array (Link) : Type), fun v => .v21 v⟩,
+ ⟨(Array (Link) : Type), fun v => .v21 v⟩,
+ ⟨(Array (Nat) : Type), fun v => .v22 v⟩,
+ ⟨(Array (Nat) : Type), fun v => .v22 v⟩,
+ ⟨(Option (String) : Type), fun v => .v23 v⟩,
+ ⟨(Array (Value) : Type), fun v => .v24 v⟩,
+ ⟨(Array (Value) : Type), fun v => .v24 v⟩,
+ ⟨(Array (String) : Type), fun v => .v25 v⟩,
+ ⟨(Option (String) : Type), fun v => .v23 v⟩,
+ ⟨(Array (Operand) : Type), fun v => .v26 v⟩,
+ ⟨(Array (Operand) : Type), fun v => .v26 v⟩,
+ ⟨(Array (Ix) : Type), fun v => .v27 v⟩,
+ ⟨(Array (String) : Type), fun v => .v25 v⟩,
+ ⟨(Program : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → AsmParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -394,322 +401,322 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (ss : Array (Section)) => (ss)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ss : Array (Section)) => (ss)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (Section.arch n)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (Section.arch n)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) (_ : Unit) => (Section.unit n)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) (_ : Unit) => (Section.unit n)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (Section.entry n)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (Section.entry n)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (BufDecl)) (_ : Unit) (_ : Unit) => (Section.buffers xs)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (BufDecl)) (_ : Unit) (_ : Unit) => (Section.buffers xs)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (BufDecl)) (_ : Unit) (_ : Unit) => (Section.params xs)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (BufDecl)) (_ : Unit) (_ : Unit) => (Section.params xs)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (BufDecl)) (_ : Unit) (_ : Unit) => (Section.temps xs)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (BufDecl)) (_ : Unit) (_ : Unit) => (Section.temps xs)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (ConstDecl)) (_ : Unit) (_ : Unit) => (Section.consts xs)
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (ConstDecl)) (_ : Unit) (_ : Unit) => (Section.consts xs)
-def semanticAction8 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (Grid)) (_ : Unit) (_ : Unit) => (Section.layout xs)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (Grid)) (_ : Unit) (_ : Unit) => (Section.layout xs)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (Array Nat)) (_ : Unit) (_ : Unit) => (Section.groups xs)
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (Array Nat)) (_ : Unit) (_ : Unit) => (Section.groups xs)
-def semanticAction10 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (Setting)) (_ : Unit) (_ : Unit) => (Section.settings xs)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (Setting)) (_ : Unit) (_ : Unit) => (Section.settings xs)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (Link)) (_ : Unit) (_ : Unit) => (Section.links xs)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (Link)) (_ : Unit) (_ : Unit) => (Section.links xs)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (es : Array Entry) (_ : Unit) => (Section.code es)
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (es : Array Entry) (_ : Unit) => (Section.code es)
-def semanticAction13 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (p : Option (String)) (_ : Unit) (ds : Array (Nat)) (_ : Unit) (t : String) (_ : Unit) (n : String) => ({ name := n, ty := t, dims := ds, place := p })
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (p : Option (String)) (_ : Unit) (ds : Array (Nat)) (_ : Unit) (t : String) (_ : Unit) (n : String) => ({ name := n, ty := t, dims := ds, place := p })
-def semanticAction14 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (v : Value) (_ : Unit) (_ : Unit) (ds : Array (Nat)) (_ : Unit) (t : String) (_ : Unit) (n : String) => ({ name := n, ty := t, dims := ds, init := v })
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (v : Value) (_ : Unit) (_ : Unit) (ds : Array (Nat)) (_ : Unit) (t : String) (_ : Unit) (n : String) => ({ name := n, ty := t, dims := ds, init := v })
-def semanticAction15 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (rs : Array (Array Nat)) (_ : Unit) (_ : Unit) (n : String) => ({ name := n, rows := rs })
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (rs : Array (Array Nat)) (_ : Unit) (_ : Unit) (n : String) => ({ name := n, rows := rs })
-def semanticAction16 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (xs : Array (Nat)) (_ : Unit) => (xs)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (xs : Array (Nat)) (_ : Unit) => (xs)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (v : Value) (_ : Unit) (k : String) => ({ key := k, value := v })
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (v : Value) (_ : Unit) (k : String) => ({ key := k, value := v })
-def semanticAction18 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) => (Value.num n)
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) => (Value.num n)
-def semanticAction19 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) (_ : Unit) => (Value.neg n)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) (_ : Unit) => (Value.neg n)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (h : String) => (Value.hex h)
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (h : String) => (Value.hex h)
-def semanticAction21 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : String) => (Value.real f)
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : String) => (Value.real f)
-def semanticAction22 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : String) => (Value.str s)
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : String) => (Value.str s)
-def semanticAction23 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (Value.id x)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (Value.id x)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (vs : Array (Value)) (_ : Unit) => (Value.list vs)
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (vs : Array (Value)) (_ : Unit) => (Value.list vs)
-def semanticAction25 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (ms : Array (String)) (_ : Unit) (n : String) => ({ name := n, members := ms })
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ms : Array (String)) (_ : Unit) (n : String) => ({ name := n, members := ms })
-def semanticAction26 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Entry) (xs : Array Entry) => (xs.push e)
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Entry) (xs : Array Entry) => (xs.push e)
-def semanticAction27 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array Entry)
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array Entry)
-def semanticAction28 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (l : String) => (Entry.label l)
+def semanticAction28 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (l : String) => (Entry.label l)
-def semanticAction29 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) (_ : Unit) => (Entry.mark n)
+def semanticAction29 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) (_ : Unit) => (Entry.mark n)
-def semanticAction30 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) (_ : Unit) => (Entry.align n)
+def semanticAction30 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) (_ : Unit) => (Entry.align n)
-def semanticAction31 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (i : Instr) => (Entry.instr i)
+def semanticAction31 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (i : Instr) => (Entry.instr i)
-def semanticAction32 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (os : Array (Operand)) (ty : Option (String)) (op : String) => ({ op := op, ty := ty, args := os })
+def semanticAction32 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (os : Array (Operand)) (ty : Option (String)) (op : String) => ({ op := op, ty := ty, args := os })
-def semanticAction33 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : String) => (Operand.greg r)
+def semanticAction33 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : String) => (Operand.greg r)
-def semanticAction34 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : String) => (Operand.vreg r)
+def semanticAction34 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : String) => (Operand.vreg r)
-def semanticAction35 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : String) => (Operand.vpair r)
+def semanticAction35 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : String) => (Operand.vpair r)
-def semanticAction36 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : String) => (Operand.preg r)
+def semanticAction36 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : String) => (Operand.preg r)
-def semanticAction37 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : String) => (Operand.addr a)
+def semanticAction37 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : String) => (Operand.addr a)
-def semanticAction38 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) (_ : Unit) => (Operand.symAddr n 0)
+def semanticAction38 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) (_ : Unit) => (Operand.symAddr n 0)
-def semanticAction39 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (k : Nat) (_ : Unit) (n : String) (_ : Unit) => (Operand.symAddr n k)
+def semanticAction39 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (k : Nat) (_ : Unit) (n : String) (_ : Unit) => (Operand.symAddr n k)
-def semanticAction40 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (l : Lit) => (Operand.imm l)
+def semanticAction40 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (l : Lit) => (Operand.imm l)
-def semanticAction41 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (Operand.sym x)
+def semanticAction41 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (Operand.sym x)
-def semanticAction42 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ixs : Array (Ix)) (_ : Unit) (x : String) => (Operand.tensor x ixs)
+def semanticAction42 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ixs : Array (Ix)) (_ : Unit) (x : String) => (Operand.tensor x ixs)
-def semanticAction43 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (rs : Array (String)) (_ : Unit) => (Operand.regSet rs)
+def semanticAction43 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (rs : Array (String)) (_ : Unit) => (Operand.regSet rs)
-def semanticAction44 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) => (Lit.dec n)
+def semanticAction44 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) => (Lit.dec n)
-def semanticAction45 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (h : String) => (Lit.hex h)
+def semanticAction45 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (h : String) => (Lit.hex h)
-def semanticAction46 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : String) => (Lit.bin b)
+def semanticAction46 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : String) => (Lit.bin b)
-def semanticAction47 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : String) => (Lit.real f)
+def semanticAction47 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : String) => (Lit.real f)
-def semanticAction48 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (l : Lit) (_ : Unit) => (Lit.neg l)
+def semanticAction48 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (l : Lit) (_ : Unit) => (Lit.neg l)
-def semanticAction49 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Ix) => (a)
+def semanticAction49 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Ix) => (a)
-def semanticAction50 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Ix) (_ : Unit) (x : Ix) => (Ix.add x a)
+def semanticAction50 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Ix) (_ : Unit) (x : Ix) => (Ix.add x a)
-def semanticAction51 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Ix) (_ : Unit) (x : Ix) => (Ix.mul x a)
+def semanticAction51 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Ix) (_ : Unit) (x : Ix) => (Ix.mul x a)
-def semanticAction52 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : String) => (Ix.reg r)
+def semanticAction52 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : String) => (Ix.reg r)
-def semanticAction53 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (Ix.var x)
+def semanticAction53 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (Ix.var x)
-def semanticAction54 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) => (Ix.lit n)
+def semanticAction54 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) => (Ix.lit n)
-def semanticAction55 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Section))
+def semanticAction55 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Section))
-def semanticAction56 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Section) (xs : Array (Section)) => (xs.push x)
+def semanticAction56 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Section) (xs : Array (Section)) => (xs.push x)
-def semanticAction57 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (BufDecl))
+def semanticAction57 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (BufDecl))
-def semanticAction58 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (BufDecl)) => (xs)
+def semanticAction58 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (BufDecl)) => (xs)
-def semanticAction59 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : BufDecl) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction59 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : BufDecl) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction60 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : BufDecl) (_ : Unit) (xs : Array (BufDecl)) => (xs.push x)
+def semanticAction60 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : BufDecl) (_ : Unit) (xs : Array (BufDecl)) => (xs.push x)
-def semanticAction61 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (ConstDecl))
+def semanticAction61 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (ConstDecl))
-def semanticAction62 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (ConstDecl)) => (xs)
+def semanticAction62 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (ConstDecl)) => (xs)
-def semanticAction63 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : ConstDecl) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction63 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : ConstDecl) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction64 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : ConstDecl) (_ : Unit) (xs : Array (ConstDecl)) => (xs.push x)
+def semanticAction64 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : ConstDecl) (_ : Unit) (xs : Array (ConstDecl)) => (xs.push x)
-def semanticAction65 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Grid))
+def semanticAction65 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Grid))
-def semanticAction66 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Grid)) => (xs)
+def semanticAction66 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Grid)) => (xs)
-def semanticAction67 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Grid) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction67 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Grid) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction68 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Grid) (_ : Unit) (xs : Array (Grid)) => (xs.push x)
+def semanticAction68 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Grid) (_ : Unit) (xs : Array (Grid)) => (xs.push x)
-def semanticAction69 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Array Nat))
+def semanticAction69 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Array Nat))
-def semanticAction70 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Array Nat)) => (xs)
+def semanticAction70 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Array Nat)) => (xs)
-def semanticAction71 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Array Nat) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction71 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Array Nat) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction72 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Array Nat) (_ : Unit) (xs : Array (Array Nat)) => (xs.push x)
+def semanticAction72 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Array Nat) (_ : Unit) (xs : Array (Array Nat)) => (xs.push x)
-def semanticAction73 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Setting))
+def semanticAction73 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Setting))
-def semanticAction74 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Setting)) => (xs)
+def semanticAction74 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Setting)) => (xs)
-def semanticAction75 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Setting) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction75 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Setting) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction76 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Setting) (_ : Unit) (xs : Array (Setting)) => (xs.push x)
+def semanticAction76 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Setting) (_ : Unit) (xs : Array (Setting)) => (xs.push x)
-def semanticAction77 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Link))
+def semanticAction77 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Link))
-def semanticAction78 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Link)) => (xs)
+def semanticAction78 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Link)) => (xs)
-def semanticAction79 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Link) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction79 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Link) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction80 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Link) (_ : Unit) (xs : Array (Link)) => (xs.push x)
+def semanticAction80 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Link) (_ : Unit) (xs : Array (Link)) => (xs.push x)
-def semanticAction81 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Nat))
+def semanticAction81 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Nat))
-def semanticAction82 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Nat)) => (xs)
+def semanticAction82 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Nat)) => (xs)
-def semanticAction83 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Nat) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction83 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Nat) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction84 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Nat) (_ : Unit) (xs : Array (Nat)) => (xs.push x)
+def semanticAction84 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Nat) (_ : Unit) (xs : Array (Nat)) => (xs.push x)
-def semanticAction85 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option (String))
+def semanticAction85 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option (String))
-def semanticAction86 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (some x)
+def semanticAction86 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (some x)
-def semanticAction87 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Value))
+def semanticAction87 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Value))
-def semanticAction88 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Value)) => (xs)
+def semanticAction88 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Value)) => (xs)
-def semanticAction89 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Value) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction89 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Value) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction90 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Value) (_ : Unit) (xs : Array (Value)) => (xs.push x)
+def semanticAction90 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Value) (_ : Unit) (xs : Array (Value)) => (xs.push x)
-def semanticAction91 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction91 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction92 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) (_ : Unit) (xs : Array (String)) => (xs.push x)
+def semanticAction92 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) (_ : Unit) (xs : Array (String)) => (xs.push x)
-def semanticAction93 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option (String))
+def semanticAction93 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option (String))
-def semanticAction94 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (some x)
+def semanticAction94 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (some x)
-def semanticAction95 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Operand))
+def semanticAction95 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Operand))
-def semanticAction96 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Operand)) => (xs)
+def semanticAction96 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Operand)) => (xs)
-def semanticAction97 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Operand) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction97 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Operand) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction98 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Operand) (_ : Unit) (xs : Array (Operand)) => (xs.push x)
+def semanticAction98 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Operand) (_ : Unit) (xs : Array (Operand)) => (xs.push x)
-def semanticAction99 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Ix) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction99 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Ix) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction100 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Ix) (_ : Unit) (xs : Array (Ix)) => (xs.push x)
+def semanticAction100 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Ix) (_ : Unit) (xs : Array (Ix)) => (xs.push x)
-def semanticAction101 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => ((Array.emptyWithCapacity 4).push x)
+def semanticAction101 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => ((Array.emptyWithCapacity 4).push x)
-def semanticAction102 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) (_ : Unit) (xs : Array (String)) => (xs.push x)
+def semanticAction102 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) (_ : Unit) (xs : Array (String)) => (xs.push x)
-def semanticAction103 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction103 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨16, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩]) semanticAction2
@@ -822,7 +829,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -958,13 +965,15 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
abbrev lastSymb' : NonInitState → Symbol Terminal NonTerminal
| s => match s with
| ⟨0, _⟩ => Symbol.NT ⟨16, of_decide_eq_true rfl⟩
@@ -2414,855 +2423,855 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Program :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Program :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : AsmParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : AsmParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))))) => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))))) => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees28 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 28 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 28 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees29 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 29 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 29 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees30 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 30 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 30 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees31 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 31 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 31 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees32 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 32 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 32 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees33 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 33 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 33 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees34 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 34 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 34 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees35 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 35 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 35 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees36 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 36 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 36 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees37 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 37 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 37 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees38 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 38 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 38 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees39 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 39 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 39 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees40 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 40 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 40 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees41 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 41 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 41 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees42 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 42 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 42 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees43 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 43 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 43 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees44 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 44 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 44 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees45 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 45 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 45 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees46 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 46 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 46 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees47 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 47 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 47 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees48 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 48 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 48 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees49 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 49 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 49 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees50 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 50 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 50 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees51 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 51 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 51 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees52 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 52 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 52 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees53 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 53 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 53 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees54 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 54 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 54 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees55 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 55 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 55 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees56 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 56 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 56 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees57 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 57 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 57 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees58 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 58 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 58 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees59 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 59 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 59 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees60 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 60 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 60 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees61 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 61 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 61 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees62 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 62 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 62 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees63 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 63 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 63 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees64 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 64 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 64 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees65 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 65 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 65 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees66 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 66 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 66 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees67 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 67 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 67 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees68 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 68 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 68 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees69 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 69 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 69 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees70 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 70 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 70 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees71 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 71 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 71 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees72 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 72 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 72 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees73 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 73 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 73 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees74 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 74 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 74 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees75 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 75 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 75 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees76 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 76 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 76 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees77 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 77 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 77 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees78 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 78 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 78 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees79 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 79 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 79 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees80 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 80 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 80 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees81 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 81 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 81 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees82 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 82 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 82 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees83 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 83 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 83 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees84 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 84 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 84 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees85 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 85 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 85 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees86 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 86 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 86 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees87 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 87 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 87 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees88 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 88 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 88 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees89 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 89 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 89 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees90 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 90 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 90 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees91 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 91 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 91 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees92 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 92 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 92 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees93 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 93 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 93 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees94 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 94 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 94 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees95 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 95 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 95 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees96 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 96 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 96 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees97 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 97 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 97 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees98 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 98 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 98 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees99 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 99 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 99 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees100 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 100 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 100 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees101 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 101 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 101 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees102 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 102 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 102 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees103 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨103, of_decide_eq_true rfl⟩ : Production))),
- AsmParser.table.sem 103 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨103, of_decide_eq_true rfl⟩ : Production))),
+ AsmParser.semV 103 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨103, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨103, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨103, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- AsmParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ AsmParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨28, _⟩, values => refinementSemanticAgrees28 values
- | ⟨29, _⟩, values => refinementSemanticAgrees29 values
- | ⟨30, _⟩, values => refinementSemanticAgrees30 values
- | ⟨31, _⟩, values => refinementSemanticAgrees31 values
- | ⟨32, _⟩, values => refinementSemanticAgrees32 values
- | ⟨33, _⟩, values => refinementSemanticAgrees33 values
- | ⟨34, _⟩, values => refinementSemanticAgrees34 values
- | ⟨35, _⟩, values => refinementSemanticAgrees35 values
- | ⟨36, _⟩, values => refinementSemanticAgrees36 values
- | ⟨37, _⟩, values => refinementSemanticAgrees37 values
- | ⟨38, _⟩, values => refinementSemanticAgrees38 values
- | ⟨39, _⟩, values => refinementSemanticAgrees39 values
- | ⟨40, _⟩, values => refinementSemanticAgrees40 values
- | ⟨41, _⟩, values => refinementSemanticAgrees41 values
- | ⟨42, _⟩, values => refinementSemanticAgrees42 values
- | ⟨43, _⟩, values => refinementSemanticAgrees43 values
- | ⟨44, _⟩, values => refinementSemanticAgrees44 values
- | ⟨45, _⟩, values => refinementSemanticAgrees45 values
- | ⟨46, _⟩, values => refinementSemanticAgrees46 values
- | ⟨47, _⟩, values => refinementSemanticAgrees47 values
- | ⟨48, _⟩, values => refinementSemanticAgrees48 values
- | ⟨49, _⟩, values => refinementSemanticAgrees49 values
- | ⟨50, _⟩, values => refinementSemanticAgrees50 values
- | ⟨51, _⟩, values => refinementSemanticAgrees51 values
- | ⟨52, _⟩, values => refinementSemanticAgrees52 values
- | ⟨53, _⟩, values => refinementSemanticAgrees53 values
- | ⟨54, _⟩, values => refinementSemanticAgrees54 values
- | ⟨55, _⟩, values => refinementSemanticAgrees55 values
- | ⟨56, _⟩, values => refinementSemanticAgrees56 values
- | ⟨57, _⟩, values => refinementSemanticAgrees57 values
- | ⟨58, _⟩, values => refinementSemanticAgrees58 values
- | ⟨59, _⟩, values => refinementSemanticAgrees59 values
- | ⟨60, _⟩, values => refinementSemanticAgrees60 values
- | ⟨61, _⟩, values => refinementSemanticAgrees61 values
- | ⟨62, _⟩, values => refinementSemanticAgrees62 values
- | ⟨63, _⟩, values => refinementSemanticAgrees63 values
- | ⟨64, _⟩, values => refinementSemanticAgrees64 values
- | ⟨65, _⟩, values => refinementSemanticAgrees65 values
- | ⟨66, _⟩, values => refinementSemanticAgrees66 values
- | ⟨67, _⟩, values => refinementSemanticAgrees67 values
- | ⟨68, _⟩, values => refinementSemanticAgrees68 values
- | ⟨69, _⟩, values => refinementSemanticAgrees69 values
- | ⟨70, _⟩, values => refinementSemanticAgrees70 values
- | ⟨71, _⟩, values => refinementSemanticAgrees71 values
- | ⟨72, _⟩, values => refinementSemanticAgrees72 values
- | ⟨73, _⟩, values => refinementSemanticAgrees73 values
- | ⟨74, _⟩, values => refinementSemanticAgrees74 values
- | ⟨75, _⟩, values => refinementSemanticAgrees75 values
- | ⟨76, _⟩, values => refinementSemanticAgrees76 values
- | ⟨77, _⟩, values => refinementSemanticAgrees77 values
- | ⟨78, _⟩, values => refinementSemanticAgrees78 values
- | ⟨79, _⟩, values => refinementSemanticAgrees79 values
- | ⟨80, _⟩, values => refinementSemanticAgrees80 values
- | ⟨81, _⟩, values => refinementSemanticAgrees81 values
- | ⟨82, _⟩, values => refinementSemanticAgrees82 values
- | ⟨83, _⟩, values => refinementSemanticAgrees83 values
- | ⟨84, _⟩, values => refinementSemanticAgrees84 values
- | ⟨85, _⟩, values => refinementSemanticAgrees85 values
- | ⟨86, _⟩, values => refinementSemanticAgrees86 values
- | ⟨87, _⟩, values => refinementSemanticAgrees87 values
- | ⟨88, _⟩, values => refinementSemanticAgrees88 values
- | ⟨89, _⟩, values => refinementSemanticAgrees89 values
- | ⟨90, _⟩, values => refinementSemanticAgrees90 values
- | ⟨91, _⟩, values => refinementSemanticAgrees91 values
- | ⟨92, _⟩, values => refinementSemanticAgrees92 values
- | ⟨93, _⟩, values => refinementSemanticAgrees93 values
- | ⟨94, _⟩, values => refinementSemanticAgrees94 values
- | ⟨95, _⟩, values => refinementSemanticAgrees95 values
- | ⟨96, _⟩, values => refinementSemanticAgrees96 values
- | ⟨97, _⟩, values => refinementSemanticAgrees97 values
- | ⟨98, _⟩, values => refinementSemanticAgrees98 values
- | ⟨99, _⟩, values => refinementSemanticAgrees99 values
- | ⟨100, _⟩, values => refinementSemanticAgrees100 values
- | ⟨101, _⟩, values => refinementSemanticAgrees101 values
- | ⟨102, _⟩, values => refinementSemanticAgrees102 values
- | ⟨103, _⟩, values => refinementSemanticAgrees103 values
- | ⟨n + 104, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨28, _⟩, spans, values => refinementSemanticAgrees28 spans values
+ | ⟨29, _⟩, spans, values => refinementSemanticAgrees29 spans values
+ | ⟨30, _⟩, spans, values => refinementSemanticAgrees30 spans values
+ | ⟨31, _⟩, spans, values => refinementSemanticAgrees31 spans values
+ | ⟨32, _⟩, spans, values => refinementSemanticAgrees32 spans values
+ | ⟨33, _⟩, spans, values => refinementSemanticAgrees33 spans values
+ | ⟨34, _⟩, spans, values => refinementSemanticAgrees34 spans values
+ | ⟨35, _⟩, spans, values => refinementSemanticAgrees35 spans values
+ | ⟨36, _⟩, spans, values => refinementSemanticAgrees36 spans values
+ | ⟨37, _⟩, spans, values => refinementSemanticAgrees37 spans values
+ | ⟨38, _⟩, spans, values => refinementSemanticAgrees38 spans values
+ | ⟨39, _⟩, spans, values => refinementSemanticAgrees39 spans values
+ | ⟨40, _⟩, spans, values => refinementSemanticAgrees40 spans values
+ | ⟨41, _⟩, spans, values => refinementSemanticAgrees41 spans values
+ | ⟨42, _⟩, spans, values => refinementSemanticAgrees42 spans values
+ | ⟨43, _⟩, spans, values => refinementSemanticAgrees43 spans values
+ | ⟨44, _⟩, spans, values => refinementSemanticAgrees44 spans values
+ | ⟨45, _⟩, spans, values => refinementSemanticAgrees45 spans values
+ | ⟨46, _⟩, spans, values => refinementSemanticAgrees46 spans values
+ | ⟨47, _⟩, spans, values => refinementSemanticAgrees47 spans values
+ | ⟨48, _⟩, spans, values => refinementSemanticAgrees48 spans values
+ | ⟨49, _⟩, spans, values => refinementSemanticAgrees49 spans values
+ | ⟨50, _⟩, spans, values => refinementSemanticAgrees50 spans values
+ | ⟨51, _⟩, spans, values => refinementSemanticAgrees51 spans values
+ | ⟨52, _⟩, spans, values => refinementSemanticAgrees52 spans values
+ | ⟨53, _⟩, spans, values => refinementSemanticAgrees53 spans values
+ | ⟨54, _⟩, spans, values => refinementSemanticAgrees54 spans values
+ | ⟨55, _⟩, spans, values => refinementSemanticAgrees55 spans values
+ | ⟨56, _⟩, spans, values => refinementSemanticAgrees56 spans values
+ | ⟨57, _⟩, spans, values => refinementSemanticAgrees57 spans values
+ | ⟨58, _⟩, spans, values => refinementSemanticAgrees58 spans values
+ | ⟨59, _⟩, spans, values => refinementSemanticAgrees59 spans values
+ | ⟨60, _⟩, spans, values => refinementSemanticAgrees60 spans values
+ | ⟨61, _⟩, spans, values => refinementSemanticAgrees61 spans values
+ | ⟨62, _⟩, spans, values => refinementSemanticAgrees62 spans values
+ | ⟨63, _⟩, spans, values => refinementSemanticAgrees63 spans values
+ | ⟨64, _⟩, spans, values => refinementSemanticAgrees64 spans values
+ | ⟨65, _⟩, spans, values => refinementSemanticAgrees65 spans values
+ | ⟨66, _⟩, spans, values => refinementSemanticAgrees66 spans values
+ | ⟨67, _⟩, spans, values => refinementSemanticAgrees67 spans values
+ | ⟨68, _⟩, spans, values => refinementSemanticAgrees68 spans values
+ | ⟨69, _⟩, spans, values => refinementSemanticAgrees69 spans values
+ | ⟨70, _⟩, spans, values => refinementSemanticAgrees70 spans values
+ | ⟨71, _⟩, spans, values => refinementSemanticAgrees71 spans values
+ | ⟨72, _⟩, spans, values => refinementSemanticAgrees72 spans values
+ | ⟨73, _⟩, spans, values => refinementSemanticAgrees73 spans values
+ | ⟨74, _⟩, spans, values => refinementSemanticAgrees74 spans values
+ | ⟨75, _⟩, spans, values => refinementSemanticAgrees75 spans values
+ | ⟨76, _⟩, spans, values => refinementSemanticAgrees76 spans values
+ | ⟨77, _⟩, spans, values => refinementSemanticAgrees77 spans values
+ | ⟨78, _⟩, spans, values => refinementSemanticAgrees78 spans values
+ | ⟨79, _⟩, spans, values => refinementSemanticAgrees79 spans values
+ | ⟨80, _⟩, spans, values => refinementSemanticAgrees80 spans values
+ | ⟨81, _⟩, spans, values => refinementSemanticAgrees81 spans values
+ | ⟨82, _⟩, spans, values => refinementSemanticAgrees82 spans values
+ | ⟨83, _⟩, spans, values => refinementSemanticAgrees83 spans values
+ | ⟨84, _⟩, spans, values => refinementSemanticAgrees84 spans values
+ | ⟨85, _⟩, spans, values => refinementSemanticAgrees85 spans values
+ | ⟨86, _⟩, spans, values => refinementSemanticAgrees86 spans values
+ | ⟨87, _⟩, spans, values => refinementSemanticAgrees87 spans values
+ | ⟨88, _⟩, spans, values => refinementSemanticAgrees88 spans values
+ | ⟨89, _⟩, spans, values => refinementSemanticAgrees89 spans values
+ | ⟨90, _⟩, spans, values => refinementSemanticAgrees90 spans values
+ | ⟨91, _⟩, spans, values => refinementSemanticAgrees91 spans values
+ | ⟨92, _⟩, spans, values => refinementSemanticAgrees92 spans values
+ | ⟨93, _⟩, spans, values => refinementSemanticAgrees93 spans values
+ | ⟨94, _⟩, spans, values => refinementSemanticAgrees94 spans values
+ | ⟨95, _⟩, spans, values => refinementSemanticAgrees95 spans values
+ | ⟨96, _⟩, spans, values => refinementSemanticAgrees96 spans values
+ | ⟨97, _⟩, spans, values => refinementSemanticAgrees97 spans values
+ | ⟨98, _⟩, spans, values => refinementSemanticAgrees98 spans values
+ | ⟨99, _⟩, spans, values => refinementSemanticAgrees99 spans values
+ | ⟨100, _⟩, spans, values => refinementSemanticAgrees100 spans values
+ | ⟨101, _⟩, spans, values => refinementSemanticAgrees101 spans values
+ | ⟨102, _⟩, spans, values => refinementSemanticAgrees102 spans values
+ | ⟨103, _⟩, spans, values => refinementSemanticAgrees103 spans values
+ | ⟨n + 104, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -3369,17 +3378,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- AsmParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ AsmParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) AsmParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) AsmParser.V := {
table := AsmParser.table
- decode := fun t => AsmParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := AsmParser.semV
+ decode := AsmParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -3424,13 +3435,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change AsmParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change AsmParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -3438,21 +3450,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (AsmParser.run input logNSteps) := by
+ have hrun : AsmParser.run input logNSteps
= Runtime.Exec.run AsmParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [AsmParser.run]
rw [Runtime.Exec.runFast_eq_run AsmParser.stackOps AsmParser.flat AsmParser.fuse
AsmParser.termOf AsmParser.valOf AsmParser.stackLawful AsmParser.fuseOK]
- simp only [AsmParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- AsmParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ AsmParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold AsmParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -3460,49 +3472,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : AsmParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Program)
- (accepted : AsmParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : AsmParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (AsmParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (AsmParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : AsmParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -3511,7 +3525,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- AsmParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ AsmParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -3527,13 +3541,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- AsmParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ AsmParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -3543,65 +3559,59 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
-
-/-- `lexPos` and `AsmLexer.tokenize` succeed on the same inputs with the same tokens. Stated, not proved. -/
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
+
+/-- `lexPos` and `AsmLexer.tokenize` succeed on the same inputs with the same tokens. Proved as
+ `posLexerAgrees`. -/
abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees AsmLexer.cbyte AsmLexer.tokenize
-/-- `AsmParser.parse` ignores token spans. Proved as `spanIndependent`. -/
-abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => AsmParser.parse ts k)
-
-theorem spanIndependent : SpanIndependent := AsmParser.parse_spanIndependent
+theorem posLexerAgrees : PosLexerAgrees := AsmLexer.posLexerAgrees
-theorem parse_eq_dependent_spans (input : List (Runtime.Positioned Tok)) (k : Nat) :
- AsmParser.parse input k = parse (input.map (·.val)) k := by
- have hs : AsmParser.parse input k = AsmParser.parse (input.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent input k
- rw [hs, ← parse_eq_dependent (input.map (·.val)) k, List.map_map]
- rfl
+theorem lexPos_eq_of_tokenize (s : String) (ts : List (Runtime.Positioned Tok)) (h : AsmLexer.tokenize s = .ok ts) :
+ Lexer.lexPos AsmLexer.cbyte s = .ok ts := by
+ have hagree := posLexerAgrees s
+ rw [h] at hagree
+ revert hagree
+ cases Lexer.lexPos AsmLexer.cbyte s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
-theorem parseStr_eq (hlex : PosLexerAgrees) (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+theorem parseStr_eq (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
(h : AsmLexer.tokenize s = .ok ts) : AsmParser.parseStr s k = AsmParser.parse ts k := by
- have hp : Lexer.lexPos AsmLexer.cbyte s = .ok ts := by
- have hagree := hlex s
- rw [h] at hagree
- revert hagree
- cases Lexer.lexPos AsmLexer.cbyte s with
- | error e => intro hc; simp [Except.toOption] at hc
- | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+ have hp : Lexer.lexPos AsmLexer.cbyte s = .ok ts := lexPos_eq_of_tokenize s ts h
exact AsmParser.parseStr_eq_lexPos s k ts hp
-theorem parseStr_eq_dependent (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_eq_dependent (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : AsmLexer.tokenize s = .ok ts) :
- AsmParser.parseStr s k = parse (ts.map (·.val)) k := by
- have hs : AsmParser.parse ts k = AsmParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs, ← parse_eq_dependent (ts.map (·.val)) k, List.map_map]
- rfl
+ AsmParser.parseStr s k = parse ts k := by
+ rw [parseStr_eq s k ts h, parse_eq_dependent]
-theorem parseStr_sound (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_sound (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : AsmLexer.tokenize s = .ok ts) (p : Program)
(accepted : AsmParser.parseStr s k = some p) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
- toStream (ts.map (·.val)) = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = p := by
- have hs : AsmParser.parse ts k = AsmParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs] at accepted
- exact parser_sound (ts.map (·.val)) k p
- (by simpa [List.map_map, Function.comp_def] using accepted)
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ rw [parseStr_eq s k ts h] at accepted
+ exact parser_sound ts k p accepted
/-- When `tokenize` fails, the byte lexer delivers a prefix `ts` and fails, and `parseStr`
is `none` or `parse` of an extension of `ts`. -/
-theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat)
+theorem parseStr_of_tokenize_error (s : String) (k : Nat)
(e : Lexer.LexError) (h : AsmLexer.tokenize s = .error e) :
∃ ts e', Runtime.Exec.Fails (Lexer.pullSource (Lexer.pullAux AsmLexer.cbyte s.toUTF8))
⟨false, s.toUTF8.size + 1, 0, [AsmLexer.cbyte.flat.base.start]⟩ ts e' ∧
@@ -3610,10 +3620,281 @@ theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat
· exfalso
have hp : Lexer.lexPos AsmLexer.cbyte s = .ok ts :=
Lexer.lexPosAux_of_denotes AsmLexer.cbyte s.toUTF8 _ _ _ ts hD
- have hagree := hlex s
+ have hagree := posLexerAgrees s
rw [hp, h] at hagree
simp [Except.toOption] at hagree
· exact hF
+/-- Every production of the start symbol has the end marker `$` on its right-hand side. -/
+theorem startProds_end : ∀ p : Production,
+ prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ Symbol.T (⟨40, of_decide_eq_true rfl⟩ : Terminal) ∈ prodRhsRev' p := by
+ native_decide
+
+theorem tokenTerm_eq_end (t : Tok)
+ (h : tokenTerm' t = (⟨40, of_decide_eq_true rfl⟩ : Terminal)) : t = .EOF := by
+ cases t <;> first | rfl | exact absurd (congrArg Fin.val h) (Nat.ne_of_beq_eq_false rfl)
+
+/-- The dependent parser does not accept a token list with no `EOF` that is longer than
+ `2^k`: it has not reached the end marker. -/
+theorem dependent_ne_parsed_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length)
+ (r : SpanGrammar.semR (SG := spanGrammarInst) (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))))
+ (rest : Runtime.NatStream grammarInst.Token) :
+ Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k ≠ .Parsed r rest :=
+ Runtime.parse_ne_parsed_of_no_end (G := grammarInst) (A := automatonInst) _ _
+ startProds_end input ⟨.EOF, Runtime.Span.dummy⟩ rfl
+ (fun t ht he => hin t ht (tokenTerm_eq_end t.val he)) k hlen r rest
+
+theorem parse_eq_none_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length) : parse input k = none := by
+ unfold parse
+ cases hp : Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k with
+ | Parsed r rest => exact absurd hp (dependent_ne_parsed_of_no_eof input k hin hlen r rest)
+ | _ => rfl
+
+/-- A prefix of lexed tokens with no `EOF`, padded with copies of its first token. -/
+theorem no_eof_pad (t0 : Runtime.Positioned Tok) (ts : List (Runtime.Positioned Tok))
+ (hts : ∀ t ∈ t0 :: ts, t.val ≠ .EOF) (k : Nat) :
+ (∀ t ∈ t0 :: ts ++ List.replicate (2 ^ k + 1) t0, t.val ≠ .EOF) ∧
+ 2 ^ k < (t0 :: ts ++ List.replicate (2 ^ k + 1) t0).length := by
+ constructor
+ · intro x hx
+ rcases List.mem_append.mp hx with hx | hx
+ · exact hts x hx
+ · rw [List.eq_of_mem_replicate hx]; exact hts t0 (List.mem_cons_self ..)
+ · simp only [List.length_append, List.length_replicate, List.length_cons]
+ omega
+
+/-- **Lex failure.** When the positioned byte lexer fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_lexPos (s : String) (k : Nat)
+ (h : ∀ ts, Lexer.lexPos AsmLexer.cbyte s ≠ .ok ts) : AsmParser.parseStr s k = none := by
+ rcases AsmParser.parseStr_total s k with ⟨ts, hD, _⟩ | ⟨ts, e, hF, hr⟩
+ · exact absurd (Lexer.lexPosAux_of_denotes AsmLexer.cbyte s.toUTF8 _ _ _ ts hD) (h ts)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens AsmLexer.cbyte AsmLexer.fastActs AsmLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) AsmLexer.noEofEmit s.toUTF8 _ ts e hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ unfold AsmParser.parseStr
+ rw [AsmParser.runStream_eq_runSrc]
+ unfold Runtime.Exec.runSrc
+ rw [hn]
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · exact h1
+ · rw [h1, parse_eq_dependent]
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ exact parse_eq_none_of_no_eof _ k hin hlen
+
+/-- **Lex failure.** When `tokenize` fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_tokenize_error (s : String) (k : Nat)
+ (e : Lexer.LexError) (h : AsmLexer.tokenize s = .error e) : AsmParser.parseStr s k = none :=
+ parseStr_eq_none_of_lexPos s k (fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree)
+
+/-- **Lex failure, stream engine.** When `tokenize` fails, `runStream` does not accept. It may
+ reject or run out of steps before it reaches the lex error, so the result need not be
+ `.err`. -/
+theorem runStream_ne_ok_of_tokenize_error (s : String) (k : Nat) (e : Lexer.LexError)
+ (h : AsmLexer.tokenize s = .error e) : ∀ v, AsmParser.runStream s k ≠ .ok v := by
+ intro v hok
+ have hlex : ∀ ts, Lexer.lexPos AsmLexer.cbyte s ≠ .ok ts := fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree
+ unfold AsmParser.runStream at hok
+ rcases Lexer.runStreamFast_total (ops := AsmParser.stackOps) AsmParser.flat AsmParser.fuse AsmParser.termOf AsmLexer.cbyte
+ AsmLexer.fastActs AsmLexer.fastActs_agree_byte s (2 ^ k) with ⟨ts, hD, _⟩ | ⟨ts, e', hF, hr⟩
+ · exact hlex ts (Lexer.lexPosAux_of_denotes AsmLexer.cbyte s.toUTF8 _ _ _ ts hD)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens AsmLexer.cbyte AsmLexer.fastActs AsmLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) AsmLexer.noEofEmit s.toUTF8 _ ts e' hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ rw [Lexer.runStreamFast_eq_runSrc (ops := AsmParser.stackOps) AsmParser.flat AsmParser.fuse AsmParser.termOf
+ AsmLexer.cbyte AsmLexer.fastActs AsmLexer.fastActs_agree_byte] at hok
+ unfold Runtime.Exec.runSrc at hok
+ rw [hn] at hok
+ cases hok
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · rw [h1] at hok; cases hok
+ · rw [h1] at hok
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ have related := parserRunRefines (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k
+ have hw : AsmParser.run (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k = .ok v := hok
+ rw [hw] at related
+ generalize hdep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (Runtime.Refinement.listStream executableRefinement
+ (t0 :: rest ++ List.replicate (2 ^ k + 1) t0)) k = dep at related
+ cases related with
+ | parsed value stream =>
+ exact dependent_ne_parsed_of_no_eof _ k hin hlen value stream hdep
+
+/-- **End to end.** If `parseStr` accepts `s` with value `p`, then `tokenize` lexes `s` to
+ `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem parseStr_sound_tokenize (s : String) (k : Nat) (p : Program)
+ (accepted : AsmParser.parseStr s k = some p) :
+ ∃ ts, AsmLexer.tokenize s = .ok ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ cases ht : AsmLexer.tokenize s with
+ | error e =>
+ rw [parseStr_eq_none_of_tokenize_error s k e ht] at accepted
+ cases accepted
+ | ok ts => exact ⟨ts, rfl, parseStr_sound s k ts ht p accepted⟩
+
+/-- **End to end, with the lexer specification.** If `parseStr` accepts `s` with value `p`,
+ then `s` has a maximal-munch tokenization (`Lexer.Tokenization`), the spec tokenizer
+ returns the token values of `ts = tokenize s`, and `ts` starts with the word of a parse
+ tree whose value is `p`. -/
+theorem parseStr_sound_tokenization (s : String) (k : Nat) (p : Program)
+ (accepted : AsmParser.parseStr s k = some p) :
+ ∃ ts, AsmLexer.tokenize s = .ok ts ∧ Lexer.Tokenization AsmLexer.rules0 s.toList ∧
+ Lexer.tokenize AsmLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ obtain ⟨htok, hspec⟩ := AsmLexer.tokenize_sound ht
+ exact ⟨ts, ht, htok, hspec, hp⟩
+
+/-- **`tokenize` then `parse`.** If `tokenize` lexes `s` to `ts` and `parse` accepts `ts` with
+ value `p`, then `s` has a maximal-munch tokenization, the spec tokenizer returns the token
+ values of `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem tokenize_parse_sound (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok)) (p : Program)
+ (h : AsmLexer.tokenize s = .ok ts) (accepted : AsmParser.parse ts k = some p) :
+ Lexer.Tokenization AsmLexer.rules0 s.toList ∧ Lexer.tokenize AsmLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨htok, hspec⟩ := AsmLexer.tokenize_sound h
+ exact ⟨htok, hspec, parser_sound ts k p accepted⟩
+
+/-- **Completeness.** If `tokenize` lexes `s` to `ts` and a parse tree of the start symbol
+ spans exactly `ts`, within the fuel, `parseStr` returns the tree's value. -/
+theorem parseStr_complete (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : AsmLexer.tokenize s = .ok ts) (tree : ParserStartTree ts)
+ (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ AsmParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ rw [parseStr_eq s k ts h]
+ exact parser_complete tree k fuel
+
+/-- **Completeness from a tokenization (value level).** A maximal-munch `Lexer.Lexing` of `s`
+ gives the tokens `ts` of `tokenize s`, whose values are the tokens of its steps, and
+ `parseStr` accepts every parse tree over `ts` within the fuel, with the tree's value. -/
+theorem parseStr_complete_lexing (s : String) (k : Nat) (steps : List (Nat × Nat))
+ (hsteps : Lexer.Lexing AsmLexer.rules0 s.toList steps) :
+ ∃ ts, AsmLexer.tokenize s = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens AsmLexer.lexer AsmLexer.lexer.start s.toList steps ∧
+ ∀ tree : ParserStartTree ts, Grammar.ptSize tree ≤ 2 ^ k →
+ AsmParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ obtain ⟨ts, ht, hv⟩ := AsmLexer.tokenize_complete hsteps
+ exact ⟨ts, ht, hv, fun tree fuel => parseStr_complete s k ts ht tree fuel⟩
+
+/-- **Unambiguity (value level).** Two derivations of `s`, each the tokens `tokenize` returns
+ for `s` and a parse tree over them, have the same tokens and the same value. -/
+theorem parseStr_unambiguous (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : AsmLexer.tokenize s = .ok ts₁) (h₂ : AsmLexer.tokenize s = .ok ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ rw [h₁] at h₂
+ cases h₂
+ exact ⟨rfl, (parser_unambiguous tree₁ tree₂).2⟩
+
+/-- **Completeness over positioned tokens.** If `ts` is the positioned tokenization of `s`
+ (`AsmLexer.Lexes`) and a parse tree of the start symbol spans exactly `ts`, within the fuel,
+ `parseStr` returns the tree's value. -/
+theorem parseStr_complete_lexes (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : AsmLexer.Lexes s ts) (tree : ParserStartTree ts) (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ AsmParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) :=
+ parseStr_complete s k ts ((AsmLexer.tokenize_iff_lexes s ts).mpr h) tree fuel
+
+/-- **Unambiguity over positioned tokens.** Two derivations of `s`, each a positioned
+ tokenization and a parse tree over it, have the same tokens, and their trees have the
+ same span and value. -/
+theorem parseStr_unambiguous_lexes (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : AsmLexer.Lexes s ts₁) (h₂ : AsmLexer.Lexes s ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSpan ⟨0⟩ tree₁ = SpanGrammar.ptSpan ⟨0⟩ tree₂ ∧
+ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ have he := AsmLexer.lexes_unique h₁ h₂
+ subst he
+ exact ⟨rfl, parser_unambiguous tree₁ tree₂⟩
+
+/-- **Node spans as text of `s`.** In a parse tree over the positioned tokenization `ts` of
+ `s` (`AsmLexer.Lexes`), every leaf's span is `[a, b)` for positions `a ≤ b` of `s`, and a rule's
+ action emits the leaf's token from the lexeme `s.extract a b` (or the leaf is the
+ end-of-input token at the end of `s`). Every inner node's span is `[a, b)` for positions
+ `a ≤ b` of `s`; `b` is the end of the lexeme of the node's last token, and `a` is the start
+ of the lexeme of its first token or, when its word is empty or its leftmost children
+ derive the empty word, the end of the token before it (`Lexer.AllNodeText`). -/
+theorem parseStr_node_spans (s : String) (ts : List (Runtime.Positioned Tok)) (h : AsmLexer.Lexes s ts)
+ (tree : ParserStartTree ts) :
+ Lexer.AllNodeText (Lexer.modeAct AsmLexer.lexer AsmLexer.lexer.start) AsmLexer.lexer.eofToken s ⟨0⟩ tree :=
+ Lexer.PosLexing.allNodeText h tree
+
+/-- **End to end over positioned tokens.** If `parseStr` accepts `s` with value `p`, then
+ `s` has a positioned tokenization `ts` (`AsmLexer.Lexes`), and `ts` starts with the word of a
+ parse tree whose value is `p`. -/
+theorem parseStr_sound_lexes (s : String) (k : Nat) (p : Program)
+ (accepted : AsmParser.parseStr s k = some p) :
+ ∃ ts, AsmLexer.Lexes s ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ exact ⟨ts, (AsmLexer.tokenize_iff_lexes s ts).mp ht, hp⟩
+
+/-- The end marker `$` is the last symbol of every production of the start symbol, and no
+ other position of a right-hand side holds `$` or the start symbol. -/
+theorem endMarker_last : ∀ p : Production,
+ (prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ (prodRhsRev' p).head? = some (Symbol.T (⟨40, of_decide_eq_true rfl⟩ : Terminal)) ∧
+ ∀ x ∈ (prodRhsRev' p).tail, x ≠ Symbol.T (⟨40, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) ∧
+ (prodLhs' p ≠ startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ ∀ x ∈ prodRhsRev' p, x ≠ Symbol.T (⟨40, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) := by
+ native_decide
+
+/-- **The tree covers the tokens.** If `ts` is the positioned tokenization of `s`
+ (`AsmLexer.Lexes`), the word of a start tree that begins the stream of `ts` is `ts`: the lexer
+ emits `EOF` only as its last token (`AsmLexer.lexes_eof_last`), and a start tree's word ends
+ with its only `$` token (`endMarker_last`). -/
+theorem word_eq_of_lexes (s : String) (ts : List (Runtime.Positioned Tok)) (h : AsmLexer.Lexes s ts)
+ {word : List grammarInst.Token} (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token)
+ (hs : toStream ts = Runtime.NatStream.appList word rest) : word = ts := by
+ obtain ⟨ts0, rfl, hno⟩ := AsmLexer.lexes_eof_last h
+ exact Runtime.start_word_eq (G := grammarInst) (A := automatonInst) _ _ endMarker_last _ ts0 _
+ rfl (fun t ht he => hno t ht (tokenTerm_eq_end t.val he)) tree rest hs
+
+/-- **End to end, over the whole input.** If `parseStr` accepts `s` with value `p`, then
+ `tokenize` lexes `s` to `ts`, `ts` is the positioned tokenization of `s` (`AsmLexer.Lexes`),
+ and a parse tree over exactly `ts` has the value `p`. -/
+theorem parseStr_sound_exact (s : String) (k : Nat) (p : Program)
+ (accepted : AsmParser.parseStr s k = some p) :
+ ∃ ts, AsmLexer.tokenize s = .ok ts ∧ AsmLexer.Lexes s ts ∧
+ ∃ tree : ParserStartTree ts, SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, word, tree, rest, hs, hp⟩ := parseStr_sound_tokenize s k p accepted
+ have hl := (AsmLexer.tokenize_iff_lexes s ts).mp ht
+ obtain rfl := word_eq_of_lexes s ts hl tree rest hs
+ exact ⟨word, ht, hl, tree, hp⟩
+
end AsmVerified
diff --git a/test/c99/C99Parser.lean b/test/c99/C99Parser.lean
index 87ce983..340b396 100644
--- a/test/c99/C99Parser.lean
+++ b/test/c99/C99Parser.lean
@@ -239,192 +239,195 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def sem : Nat → List VP → VP
- | 0, [(ds_span, .v1 ds)] => (ds_span, .v0 (TranslationUnit.mk ds))
- | 1, [(d_span, .v2 d)] => (d_span, .v1 ([d]))
- | 2, [(d_span, .v2 d), (rest_span, .v1 rest)] => (Runtime.Span.merge d_span rest_span, .v1 (d :: rest))
- | 3, [(f_span, .v3 f)] => (f_span, .v2 (ExternalDecl.function f))
- | 4, [(d_span, .v4 d)] => (d_span, .v2 (ExternalDecl.decl d))
- | 5, [(specs_span, .v5 specs), (d_span, .v9 d), (body_span, .v18 body)] => (Runtime.Span.merge specs_span body_span, .v3 (FunctionDef.mk specs d body))
- | 6, [(specs_span, .v5 specs), (__s1, _)] => (Runtime.Span.merge specs_span __s1, .v4 (Declaration.mk false specs []))
- | 7, [(specs_span, .v5 specs), (ids_span, .v7 ids), (__s2, _)] => (Runtime.Span.merge specs_span __s2, .v4 (Declaration.mk false specs ids))
- | 8, [(__s0, _), (specs_span, .v5 specs), (ids_span, .v7 ids), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v4 (Declaration.mk true specs ids))
- | 9, [(s_span, .v6 s)] => (s_span, .v5 ([s]))
- | 10, [(s_span, .v6 s), (rest_span, .v5 rest)] => (Runtime.Span.merge s_span rest_span, .v5 (s :: rest))
- | 11, [(__s0, _), (rest_span, .v5 rest)] => (Runtime.Span.merge __s0 rest_span, .v5 (rest))
- | 12, [(__s0, _), (rest_span, .v5 rest)] => (Runtime.Span.merge __s0 rest_span, .v5 (rest))
- | 13, [(__s0, _)] => (__s0, .unit (()))
- | 14, [(__s0, _)] => (__s0, .unit (()))
- | 15, [(__s0, _)] => (__s0, .unit (()))
- | 16, [(__s0, _)] => (__s0, .unit (()))
- | 17, [(__s0, _)] => (__s0, .unit (()))
- | 18, [(__s0, _)] => (__s0, .unit (()))
- | 19, [(__s0, _)] => (__s0, .unit (()))
- | 20, [(__s0, _)] => (__s0, .unit (()))
- | 21, [(__s0, _)] => (__s0, .v6 (.void))
- | 22, [(__s0, _)] => (__s0, .v6 (.char))
- | 23, [(__s0, _)] => (__s0, .v6 (.short))
- | 24, [(__s0, _)] => (__s0, .v6 (.int))
- | 25, [(__s0, _)] => (__s0, .v6 (.long))
- | 26, [(__s0, _)] => (__s0, .v6 (.float))
- | 27, [(__s0, _)] => (__s0, .v6 (.double))
- | 28, [(__s0, _)] => (__s0, .v6 (.signed))
- | 29, [(__s0, _)] => (__s0, .v6 (.unsigned))
- | 30, [(__s0, _)] => (__s0, .v6 (.bool))
- | 31, [(__s0, _)] => (__s0, .v6 (.complex))
- | 32, [(s_span, .v6 s)] => (s_span, .v6 (s))
- | 33, [(s_span, .v6 s)] => (s_span, .v6 (s))
- | 34, [(name_span, .v22 name)] => (name_span, .v6 (.typedefName name))
- | 35, [(__s0, _), (tag_span, .v22 tag)] => (Runtime.Span.merge __s0 tag_span, .v6 (.structOrUnion tag))
- | 36, [(__s0, _), (__s1, _), (__s2, _), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v6 (.structOrUnion ""))
- | 37, [(__s0, _), (tag_span, .v22 tag), (__s2, _), (__s3, _), (__s4, _)] => (Runtime.Span.merge __s0 __s4, .v6 (.structOrUnion tag))
- | 38, [(__s0, _)] => (__s0, .unit (()))
- | 39, [(__s0, _)] => (__s0, .unit (()))
- | 40, [(__s0, _)] => (__s0, .unit (()))
- | 41, [(__s0, _), (__s1, _)] => (Runtime.Span.merge __s0 __s1, .unit (()))
- | 42, [(__s0, _), (__s1, _), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .unit (()))
- | 43, [(__s0, _)] => (__s0, .unit (()))
- | 44, [(__s0, _), (__s1, _), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .unit (()))
- | 45, [(__s0, _), (tag_span, .v22 tag)] => (Runtime.Span.merge __s0 tag_span, .v6 (.enumSpec tag))
- | 46, [(__s0, _), (__s1, _), (__s2, _), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v6 (.enumSpec ""))
- | 47, [(__s0, _), (tag_span, .v22 tag), (__s2, _), (__s3, _), (__s4, _)] => (Runtime.Span.merge __s0 __s4, .v6 (.enumSpec tag))
- | 48, [(__s0, _)] => (__s0, .unit (()))
- | 49, [(__s0, _), (__s1, _), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .unit (()))
- | 50, [(__s0, _)] => (__s0, .unit (()))
- | 51, [(__s0, _), (__s1, _), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .unit (()))
- | 52, [(id_span, .v8 id)] => (id_span, .v7 ([id]))
- | 53, [(id_span, .v8 id), (__s1, _), (rest_span, .v7 rest)] => (Runtime.Span.merge id_span rest_span, .v7 (id :: rest))
- | 54, [(d_span, .v9 d)] => (d_span, .v8 (InitDeclarator.mk d none))
- | 55, [(d_span, .v9 d), (__s1, _), (e_span, .v14 e)] => (Runtime.Span.merge d_span e_span, .v8 (InitDeclarator.mk d (some e)))
- | 56, [(d_span, .v9 d)] => (d_span, .v9 (d))
- | 57, [(__s0, _), (d_span, .v9 d)] => (Runtime.Span.merge __s0 d_span, .v9 (Declarator.pointer d))
- | 58, [(name_span, .v22 name)] => (name_span, .v9 (Declarator.name name))
- | 59, [(__s0, _), (d_span, .v9 d), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v9 (Declarator.paren d))
- | 60, [(d_span, .v9 d), (__s1, _), (__s2, _)] => (Runtime.Span.merge d_span __s2, .v9 (Declarator.array d none))
- | 61, [(d_span, .v9 d), (__s1, _), (e_span, .v14 e), (__s3, _)] => (Runtime.Span.merge d_span __s3, .v9 (Declarator.array d (some e)))
- | 62, [(d_span, .v9 d), (__s1, _), (__s2, _)] => (Runtime.Span.merge d_span __s2, .v9 (Declarator.func d []))
- | 63, [(d_span, .v9 d), (__s1, _), (ps_span, .v10 ps), (__s3, _)] => (Runtime.Span.merge d_span __s3, .v9 (Declarator.func d ps))
- | 64, [(p_span, .v11 p)] => (p_span, .v10 ([p]))
- | 65, [(p_span, .v11 p), (__s1, _), (rest_span, .v10 rest)] => (Runtime.Span.merge p_span rest_span, .v10 (p :: rest))
- | 66, [(p_span, .v11 p), (__s1, _), (__s2, _)] => (Runtime.Span.merge p_span __s2, .v10 ([p, Param.ellipsis]))
- | 67, [(specs_span, .v5 specs), (d_span, .v9 d)] => (Runtime.Span.merge specs_span d_span, .v11 (Param.mk specs (some d)))
- | 68, [(specs_span, .v5 specs)] => (specs_span, .v11 (Param.mk specs none))
- | 69, [(specs_span, .v5 specs)] => (specs_span, .v12 (CTypeName.mk specs (0 : Nat)))
- | 70, [(specs_span, .v5 specs), (p_span, .v13 p)] => (Runtime.Span.merge specs_span p_span, .v12 (CTypeName.mk specs p))
- | 71, [(__s0, _)] => (__s0, .v13 ((1 : Nat)))
- | 72, [(__s0, _), (p_span, .v13 p)] => (Runtime.Span.merge __s0 p_span, .v13 (p + 1))
- | 73, [(name_span, .v22 name)] => (name_span, .v14 (Expr.ident name))
- | 74, [(value_span, .v22 value)] => (value_span, .v14 (Expr.constant value))
- | 75, [(value_span, .v22 value)] => (value_span, .v14 (Expr.stringLit value))
- | 76, [(__s0, _), (e_span, .v14 e), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v14 (Expr.paren e))
- | 77, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 78, [(e_span, .v14 e), (__s1, _), (i_span, .v14 i), (__s3, _)] => (Runtime.Span.merge e_span __s3, .v14 (Expr.index e i))
- | 79, [(e_span, .v14 e), (__s1, _), (__s2, _)] => (Runtime.Span.merge e_span __s2, .v14 (Expr.call e []))
- | 80, [(e_span, .v14 e), (__s1, _), (args_span, .v15 args), (__s3, _)] => (Runtime.Span.merge e_span __s3, .v14 (Expr.call e args))
- | 81, [(e_span, .v14 e), (__s1, _), (field_span, .v22 field)] => (Runtime.Span.merge e_span field_span, .v14 (Expr.field e field))
- | 82, [(e_span, .v14 e), (__s1, _), (field_span, .v22 field)] => (Runtime.Span.merge e_span field_span, .v14 (Expr.arrow e field))
- | 83, [(e_span, .v14 e), (__s1, _)] => (Runtime.Span.merge e_span __s1, .v14 (Expr.postInc e))
- | 84, [(e_span, .v14 e), (__s1, _)] => (Runtime.Span.merge e_span __s1, .v14 (Expr.postDec e))
- | 85, [(e_span, .v14 e)] => (e_span, .v15 ([e]))
- | 86, [(e_span, .v14 e), (__s1, _), (rest_span, .v15 rest)] => (Runtime.Span.merge e_span rest_span, .v15 (e :: rest))
- | 87, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 88, [(__s0, _), (e_span, .v14 e)] => (Runtime.Span.merge __s0 e_span, .v14 (Expr.preInc e))
- | 89, [(__s0, _), (e_span, .v14 e)] => (Runtime.Span.merge __s0 e_span, .v14 (Expr.preDec e))
- | 90, [(op_span, .v16 op), (e_span, .v14 e)] => (Runtime.Span.merge op_span e_span, .v14 (Expr.unary op e))
- | 91, [(__s0, _), (e_span, .v14 e)] => (Runtime.Span.merge __s0 e_span, .v14 (Expr.sizeofExpr e))
- | 92, [(__s0, _), (__s1, _), (t_span, .v12 t), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v14 (Expr.sizeofType t))
- | 93, [(__s0, _)] => (__s0, .v16 (.addr))
- | 94, [(__s0, _)] => (__s0, .v16 (.deref))
- | 95, [(__s0, _)] => (__s0, .v16 (.plus))
- | 96, [(__s0, _)] => (__s0, .v16 (.minus))
- | 97, [(__s0, _)] => (__s0, .v16 (.bnot))
- | 98, [(__s0, _)] => (__s0, .v16 (.lnot))
- | 99, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 100, [(__s0, _), (t_span, .v12 t), (__s2, _), (e_span, .v14 e)] => (Runtime.Span.merge __s0 e_span, .v14 (Expr.cast t e))
- | 101, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 102, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "*" l r))
- | 103, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "/" l r))
- | 104, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "%" l r))
- | 105, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 106, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "+" l r))
- | 107, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "-" l r))
- | 108, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 109, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "<<" l r))
- | 110, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop ">>" l r))
- | 111, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 112, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "<" l r))
- | 113, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop ">" l r))
- | 114, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "<=" l r))
- | 115, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop ">=" l r))
- | 116, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 117, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "==" l r))
- | 118, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "!=" l r))
- | 119, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 120, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "&" l r))
- | 121, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 122, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "^" l r))
- | 123, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 124, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "|" l r))
- | 125, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 126, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "&&" l r))
- | 127, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 128, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.binop "||" l r))
- | 129, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 130, [(c_span, .v14 c), (__s1, _), (t_span, .v14 t), (__s3, _), (f_span, .v14 f)] => (Runtime.Span.merge c_span f_span, .v14 (Expr.cond c t f))
- | 131, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 132, [(l_span, .v14 l), (op_span, .v17 op), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.assign op l r))
- | 133, [(__s0, _)] => (__s0, .v17 (.eq))
- | 134, [(__s0, _)] => (__s0, .v17 (.mulEq))
- | 135, [(__s0, _)] => (__s0, .v17 (.divEq))
- | 136, [(__s0, _)] => (__s0, .v17 (.modEq))
- | 137, [(__s0, _)] => (__s0, .v17 (.addEq))
- | 138, [(__s0, _)] => (__s0, .v17 (.subEq))
- | 139, [(__s0, _)] => (__s0, .v17 (.shlEq))
- | 140, [(__s0, _)] => (__s0, .v17 (.shrEq))
- | 141, [(__s0, _)] => (__s0, .v17 (.andEq))
- | 142, [(__s0, _)] => (__s0, .v17 (.xorEq))
- | 143, [(__s0, _)] => (__s0, .v17 (.orEq))
- | 144, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 145, [(l_span, .v14 l), (__s1, _), (r_span, .v14 r)] => (Runtime.Span.merge l_span r_span, .v14 (Expr.comma l r))
- | 146, [(e_span, .v14 e)] => (e_span, .v14 (e))
- | 147, [(s_span, .v18 s)] => (s_span, .v18 (s))
- | 148, [(s_span, .v18 s)] => (s_span, .v18 (s))
- | 149, [(s_span, .v18 s)] => (s_span, .v18 (s))
- | 150, [(s_span, .v18 s)] => (s_span, .v18 (s))
- | 151, [(s_span, .v18 s)] => (s_span, .v18 (s))
- | 152, [(label_span, .v22 label), (__s1, _), (s_span, .v18 s)] => (Runtime.Span.merge label_span s_span, .v18 (Stmt.labeled label s))
- | 153, [(__s0, _), (e_span, .v14 e), (__s2, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.case e s))
- | 154, [(__s0, _), (__s1, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.default s))
- | 155, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (t_span, .v18 t), (__s5, _), (e_span, .v18 e)] => (Runtime.Span.merge __s0 e_span, .v18 (Stmt.ifElse c t e))
- | 156, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.switch c s))
- | 157, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.whileDo c s))
- | 158, [(__s0, _), (s_span, .v18 s), (__s2, _), (__s3, _), (c_span, .v14 c), (__s5, _), (__s6, _)] => (Runtime.Span.merge __s0 __s6, .v18 (Stmt.doWhile s c))
- | 159, [(__s0, _), (__s1, _), (i_span, .v21 i), (__s3, _), (c_span, .v21 c), (__s5, _), (step_span, .v21 step), (__s7, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.forLoop i c step s))
- | 160, [(label_span, .v22 label), (__s1, _), (s_span, .v18 s)] => (Runtime.Span.merge label_span s_span, .v18 (Stmt.labeled label s))
- | 161, [(__s0, _), (e_span, .v14 e), (__s2, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.case e s))
- | 162, [(__s0, _), (__s1, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.default s))
- | 163, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.ifThen c s))
- | 164, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (t_span, .v18 t), (__s5, _), (e_span, .v18 e)] => (Runtime.Span.merge __s0 e_span, .v18 (Stmt.ifElse c t e))
- | 165, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.switch c s))
- | 166, [(__s0, _), (__s1, _), (c_span, .v14 c), (__s3, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.whileDo c s))
- | 167, [(__s0, _), (__s1, _), (i_span, .v21 i), (__s3, _), (c_span, .v21 c), (__s5, _), (step_span, .v21 step), (__s7, _), (s_span, .v18 s)] => (Runtime.Span.merge __s0 s_span, .v18 (Stmt.forLoop i c step s))
- | 168, [(__s0, _), (__s1, _)] => (Runtime.Span.merge __s0 __s1, .v18 (Stmt.compound []))
- | 169, [(__s0, _), (items_span, .v19 items), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v18 (Stmt.compound items))
- | 170, [(i_span, .v20 i)] => (i_span, .v19 ([i]))
- | 171, [(i_span, .v20 i), (rest_span, .v19 rest)] => (Runtime.Span.merge i_span rest_span, .v19 (i :: rest))
- | 172, [(d_span, .v4 d)] => (d_span, .v20 (BlockItem.decl d))
- | 173, [(s_span, .v18 s)] => (s_span, .v20 (BlockItem.stmt s))
- | 174, [(__s0, _)] => (__s0, .v18 (Stmt.expr none))
- | 175, [(e_span, .v14 e), (__s1, _)] => (Runtime.Span.merge e_span __s1, .v18 (Stmt.expr (some e)))
- | 176, [] => (Runtime.Span.dummy, .v21 (none))
- | 177, [(e_span, .v14 e)] => (e_span, .v21 (some e))
- | 178, [(__s0, _), (label_span, .v22 label), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v18 (Stmt.goto label))
- | 179, [(__s0, _), (__s1, _)] => (Runtime.Span.merge __s0 __s1, .v18 (Stmt.continueStmt))
- | 180, [(__s0, _), (__s1, _)] => (Runtime.Span.merge __s0 __s1, .v18 (Stmt.breakStmt))
- | 181, [(__s0, _), (__s1, _)] => (Runtime.Span.merge __s0 __s1, .v18 (Stmt.returnStmt none))
- | 182, [(__s0, _), (e_span, .v14 e), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v18 (Stmt.returnStmt (some e)))
- | 183, [x, _] => x
- | _, _ => (Runtime.Span.dummy, .unit ())
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v1 ds] => .v0 (TranslationUnit.mk ds)
+ | 1, _, [.v2 d] => .v1 ([d])
+ | 2, _, [.v2 d, .v1 rest] => .v1 (d :: rest)
+ | 3, _, [.v3 f] => .v2 (ExternalDecl.function f)
+ | 4, _, [.v4 d] => .v2 (ExternalDecl.decl d)
+ | 5, _, [.v5 specs, .v9 d, .v18 body] => .v3 (FunctionDef.mk specs d body)
+ | 6, _, [.v5 specs, _] => .v4 (Declaration.mk false specs [])
+ | 7, _, [.v5 specs, .v7 ids, _] => .v4 (Declaration.mk false specs ids)
+ | 8, _, [_, .v5 specs, .v7 ids, _] => .v4 (Declaration.mk true specs ids)
+ | 9, _, [.v6 s] => .v5 ([s])
+ | 10, _, [.v6 s, .v5 rest] => .v5 (s :: rest)
+ | 11, _, [_, .v5 rest] => .v5 (rest)
+ | 12, _, [_, .v5 rest] => .v5 (rest)
+ | 13, _, [_] => .unit (())
+ | 14, _, [_] => .unit (())
+ | 15, _, [_] => .unit (())
+ | 16, _, [_] => .unit (())
+ | 17, _, [_] => .unit (())
+ | 18, _, [_] => .unit (())
+ | 19, _, [_] => .unit (())
+ | 20, _, [_] => .unit (())
+ | 21, _, [_] => .v6 (.void)
+ | 22, _, [_] => .v6 (.char)
+ | 23, _, [_] => .v6 (.short)
+ | 24, _, [_] => .v6 (.int)
+ | 25, _, [_] => .v6 (.long)
+ | 26, _, [_] => .v6 (.float)
+ | 27, _, [_] => .v6 (.double)
+ | 28, _, [_] => .v6 (.signed)
+ | 29, _, [_] => .v6 (.unsigned)
+ | 30, _, [_] => .v6 (.bool)
+ | 31, _, [_] => .v6 (.complex)
+ | 32, _, [.v6 s] => .v6 (s)
+ | 33, _, [.v6 s] => .v6 (s)
+ | 34, _, [.v22 name] => .v6 (.typedefName name)
+ | 35, _, [_, .v22 tag] => .v6 (.structOrUnion tag)
+ | 36, _, [_, _, _, _] => .v6 (.structOrUnion "")
+ | 37, _, [_, .v22 tag, _, _, _] => .v6 (.structOrUnion tag)
+ | 38, _, [_] => .unit (())
+ | 39, _, [_] => .unit (())
+ | 40, _, [_] => .unit (())
+ | 41, _, [_, _] => .unit (())
+ | 42, _, [_, _, _] => .unit (())
+ | 43, _, [_] => .unit (())
+ | 44, _, [_, _, _] => .unit (())
+ | 45, _, [_, .v22 tag] => .v6 (.enumSpec tag)
+ | 46, _, [_, _, _, _] => .v6 (.enumSpec "")
+ | 47, _, [_, .v22 tag, _, _, _] => .v6 (.enumSpec tag)
+ | 48, _, [_] => .unit (())
+ | 49, _, [_, _, _] => .unit (())
+ | 50, _, [_] => .unit (())
+ | 51, _, [_, _, _] => .unit (())
+ | 52, _, [.v8 id] => .v7 ([id])
+ | 53, _, [.v8 id, _, .v7 rest] => .v7 (id :: rest)
+ | 54, _, [.v9 d] => .v8 (InitDeclarator.mk d none)
+ | 55, _, [.v9 d, _, .v14 e] => .v8 (InitDeclarator.mk d (some e))
+ | 56, _, [.v9 d] => .v9 (d)
+ | 57, _, [_, .v9 d] => .v9 (Declarator.pointer d)
+ | 58, _, [.v22 name] => .v9 (Declarator.name name)
+ | 59, _, [_, .v9 d, _] => .v9 (Declarator.paren d)
+ | 60, _, [.v9 d, _, _] => .v9 (Declarator.array d none)
+ | 61, _, [.v9 d, _, .v14 e, _] => .v9 (Declarator.array d (some e))
+ | 62, _, [.v9 d, _, _] => .v9 (Declarator.func d [])
+ | 63, _, [.v9 d, _, .v10 ps, _] => .v9 (Declarator.func d ps)
+ | 64, _, [.v11 p] => .v10 ([p])
+ | 65, _, [.v11 p, _, .v10 rest] => .v10 (p :: rest)
+ | 66, _, [.v11 p, _, _] => .v10 ([p, Param.ellipsis])
+ | 67, _, [.v5 specs, .v9 d] => .v11 (Param.mk specs (some d))
+ | 68, _, [.v5 specs] => .v11 (Param.mk specs none)
+ | 69, _, [.v5 specs] => .v12 (CTypeName.mk specs (0 : Nat))
+ | 70, _, [.v5 specs, .v13 p] => .v12 (CTypeName.mk specs p)
+ | 71, _, [_] => .v13 ((1 : Nat))
+ | 72, _, [_, .v13 p] => .v13 (p + 1)
+ | 73, _, [.v22 name] => .v14 (Expr.ident name)
+ | 74, _, [.v22 value] => .v14 (Expr.constant value)
+ | 75, _, [.v22 value] => .v14 (Expr.stringLit value)
+ | 76, _, [_, .v14 e, _] => .v14 (Expr.paren e)
+ | 77, _, [.v14 e] => .v14 (e)
+ | 78, _, [.v14 e, _, .v14 i, _] => .v14 (Expr.index e i)
+ | 79, _, [.v14 e, _, _] => .v14 (Expr.call e [])
+ | 80, _, [.v14 e, _, .v15 args, _] => .v14 (Expr.call e args)
+ | 81, _, [.v14 e, _, .v22 field] => .v14 (Expr.field e field)
+ | 82, _, [.v14 e, _, .v22 field] => .v14 (Expr.arrow e field)
+ | 83, _, [.v14 e, _] => .v14 (Expr.postInc e)
+ | 84, _, [.v14 e, _] => .v14 (Expr.postDec e)
+ | 85, _, [.v14 e] => .v15 ([e])
+ | 86, _, [.v14 e, _, .v15 rest] => .v15 (e :: rest)
+ | 87, _, [.v14 e] => .v14 (e)
+ | 88, _, [_, .v14 e] => .v14 (Expr.preInc e)
+ | 89, _, [_, .v14 e] => .v14 (Expr.preDec e)
+ | 90, _, [.v16 op, .v14 e] => .v14 (Expr.unary op e)
+ | 91, _, [_, .v14 e] => .v14 (Expr.sizeofExpr e)
+ | 92, _, [_, _, .v12 t, _] => .v14 (Expr.sizeofType t)
+ | 93, _, [_] => .v16 (.addr)
+ | 94, _, [_] => .v16 (.deref)
+ | 95, _, [_] => .v16 (.plus)
+ | 96, _, [_] => .v16 (.minus)
+ | 97, _, [_] => .v16 (.bnot)
+ | 98, _, [_] => .v16 (.lnot)
+ | 99, _, [.v14 e] => .v14 (e)
+ | 100, _, [_, .v12 t, _, .v14 e] => .v14 (Expr.cast t e)
+ | 101, _, [.v14 e] => .v14 (e)
+ | 102, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "*" l r)
+ | 103, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "/" l r)
+ | 104, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "%" l r)
+ | 105, _, [.v14 e] => .v14 (e)
+ | 106, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "+" l r)
+ | 107, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "-" l r)
+ | 108, _, [.v14 e] => .v14 (e)
+ | 109, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "<<" l r)
+ | 110, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop ">>" l r)
+ | 111, _, [.v14 e] => .v14 (e)
+ | 112, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "<" l r)
+ | 113, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop ">" l r)
+ | 114, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "<=" l r)
+ | 115, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop ">=" l r)
+ | 116, _, [.v14 e] => .v14 (e)
+ | 117, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "==" l r)
+ | 118, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "!=" l r)
+ | 119, _, [.v14 e] => .v14 (e)
+ | 120, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "&" l r)
+ | 121, _, [.v14 e] => .v14 (e)
+ | 122, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "^" l r)
+ | 123, _, [.v14 e] => .v14 (e)
+ | 124, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "|" l r)
+ | 125, _, [.v14 e] => .v14 (e)
+ | 126, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "&&" l r)
+ | 127, _, [.v14 e] => .v14 (e)
+ | 128, _, [.v14 l, _, .v14 r] => .v14 (Expr.binop "||" l r)
+ | 129, _, [.v14 e] => .v14 (e)
+ | 130, _, [.v14 c, _, .v14 t, _, .v14 f] => .v14 (Expr.cond c t f)
+ | 131, _, [.v14 e] => .v14 (e)
+ | 132, _, [.v14 l, .v17 op, .v14 r] => .v14 (Expr.assign op l r)
+ | 133, _, [_] => .v17 (.eq)
+ | 134, _, [_] => .v17 (.mulEq)
+ | 135, _, [_] => .v17 (.divEq)
+ | 136, _, [_] => .v17 (.modEq)
+ | 137, _, [_] => .v17 (.addEq)
+ | 138, _, [_] => .v17 (.subEq)
+ | 139, _, [_] => .v17 (.shlEq)
+ | 140, _, [_] => .v17 (.shrEq)
+ | 141, _, [_] => .v17 (.andEq)
+ | 142, _, [_] => .v17 (.xorEq)
+ | 143, _, [_] => .v17 (.orEq)
+ | 144, _, [.v14 e] => .v14 (e)
+ | 145, _, [.v14 l, _, .v14 r] => .v14 (Expr.comma l r)
+ | 146, _, [.v14 e] => .v14 (e)
+ | 147, _, [.v18 s] => .v18 (s)
+ | 148, _, [.v18 s] => .v18 (s)
+ | 149, _, [.v18 s] => .v18 (s)
+ | 150, _, [.v18 s] => .v18 (s)
+ | 151, _, [.v18 s] => .v18 (s)
+ | 152, _, [.v22 label, _, .v18 s] => .v18 (Stmt.labeled label s)
+ | 153, _, [_, .v14 e, _, .v18 s] => .v18 (Stmt.case e s)
+ | 154, _, [_, _, .v18 s] => .v18 (Stmt.default s)
+ | 155, _, [_, _, .v14 c, _, .v18 t, _, .v18 e] => .v18 (Stmt.ifElse c t e)
+ | 156, _, [_, _, .v14 c, _, .v18 s] => .v18 (Stmt.switch c s)
+ | 157, _, [_, _, .v14 c, _, .v18 s] => .v18 (Stmt.whileDo c s)
+ | 158, _, [_, .v18 s, _, _, .v14 c, _, _] => .v18 (Stmt.doWhile s c)
+ | 159, _, [_, _, .v21 i, _, .v21 c, _, .v21 step, _, .v18 s] => .v18 (Stmt.forLoop i c step s)
+ | 160, _, [.v22 label, _, .v18 s] => .v18 (Stmt.labeled label s)
+ | 161, _, [_, .v14 e, _, .v18 s] => .v18 (Stmt.case e s)
+ | 162, _, [_, _, .v18 s] => .v18 (Stmt.default s)
+ | 163, _, [_, _, .v14 c, _, .v18 s] => .v18 (Stmt.ifThen c s)
+ | 164, _, [_, _, .v14 c, _, .v18 t, _, .v18 e] => .v18 (Stmt.ifElse c t e)
+ | 165, _, [_, _, .v14 c, _, .v18 s] => .v18 (Stmt.switch c s)
+ | 166, _, [_, _, .v14 c, _, .v18 s] => .v18 (Stmt.whileDo c s)
+ | 167, _, [_, _, .v21 i, _, .v21 c, _, .v21 step, _, .v18 s] => .v18 (Stmt.forLoop i c step s)
+ | 168, _, [_, _] => .v18 (Stmt.compound [])
+ | 169, _, [_, .v19 items, _] => .v18 (Stmt.compound items)
+ | 170, _, [.v20 i] => .v19 ([i])
+ | 171, _, [.v20 i, .v19 rest] => .v19 (i :: rest)
+ | 172, _, [.v4 d] => .v20 (BlockItem.decl d)
+ | 173, _, [.v18 s] => .v20 (BlockItem.stmt s)
+ | 174, _, [_] => .v18 (Stmt.expr none)
+ | 175, _, [.v14 e, _] => .v18 (Stmt.expr (some e))
+ | 176, _, [] => .v21 (none)
+ | 177, _, [.v14 e] => .v21 (some e)
+ | 178, _, [_, .v22 label, _] => .v18 (Stmt.goto label)
+ | 179, _, [_, _] => .v18 (Stmt.continueStmt)
+ | 180, _, [_, _] => .v18 (Stmt.breakStmt)
+ | 181, _, [_, _] => .v18 (Stmt.returnStmt none)
+ | 182, _, [_, .v14 e, _] => .v18 (Stmt.returnStmt (some e))
+ | 183, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -547,6 +550,70 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c21 st _ _ _ _ => st
| .c22 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+ | .c7 _ _ e _ _ => e
+ | .c8 _ _ e _ _ => e
+ | .c9 _ _ e _ _ => e
+ | .c10 _ _ e _ _ => e
+ | .c11 _ _ e _ _ => e
+ | .c12 _ _ e _ _ => e
+ | .c13 _ _ e _ _ => e
+ | .c14 _ _ e _ _ => e
+ | .c15 _ _ e _ _ => e
+ | .c16 _ _ e _ _ => e
+ | .c17 _ _ e _ _ => e
+ | .c18 _ _ e _ _ => e
+ | .c19 _ _ e _ _ => e
+ | .c20 _ _ e _ _ => e
+ | .c21 _ _ e _ _ => e
+ | .c22 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+ | .c7 st _ e _ _ => k st e
+ | .c8 st _ e _ _ => k st e
+ | .c9 st _ e _ _ => k st e
+ | .c10 st _ e _ _ => k st e
+ | .c11 st _ e _ _ => k st e
+ | .c12 st _ e _ _ => k st e
+ | .c13 st _ e _ _ => k st e
+ | .c14 st _ e _ _ => k st e
+ | .c15 st _ e _ _ => k st e
+ | .c16 st _ e _ _ => k st e
+ | .c17 st _ e _ _ => k st e
+ | .c18 st _ e _ _ => k st e
+ | .c19 st _ e _ _ => k st e
+ | .c20 st _ e _ _ => k st e
+ | .c21 st _ e _ _ => k st e
+ | .c22 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -684,6 +751,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.shift 18, .shift 19, .shift 20, .shift 21, .shift 22, .shift 23, .shift 24, .shift 25, .shift 26, .shift 27,
@@ -4769,7 +4837,7 @@ def fuse175 : Stk → Stk :=
| _ => .fail stk
def fuse176 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 56 53 (Stk.top 0 __tail) (fun __st => .c21 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 56 53 __top (fun __st => .c21 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse177 : Stk → Stk :=
fun stk => match stk with
@@ -4829,6 +4897,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -6416,9 +6485,9 @@ theorem fuseOK175 : Runtime.Exec.FuseOKAt stackOps flat 175 fuse175 := by
theorem fuseOK176 : Runtime.Exec.FuseOKAt stackOps flat 176 fuse176 := by
intro stk
- unfold fuse176
+ simp only [fuse176, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 176
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 176
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK177 : Runtime.Exec.FuseOKAt stackOps flat 177 fuse177 := by
diff --git a/test/c99/C99Verified.lean b/test/c99/C99Verified.lean
index cf1b158..2d5d215 100644
--- a/test/c99/C99Verified.lean
+++ b/test/c99/C99Verified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -43,6 +45,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace C99Verified
abbrev Terminal := Fin 88
@@ -489,153 +493,153 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 55
augmentedProduction := 183 }
-def semTbl : List (Σ T : Type, T → C99Parser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(TranslationUnit : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(List ExternalDecl : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(ExternalDecl : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(FunctionDef : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Declaration : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(List TypeSpec : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(TypeSpec : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(TypeSpec : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(TypeSpec : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(List InitDeclarator : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(InitDeclarator : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(Declarator : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(Declarator : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(List Param : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(Param : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(CTypeName : Type), fun v => (Runtime.Span.dummy, .v12 v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v13 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(List Expr : Type), fun v => (Runtime.Span.dummy, .v15 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(UnaryOp : Type), fun v => (Runtime.Span.dummy, .v16 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(AssignOp : Type), fun v => (Runtime.Span.dummy, .v17 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(List BlockItem : Type), fun v => (Runtime.Span.dummy, .v19 v)⟩,
- ⟨(BlockItem : Type), fun v => (Runtime.Span.dummy, .v20 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Option Expr : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(TranslationUnit : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → C99Parser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → C99Parser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(String : Type), fun v => .v22 v⟩,
+ ⟨(String : Type), fun v => .v22 v⟩,
+ ⟨(String : Type), fun v => .v22 v⟩,
+ ⟨(String : Type), fun v => .v22 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(TranslationUnit : Type), fun v => .v0 v⟩,
+ ⟨(List ExternalDecl : Type), fun v => .v1 v⟩,
+ ⟨(ExternalDecl : Type), fun v => .v2 v⟩,
+ ⟨(FunctionDef : Type), fun v => .v3 v⟩,
+ ⟨(Declaration : Type), fun v => .v4 v⟩,
+ ⟨(List TypeSpec : Type), fun v => .v5 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(TypeSpec : Type), fun v => .v6 v⟩,
+ ⟨(TypeSpec : Type), fun v => .v6 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(TypeSpec : Type), fun v => .v6 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(List InitDeclarator : Type), fun v => .v7 v⟩,
+ ⟨(InitDeclarator : Type), fun v => .v8 v⟩,
+ ⟨(Declarator : Type), fun v => .v9 v⟩,
+ ⟨(Declarator : Type), fun v => .v9 v⟩,
+ ⟨(List Param : Type), fun v => .v10 v⟩,
+ ⟨(Param : Type), fun v => .v11 v⟩,
+ ⟨(CTypeName : Type), fun v => .v12 v⟩,
+ ⟨(Nat : Type), fun v => .v13 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(List Expr : Type), fun v => .v15 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(UnaryOp : Type), fun v => .v16 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(AssignOp : Type), fun v => .v17 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Expr : Type), fun v => .v14 v⟩,
+ ⟨(Stmt : Type), fun v => .v18 v⟩,
+ ⟨(Stmt : Type), fun v => .v18 v⟩,
+ ⟨(Stmt : Type), fun v => .v18 v⟩,
+ ⟨(Stmt : Type), fun v => .v18 v⟩,
+ ⟨(List BlockItem : Type), fun v => .v19 v⟩,
+ ⟨(BlockItem : Type), fun v => .v20 v⟩,
+ ⟨(Stmt : Type), fun v => .v18 v⟩,
+ ⟨(Option Expr : Type), fun v => .v21 v⟩,
+ ⟨(Stmt : Type), fun v => .v18 v⟩,
+ ⟨(TranslationUnit : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → C99Parser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -644,562 +648,562 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (ds : List ExternalDecl) => (TranslationUnit.mk ds)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ds : List ExternalDecl) => (TranslationUnit.mk ds)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : ExternalDecl) => ([d])
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : ExternalDecl) => ([d])
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List ExternalDecl) (d : ExternalDecl) => (d :: rest)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List ExternalDecl) (d : ExternalDecl) => (d :: rest)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : FunctionDef) => (ExternalDecl.function f)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : FunctionDef) => (ExternalDecl.function f)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declaration) => (ExternalDecl.decl d)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declaration) => (ExternalDecl.decl d)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨49, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (body : Stmt) (d : Declarator) (specs : List TypeSpec) => (FunctionDef.mk specs d body)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨49, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (body : Stmt) (d : Declarator) (specs : List TypeSpec) => (FunctionDef.mk specs d body)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (specs : List TypeSpec) => (Declaration.mk false specs [])
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (specs : List TypeSpec) => (Declaration.mk false specs [])
-def semanticAction7 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ids : List InitDeclarator) (specs : List TypeSpec) => (Declaration.mk false specs ids)
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ids : List InitDeclarator) (specs : List TypeSpec) => (Declaration.mk false specs ids)
-def semanticAction8 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ids : List InitDeclarator) (specs : List TypeSpec) (_ : Unit) => (Declaration.mk true specs ids)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ids : List InitDeclarator) (specs : List TypeSpec) (_ : Unit) => (Declaration.mk true specs ids)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : TypeSpec) => ([s])
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : TypeSpec) => ([s])
-def semanticAction10 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List TypeSpec) (s : TypeSpec) => (s :: rest)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List TypeSpec) (s : TypeSpec) => (s :: rest)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List TypeSpec) (_ : Unit) => (rest)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List TypeSpec) (_ : Unit) => (rest)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List TypeSpec) (_ : Unit) => (rest)
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List TypeSpec) (_ : Unit) => (rest)
-def semanticAction13 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction14 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction15 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction16 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction17 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction18 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction19 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction20 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction21 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.void)
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.void)
-def semanticAction22 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.char)
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.char)
-def semanticAction23 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.short)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.short)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.int)
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.int)
-def semanticAction25 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.long)
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.long)
-def semanticAction26 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.float)
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.float)
-def semanticAction27 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.double)
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.double)
-def semanticAction28 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.signed)
+def semanticAction28 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.signed)
-def semanticAction29 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.unsigned)
+def semanticAction29 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.unsigned)
-def semanticAction30 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.bool)
+def semanticAction30 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.bool)
-def semanticAction31 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.complex)
+def semanticAction31 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.complex)
-def semanticAction32 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : TypeSpec) => (s)
+def semanticAction32 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : TypeSpec) => (s)
-def semanticAction33 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : TypeSpec) => (s)
+def semanticAction33 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : TypeSpec) => (s)
-def semanticAction34 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (name : String) => (.typedefName name)
+def semanticAction34 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (name : String) => (.typedefName name)
-def semanticAction35 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (tag : String) (_ : Unit) => (.structOrUnion tag)
+def semanticAction35 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tag : String) (_ : Unit) => (.structOrUnion tag)
-def semanticAction36 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (.structOrUnion "")
+def semanticAction36 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (.structOrUnion "")
-def semanticAction37 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Unit) (tag : String) (_ : Unit) => (.structOrUnion tag)
+def semanticAction37 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Unit) (tag : String) (_ : Unit) => (.structOrUnion tag)
-def semanticAction38 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction38 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction39 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction39 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction40 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction40 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction41 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) => (())
+def semanticAction41 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) => (())
-def semanticAction42 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : List TypeSpec) => (())
+def semanticAction42 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : List TypeSpec) => (())
-def semanticAction43 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Declarator) => (())
+def semanticAction43 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Declarator) => (())
-def semanticAction44 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Declarator) => (())
+def semanticAction44 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Declarator) => (())
-def semanticAction45 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (tag : String) (_ : Unit) => (.enumSpec tag)
+def semanticAction45 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tag : String) (_ : Unit) => (.enumSpec tag)
-def semanticAction46 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (.enumSpec "")
+def semanticAction46 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (.enumSpec "")
-def semanticAction47 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Unit) (tag : String) (_ : Unit) => (.enumSpec tag)
+def semanticAction47 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Unit) (tag : String) (_ : Unit) => (.enumSpec tag)
-def semanticAction48 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction48 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction49 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Unit) => (())
+def semanticAction49 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Unit) => (())
-def semanticAction50 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : String) => (())
+def semanticAction50 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : String) => (())
-def semanticAction51 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨74, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Expr) (_ : Unit) (_ : String) => (())
+def semanticAction51 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨74, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Expr) (_ : Unit) (_ : String) => (())
-def semanticAction52 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (id : InitDeclarator) => ([id])
+def semanticAction52 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (id : InitDeclarator) => ([id])
-def semanticAction53 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List InitDeclarator) (_ : Unit) (id : InitDeclarator) => (id :: rest)
+def semanticAction53 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List InitDeclarator) (_ : Unit) (id : InitDeclarator) => (id :: rest)
-def semanticAction54 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declarator) => (InitDeclarator.mk d none)
+def semanticAction54 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declarator) => (InitDeclarator.mk d none)
-def semanticAction55 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨74, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) (d : Declarator) => (InitDeclarator.mk d (some e))
+def semanticAction55 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨74, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) (d : Declarator) => (InitDeclarator.mk d (some e))
-def semanticAction56 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declarator) => (d)
+def semanticAction56 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declarator) => (d)
-def semanticAction57 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declarator) (_ : Unit) => (Declarator.pointer d)
+def semanticAction57 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declarator) (_ : Unit) => (Declarator.pointer d)
-def semanticAction58 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (name : String) => (Declarator.name name)
+def semanticAction58 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (name : String) => (Declarator.name name)
-def semanticAction59 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (d : Declarator) (_ : Unit) => (Declarator.paren d)
+def semanticAction59 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (d : Declarator) (_ : Unit) => (Declarator.paren d)
-def semanticAction60 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨41, of_decide_eq_true rfl⟩, Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (d : Declarator) => (Declarator.array d none)
+def semanticAction60 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨41, of_decide_eq_true rfl⟩, Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (d : Declarator) => (Declarator.array d none)
-def semanticAction61 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) (_ : Unit) (d : Declarator) => (Declarator.array d (some e))
+def semanticAction61 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) (_ : Unit) (d : Declarator) => (Declarator.array d (some e))
-def semanticAction62 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (d : Declarator) => (Declarator.func d [])
+def semanticAction62 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (d : Declarator) => (Declarator.func d [])
-def semanticAction63 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ps : List Param) (_ : Unit) (d : Declarator) => (Declarator.func d ps)
+def semanticAction63 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ps : List Param) (_ : Unit) (d : Declarator) => (Declarator.func d ps)
-def semanticAction64 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (p : Param) => ([p])
+def semanticAction64 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (p : Param) => ([p])
-def semanticAction65 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Param) (_ : Unit) (p : Param) => (p :: rest)
+def semanticAction65 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Param) (_ : Unit) (p : Param) => (p :: rest)
-def semanticAction66 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨73, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (p : Param) => ([p, Param.ellipsis])
+def semanticAction66 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨73, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (p : Param) => ([p, Param.ellipsis])
-def semanticAction67 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declarator) (specs : List TypeSpec) => (Param.mk specs (some d))
+def semanticAction67 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declarator) (specs : List TypeSpec) => (Param.mk specs (some d))
-def semanticAction68 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (specs : List TypeSpec) => (Param.mk specs none)
+def semanticAction68 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (specs : List TypeSpec) => (Param.mk specs none)
-def semanticAction69 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (specs : List TypeSpec) => (CTypeName.mk specs (0 : Nat))
+def semanticAction69 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (specs : List TypeSpec) => (CTypeName.mk specs (0 : Nat))
-def semanticAction70 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (p : Nat) (specs : List TypeSpec) => (CTypeName.mk specs p)
+def semanticAction70 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (p : Nat) (specs : List TypeSpec) => (CTypeName.mk specs p)
-def semanticAction71 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ((1 : Nat))
+def semanticAction71 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ((1 : Nat))
-def semanticAction72 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (p : Nat) (_ : Unit) => (p + 1)
+def semanticAction72 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (p : Nat) (_ : Unit) => (p + 1)
-def semanticAction73 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (name : String) => (Expr.ident name)
+def semanticAction73 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (name : String) => (Expr.ident name)
-def semanticAction74 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (Expr.constant value)
+def semanticAction74 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (Expr.constant value)
-def semanticAction75 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨39, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (Expr.stringLit value)
+def semanticAction75 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨39, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (Expr.stringLit value)
-def semanticAction76 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) (_ : Unit) => (Expr.paren e)
+def semanticAction76 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) (_ : Unit) => (Expr.paren e)
-def semanticAction77 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction77 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction78 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (i : Expr) (_ : Unit) (e : Expr) => (Expr.index e i)
+def semanticAction78 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨40, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (i : Expr) (_ : Unit) (e : Expr) => (Expr.index e i)
-def semanticAction79 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (e : Expr) => (Expr.call e [])
+def semanticAction79 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (e : Expr) => (Expr.call e [])
-def semanticAction80 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (args : List Expr) (_ : Unit) (e : Expr) => (Expr.call e args)
+def semanticAction80 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (args : List Expr) (_ : Unit) (e : Expr) => (Expr.call e args)
-def semanticAction81 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨46, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (field : String) (_ : Unit) (e : Expr) => (Expr.field e field)
+def semanticAction81 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨46, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (field : String) (_ : Unit) (e : Expr) => (Expr.field e field)
-def semanticAction82 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨47, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (field : String) (_ : Unit) (e : Expr) => (Expr.arrow e field)
+def semanticAction82 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨47, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (field : String) (_ : Unit) (e : Expr) => (Expr.arrow e field)
-def semanticAction83 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) => (Expr.postInc e)
+def semanticAction83 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) => (Expr.postInc e)
-def semanticAction84 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨49, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) => (Expr.postDec e)
+def semanticAction84 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨49, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) => (Expr.postDec e)
-def semanticAction85 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => ([e])
+def semanticAction85 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => ([e])
-def semanticAction86 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Expr) (_ : Unit) (e : Expr) => (e :: rest)
+def semanticAction86 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Expr) (_ : Unit) (e : Expr) => (e :: rest)
-def semanticAction87 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction87 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨26, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction88 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) => (Expr.preInc e)
+def semanticAction88 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) => (Expr.preInc e)
-def semanticAction89 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨49, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) => (Expr.preDec e)
+def semanticAction89 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨49, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) => (Expr.preDec e)
-def semanticAction90 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (op : UnaryOp) => (Expr.unary op e)
+def semanticAction90 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (op : UnaryOp) => (Expr.unary op e)
-def semanticAction91 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) => (Expr.sizeofExpr e)
+def semanticAction91 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) => (Expr.sizeofExpr e)
-def semanticAction92 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (t : CTypeName) (_ : Unit) (_ : Unit) => (Expr.sizeofType t)
+def semanticAction92 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (t : CTypeName) (_ : Unit) (_ : Unit) => (Expr.sizeofType t)
-def semanticAction93 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨50, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.addr)
+def semanticAction93 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨50, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.addr)
-def semanticAction94 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.deref)
+def semanticAction94 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.deref)
-def semanticAction95 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨52, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.plus)
+def semanticAction95 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨52, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.plus)
-def semanticAction96 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨53, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.minus)
+def semanticAction96 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨53, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.minus)
-def semanticAction97 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨54, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.bnot)
+def semanticAction97 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨54, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.bnot)
-def semanticAction98 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨55, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.lnot)
+def semanticAction98 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨55, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.lnot)
-def semanticAction99 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction99 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction100 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) (t : CTypeName) (_ : Unit) => (Expr.cast t e)
+def semanticAction100 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) (t : CTypeName) (_ : Unit) => (Expr.cast t e)
-def semanticAction101 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction101 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction102 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨51, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "*" l r)
+def semanticAction102 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨51, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "*" l r)
-def semanticAction103 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨56, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "/" l r)
+def semanticAction103 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨56, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "/" l r)
-def semanticAction104 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨57, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "%" l r)
+def semanticAction104 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩, Symbol.T ⟨57, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "%" l r)
-def semanticAction105 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction105 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction106 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨52, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "+" l r)
+def semanticAction106 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨52, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "+" l r)
-def semanticAction107 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨53, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "-" l r)
+def semanticAction107 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨53, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "-" l r)
-def semanticAction108 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction108 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction109 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.T ⟨58, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "<<" l r)
+def semanticAction109 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.T ⟨58, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "<<" l r)
-def semanticAction110 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.T ⟨59, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop ">>" l r)
+def semanticAction110 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.T ⟨59, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop ">>" l r)
-def semanticAction111 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction111 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction112 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨60, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "<" l r)
+def semanticAction112 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨60, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "<" l r)
-def semanticAction113 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨61, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop ">" l r)
+def semanticAction113 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨61, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop ">" l r)
-def semanticAction114 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨62, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "<=" l r)
+def semanticAction114 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨62, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "<=" l r)
-def semanticAction115 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨63, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop ">=" l r)
+def semanticAction115 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨63, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop ">=" l r)
-def semanticAction116 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction116 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction117 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨64, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "==" l r)
+def semanticAction117 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨64, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "==" l r)
-def semanticAction118 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨65, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "!=" l r)
+def semanticAction118 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨65, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "!=" l r)
-def semanticAction119 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction119 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction120 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.T ⟨50, of_decide_eq_true rfl⟩, Symbol.NT ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "&" l r)
+def semanticAction120 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.T ⟨50, of_decide_eq_true rfl⟩, Symbol.NT ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "&" l r)
-def semanticAction121 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction121 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction122 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨66, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "^" l r)
+def semanticAction122 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨66, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "^" l r)
-def semanticAction123 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction123 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction124 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨67, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "|" l r)
+def semanticAction124 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨67, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "|" l r)
-def semanticAction125 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction125 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction126 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨68, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "&&" l r)
+def semanticAction126 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨68, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "&&" l r)
-def semanticAction127 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction127 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction128 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨69, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "||" l r)
+def semanticAction128 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨69, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.binop "||" l r)
-def semanticAction129 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨40, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction129 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨40, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction130 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨70, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : Expr) (_ : Unit) (t : Expr) (_ : Unit) (c : Expr) => (Expr.cond c t f)
+def semanticAction130 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨70, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : Expr) (_ : Unit) (t : Expr) (_ : Unit) (c : Expr) => (Expr.cond c t f)
-def semanticAction131 : arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction131 : List Runtime.Span → arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction132 : arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (op : AssignOp) (l : Expr) => (Expr.assign op l r)
+def semanticAction132 : List Runtime.Span → arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.NT ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (op : AssignOp) (l : Expr) => (Expr.assign op l r)
-def semanticAction133 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨74, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.eq)
+def semanticAction133 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨74, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.eq)
-def semanticAction134 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨75, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.mulEq)
+def semanticAction134 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨75, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.mulEq)
-def semanticAction135 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨76, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.divEq)
+def semanticAction135 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨76, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.divEq)
-def semanticAction136 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨77, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.modEq)
+def semanticAction136 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨77, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.modEq)
-def semanticAction137 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨78, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.addEq)
+def semanticAction137 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨78, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.addEq)
-def semanticAction138 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨79, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.subEq)
+def semanticAction138 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨79, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.subEq)
-def semanticAction139 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨80, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.shlEq)
+def semanticAction139 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨80, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.shlEq)
-def semanticAction140 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨81, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.shrEq)
+def semanticAction140 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨81, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.shrEq)
-def semanticAction141 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨82, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.andEq)
+def semanticAction141 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨82, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.andEq)
-def semanticAction142 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨83, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.xorEq)
+def semanticAction142 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨83, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.xorEq)
-def semanticAction143 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨84, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.orEq)
+def semanticAction143 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨84, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.orEq)
-def semanticAction144 : arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction144 : List Runtime.Span → arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction145 : arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.comma l r)
+def semanticAction145 : List Runtime.Span → arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨85, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : Expr) (_ : Unit) (l : Expr) => (Expr.comma l r)
-def semanticAction146 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction146 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction147 : arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) => (s)
+def semanticAction147 : List Runtime.Span → arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) => (s)
-def semanticAction148 : arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) => (s)
+def semanticAction148 : List Runtime.Span → arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) => (s)
-def semanticAction149 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨49, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) => (s)
+def semanticAction149 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨49, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) => (s)
-def semanticAction150 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨52, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) => (s)
+def semanticAction150 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨52, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) => (s)
-def semanticAction151 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨54, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) => (s)
+def semanticAction151 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨54, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) => (s)
-def semanticAction152 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (label : String) => (Stmt.labeled label s)
+def semanticAction152 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (label : String) => (Stmt.labeled label s)
-def semanticAction153 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (e : Expr) (_ : Unit) => (Stmt.case e s)
+def semanticAction153 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (e : Expr) (_ : Unit) => (Stmt.case e s)
-def semanticAction154 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (_ : Unit) => (Stmt.default s)
+def semanticAction154 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (_ : Unit) => (Stmt.default s)
-def semanticAction155 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Stmt) (_ : Unit) (t : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.ifElse c t e)
+def semanticAction155 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Stmt) (_ : Unit) (t : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.ifElse c t e)
-def semanticAction156 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.switch c s)
+def semanticAction156 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.switch c s)
-def semanticAction157 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.whileDo c s)
+def semanticAction157 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.whileDo c s)
-def semanticAction158 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨46, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) (s : Stmt) (_ : Unit) => (Stmt.doWhile s c)
+def semanticAction158 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨46, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) (s : Stmt) (_ : Unit) => (Stmt.doWhile s c)
-def semanticAction159 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (step : Option Expr) (_ : Unit) (c : Option Expr) (_ : Unit) (i : Option Expr) (_ : Unit) (_ : Unit) => (Stmt.forLoop i c step s)
+def semanticAction159 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (step : Option Expr) (_ : Unit) (c : Option Expr) (_ : Unit) (i : Option Expr) (_ : Unit) (_ : Unit) => (Stmt.forLoop i c step s)
-def semanticAction160 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (label : String) => (Stmt.labeled label s)
+def semanticAction160 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (label : String) => (Stmt.labeled label s)
-def semanticAction161 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (e : Expr) (_ : Unit) => (Stmt.case e s)
+def semanticAction161 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (e : Expr) (_ : Unit) => (Stmt.case e s)
-def semanticAction162 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (_ : Unit) => (Stmt.default s)
+def semanticAction162 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨71, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (_ : Unit) => (Stmt.default s)
-def semanticAction163 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨46, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.ifThen c s)
+def semanticAction163 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨46, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.ifThen c s)
-def semanticAction164 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Stmt) (_ : Unit) (t : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.ifElse c t e)
+def semanticAction164 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Stmt) (_ : Unit) (t : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.ifElse c t e)
-def semanticAction165 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.switch c s)
+def semanticAction165 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.switch c s)
-def semanticAction166 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.whileDo c s)
+def semanticAction166 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (c : Expr) (_ : Unit) (_ : Unit) => (Stmt.whileDo c s)
-def semanticAction167 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) (_ : Unit) (step : Option Expr) (_ : Unit) (c : Option Expr) (_ : Unit) (i : Option Expr) (_ : Unit) (_ : Unit) => (Stmt.forLoop i c step s)
+def semanticAction167 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨43, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨53, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) (_ : Unit) (step : Option Expr) (_ : Unit) (c : Option Expr) (_ : Unit) (i : Option Expr) (_ : Unit) (_ : Unit) => (Stmt.forLoop i c step s)
-def semanticAction168 : arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) => (Stmt.compound [])
+def semanticAction168 : List Runtime.Span → arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) => (Stmt.compound [])
-def semanticAction169 : arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨50, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (items : List BlockItem) (_ : Unit) => (Stmt.compound items)
+def semanticAction169 : List Runtime.Span → arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩, Symbol.NT ⟨50, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (items : List BlockItem) (_ : Unit) => (Stmt.compound items)
-def semanticAction170 : arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (i : BlockItem) => ([i])
+def semanticAction170 : List Runtime.Span → arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (i : BlockItem) => ([i])
-def semanticAction171 : arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨50, of_decide_eq_true rfl⟩, Symbol.NT ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List BlockItem) (i : BlockItem) => (i :: rest)
+def semanticAction171 : List Runtime.Span → arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨50, of_decide_eq_true rfl⟩, Symbol.NT ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List BlockItem) (i : BlockItem) => (i :: rest)
-def semanticAction172 : arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declaration) => (BlockItem.decl d)
+def semanticAction172 : List Runtime.Span → arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declaration) => (BlockItem.decl d)
-def semanticAction173 : arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Stmt) => (BlockItem.stmt s)
+def semanticAction173 : List Runtime.Span → arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Stmt) => (BlockItem.stmt s)
-def semanticAction174 : arrowsRight (semT' (.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (Stmt.expr none)
+def semanticAction174 : List Runtime.Span → arrowsRight (semT' (.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (Stmt.expr none)
-def semanticAction175 : arrowsRight (semT' (.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) => (Stmt.expr (some e))
+def semanticAction175 : List Runtime.Span → arrowsRight (semT' (.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) => (Stmt.expr (some e))
-def semanticAction176 : arrowsRight (semT' (.NT (⟨53, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option Expr)
+def semanticAction176 : List Runtime.Span → arrowsRight (semT' (.NT (⟨53, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option Expr)
-def semanticAction177 : arrowsRight (semT' (.NT (⟨53, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (some e)
+def semanticAction177 : List Runtime.Span → arrowsRight (semT' (.NT (⟨53, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (some e)
-def semanticAction178 : arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (label : String) (_ : Unit) => (Stmt.goto label)
+def semanticAction178 : List Runtime.Span → arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨36, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (label : String) (_ : Unit) => (Stmt.goto label)
-def semanticAction179 : arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) => (Stmt.continueStmt)
+def semanticAction179 : List Runtime.Span → arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) => (Stmt.continueStmt)
-def semanticAction180 : arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) => (Stmt.breakStmt)
+def semanticAction180 : List Runtime.Span → arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) => (Stmt.breakStmt)
-def semanticAction181 : arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) => (Stmt.returnStmt none)
+def semanticAction181 : List Runtime.Span → arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) => (Stmt.returnStmt none)
-def semanticAction182 : arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) (_ : Unit) => (Stmt.returnStmt (some e))
+def semanticAction182 : List Runtime.Span → arrowsRight (semT' (.NT (⟨54, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨72, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) (_ : Unit) => (Stmt.returnStmt (some e))
-def semanticAction183 : arrowsRight (semT' (.NT (⟨55, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨87, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction183 : List Runtime.Span → arrowsRight (semT' (.NT (⟨55, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨87, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨2, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩]) semanticAction2
@@ -1392,7 +1396,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -1669,13 +1673,15 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
abbrev lastSymb' : NonInitState → Symbol Terminal NonTerminal
| s => match s with
| ⟨0, _⟩ => Symbol.NT ⟨1, of_decide_eq_true rfl⟩
@@ -4107,1495 +4113,1495 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option TranslationUnit :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option TranslationUnit :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : C99Parser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : C99Parser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees28 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 28 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 28 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees29 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 29 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 29 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees30 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 30 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 30 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees31 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 31 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 31 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees32 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 32 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 32 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees33 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 33 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 33 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees34 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 34 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 34 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees35 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 35 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 35 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees36 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 36 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 36 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees37 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 37 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 37 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees38 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 38 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 38 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees39 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 39 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 39 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees40 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 40 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 40 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees41 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 41 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 41 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees42 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 42 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 42 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees43 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 43 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 43 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees44 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 44 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 44 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees45 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 45 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 45 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees46 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 46 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 46 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees47 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 47 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 47 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees48 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 48 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 48 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees49 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 49 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 49 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees50 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 50 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 50 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees51 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 51 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 51 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees52 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 52 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 52 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees53 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 53 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 53 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees54 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 54 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 54 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees55 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 55 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 55 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees56 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 56 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 56 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees57 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 57 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 57 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees58 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 58 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 58 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees59 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 59 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 59 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees60 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 60 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 60 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees61 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 61 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 61 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees62 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 62 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 62 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees63 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 63 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 63 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees64 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 64 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 64 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees65 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 65 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 65 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees66 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 66 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 66 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees67 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 67 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 67 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees68 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 68 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 68 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees69 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 69 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 69 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees70 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 70 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 70 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees71 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 71 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 71 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees72 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 72 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 72 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees73 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 73 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 73 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees74 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 74 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 74 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees75 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 75 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 75 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees76 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 76 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 76 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees77 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 77 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 77 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees78 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 78 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 78 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees79 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 79 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 79 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees80 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 80 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 80 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees81 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 81 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 81 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees82 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 82 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 82 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees83 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 83 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 83 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees84 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 84 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 84 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees85 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 85 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 85 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees86 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 86 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 86 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees87 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 87 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 87 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees88 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 88 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 88 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees89 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 89 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 89 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees90 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 90 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 90 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees91 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 91 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 91 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees92 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 92 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 92 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees93 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 93 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 93 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees94 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 94 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 94 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees95 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 95 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 95 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees96 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 96 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 96 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees97 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 97 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 97 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees98 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 98 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 98 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees99 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 99 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 99 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees100 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 100 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 100 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees101 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 101 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 101 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees102 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 102 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 102 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees103 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨103, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 103 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨103, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 103 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨103, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨103, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨103, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees104 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨104, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 104 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨104, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 104 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨104, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨104, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨104, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees105 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨105, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 105 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨105, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 105 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨105, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨105, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨105, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees106 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨106, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 106 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨106, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 106 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨106, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨106, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨106, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees107 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨107, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 107 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨107, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 107 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨107, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨107, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨107, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees108 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨108, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 108 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨108, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 108 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨108, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨108, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨108, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees109 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨109, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 109 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨109, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 109 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨109, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨109, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨109, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees110 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨110, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 110 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨110, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 110 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨110, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨110, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨110, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees111 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨111, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 111 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨111, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 111 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨111, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨111, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨111, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees112 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨112, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 112 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨112, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 112 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨112, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨112, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨112, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees113 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨113, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 113 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨113, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 113 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨113, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨113, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨113, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees114 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨114, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 114 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨114, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 114 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨114, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨114, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨114, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees115 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨115, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 115 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨115, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 115 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨115, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨115, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨115, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees116 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨116, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 116 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨116, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 116 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨116, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨116, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨116, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees117 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨117, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 117 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨117, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 117 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨117, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨117, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨117, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees118 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨118, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 118 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨118, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 118 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨118, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨118, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨118, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees119 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨119, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 119 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨119, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 119 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨119, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨119, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨119, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees120 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨120, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 120 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨120, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 120 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨120, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨120, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨120, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees121 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨121, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 121 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨121, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 121 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨121, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨121, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨121, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees122 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨122, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 122 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨122, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 122 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨122, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨122, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨122, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees123 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨123, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 123 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨123, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 123 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨123, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨123, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨123, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees124 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨124, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 124 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨124, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 124 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨124, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨124, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨124, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees125 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨125, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 125 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨125, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 125 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨125, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨125, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨125, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees126 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨126, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 126 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨126, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 126 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨126, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨126, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨126, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees127 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨127, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 127 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨127, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 127 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨127, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨127, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨127, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees128 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨128, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 128 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨128, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 128 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨128, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨128, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨128, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees129 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨129, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 129 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨129, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 129 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨129, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨129, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨129, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees130 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨130, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 130 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨130, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 130 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨130, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨130, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨130, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees131 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨131, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 131 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨131, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 131 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨131, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨131, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨131, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees132 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨132, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 132 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨132, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 132 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨132, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨132, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨132, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees133 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨133, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 133 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨133, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 133 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨133, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨133, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨133, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees134 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨134, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 134 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨134, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 134 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨134, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨134, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨134, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees135 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨135, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 135 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨135, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 135 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨135, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨135, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨135, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees136 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨136, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 136 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨136, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 136 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨136, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨136, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨136, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees137 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨137, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 137 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨137, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 137 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨137, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨137, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨137, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees138 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨138, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 138 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨138, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 138 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨138, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨138, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨138, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees139 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨139, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 139 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨139, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 139 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨139, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨139, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨139, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees140 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨140, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 140 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨140, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 140 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨140, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨140, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨140, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees141 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨141, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 141 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨141, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 141 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨141, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨141, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨141, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees142 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨142, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 142 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨142, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 142 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨142, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨142, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨142, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees143 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨143, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 143 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨143, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 143 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨143, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨143, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨143, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees144 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨144, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 144 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨144, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 144 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨144, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨144, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨144, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees145 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨145, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 145 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨145, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 145 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨145, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨145, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨145, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees146 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨146, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 146 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨146, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 146 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨146, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨146, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨146, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees147 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨147, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 147 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨147, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 147 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨147, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨147, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨147, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees148 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨148, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 148 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨148, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 148 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨148, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨148, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨148, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees149 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨149, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 149 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨149, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 149 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨149, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨149, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨149, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees150 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨150, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 150 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨150, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 150 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨150, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨150, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨150, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees151 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨151, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 151 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨151, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 151 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨151, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨151, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨151, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees152 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨152, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 152 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨152, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 152 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨152, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨152, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨152, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees153 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨153, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 153 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨153, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 153 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨153, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨153, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨153, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees154 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨154, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 154 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨154, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 154 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨154, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨154, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨154, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees155 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨155, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 155 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨155, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 155 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨155, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨155, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨155, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees156 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨156, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 156 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨156, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 156 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨156, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨156, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨156, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees157 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨157, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 157 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨157, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 157 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨157, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨157, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨157, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees158 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨158, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 158 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨158, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 158 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨158, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨158, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨158, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees159 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨159, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 159 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨159, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 159 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨159, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨159, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))))) => rfl
+ (values.apply (prodAction' (⟨159, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))))) => rfl
theorem refinementSemanticAgrees160 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨160, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 160 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨160, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 160 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨160, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨160, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨160, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees161 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨161, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 161 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨161, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 161 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨161, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨161, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨161, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees162 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨162, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 162 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨162, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 162 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨162, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨162, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨162, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees163 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨163, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 163 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨163, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 163 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨163, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨163, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨163, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees164 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨164, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 164 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨164, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 164 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨164, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨164, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨164, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees165 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨165, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 165 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨165, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 165 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨165, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨165, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨165, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees166 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨166, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 166 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨166, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 166 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨166, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨166, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨166, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees167 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨167, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 167 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨167, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 167 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨167, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨167, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))))) => rfl
+ (values.apply (prodAction' (⟨167, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))))) => rfl
theorem refinementSemanticAgrees168 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨168, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 168 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨168, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 168 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨168, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨168, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨168, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees169 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨169, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 169 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨169, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 169 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨169, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨169, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨169, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees170 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨170, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 170 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨170, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 170 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨170, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨170, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨170, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees171 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨171, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 171 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨171, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 171 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨171, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨171, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨171, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees172 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨172, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 172 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨172, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 172 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨172, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨172, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨172, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees173 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨173, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 173 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨173, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 173 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨173, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨173, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨173, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees174 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨174, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 174 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨174, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 174 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨174, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨174, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨174, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees175 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨175, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 175 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨175, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 175 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨175, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨175, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨175, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees176 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨176, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 176 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨176, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 176 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨176, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨176, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨176, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees177 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨177, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 177 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨177, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 177 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨177, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨177, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨177, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees178 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨178, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 178 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨178, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 178 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨178, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨178, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨178, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees179 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨179, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 179 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨179, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 179 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨179, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨179, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨179, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees180 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨180, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 180 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨180, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 180 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨180, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨180, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨180, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees181 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨181, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 181 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨181, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 181 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨181, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨181, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨181, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees182 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨182, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 182 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨182, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 182 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨182, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨182, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨182, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees183 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨183, of_decide_eq_true rfl⟩ : Production))),
- C99Parser.table.sem 183 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨183, of_decide_eq_true rfl⟩ : Production))),
+ C99Parser.semV 183 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨183, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨183, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨183, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- C99Parser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ C99Parser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨28, _⟩, values => refinementSemanticAgrees28 values
- | ⟨29, _⟩, values => refinementSemanticAgrees29 values
- | ⟨30, _⟩, values => refinementSemanticAgrees30 values
- | ⟨31, _⟩, values => refinementSemanticAgrees31 values
- | ⟨32, _⟩, values => refinementSemanticAgrees32 values
- | ⟨33, _⟩, values => refinementSemanticAgrees33 values
- | ⟨34, _⟩, values => refinementSemanticAgrees34 values
- | ⟨35, _⟩, values => refinementSemanticAgrees35 values
- | ⟨36, _⟩, values => refinementSemanticAgrees36 values
- | ⟨37, _⟩, values => refinementSemanticAgrees37 values
- | ⟨38, _⟩, values => refinementSemanticAgrees38 values
- | ⟨39, _⟩, values => refinementSemanticAgrees39 values
- | ⟨40, _⟩, values => refinementSemanticAgrees40 values
- | ⟨41, _⟩, values => refinementSemanticAgrees41 values
- | ⟨42, _⟩, values => refinementSemanticAgrees42 values
- | ⟨43, _⟩, values => refinementSemanticAgrees43 values
- | ⟨44, _⟩, values => refinementSemanticAgrees44 values
- | ⟨45, _⟩, values => refinementSemanticAgrees45 values
- | ⟨46, _⟩, values => refinementSemanticAgrees46 values
- | ⟨47, _⟩, values => refinementSemanticAgrees47 values
- | ⟨48, _⟩, values => refinementSemanticAgrees48 values
- | ⟨49, _⟩, values => refinementSemanticAgrees49 values
- | ⟨50, _⟩, values => refinementSemanticAgrees50 values
- | ⟨51, _⟩, values => refinementSemanticAgrees51 values
- | ⟨52, _⟩, values => refinementSemanticAgrees52 values
- | ⟨53, _⟩, values => refinementSemanticAgrees53 values
- | ⟨54, _⟩, values => refinementSemanticAgrees54 values
- | ⟨55, _⟩, values => refinementSemanticAgrees55 values
- | ⟨56, _⟩, values => refinementSemanticAgrees56 values
- | ⟨57, _⟩, values => refinementSemanticAgrees57 values
- | ⟨58, _⟩, values => refinementSemanticAgrees58 values
- | ⟨59, _⟩, values => refinementSemanticAgrees59 values
- | ⟨60, _⟩, values => refinementSemanticAgrees60 values
- | ⟨61, _⟩, values => refinementSemanticAgrees61 values
- | ⟨62, _⟩, values => refinementSemanticAgrees62 values
- | ⟨63, _⟩, values => refinementSemanticAgrees63 values
- | ⟨64, _⟩, values => refinementSemanticAgrees64 values
- | ⟨65, _⟩, values => refinementSemanticAgrees65 values
- | ⟨66, _⟩, values => refinementSemanticAgrees66 values
- | ⟨67, _⟩, values => refinementSemanticAgrees67 values
- | ⟨68, _⟩, values => refinementSemanticAgrees68 values
- | ⟨69, _⟩, values => refinementSemanticAgrees69 values
- | ⟨70, _⟩, values => refinementSemanticAgrees70 values
- | ⟨71, _⟩, values => refinementSemanticAgrees71 values
- | ⟨72, _⟩, values => refinementSemanticAgrees72 values
- | ⟨73, _⟩, values => refinementSemanticAgrees73 values
- | ⟨74, _⟩, values => refinementSemanticAgrees74 values
- | ⟨75, _⟩, values => refinementSemanticAgrees75 values
- | ⟨76, _⟩, values => refinementSemanticAgrees76 values
- | ⟨77, _⟩, values => refinementSemanticAgrees77 values
- | ⟨78, _⟩, values => refinementSemanticAgrees78 values
- | ⟨79, _⟩, values => refinementSemanticAgrees79 values
- | ⟨80, _⟩, values => refinementSemanticAgrees80 values
- | ⟨81, _⟩, values => refinementSemanticAgrees81 values
- | ⟨82, _⟩, values => refinementSemanticAgrees82 values
- | ⟨83, _⟩, values => refinementSemanticAgrees83 values
- | ⟨84, _⟩, values => refinementSemanticAgrees84 values
- | ⟨85, _⟩, values => refinementSemanticAgrees85 values
- | ⟨86, _⟩, values => refinementSemanticAgrees86 values
- | ⟨87, _⟩, values => refinementSemanticAgrees87 values
- | ⟨88, _⟩, values => refinementSemanticAgrees88 values
- | ⟨89, _⟩, values => refinementSemanticAgrees89 values
- | ⟨90, _⟩, values => refinementSemanticAgrees90 values
- | ⟨91, _⟩, values => refinementSemanticAgrees91 values
- | ⟨92, _⟩, values => refinementSemanticAgrees92 values
- | ⟨93, _⟩, values => refinementSemanticAgrees93 values
- | ⟨94, _⟩, values => refinementSemanticAgrees94 values
- | ⟨95, _⟩, values => refinementSemanticAgrees95 values
- | ⟨96, _⟩, values => refinementSemanticAgrees96 values
- | ⟨97, _⟩, values => refinementSemanticAgrees97 values
- | ⟨98, _⟩, values => refinementSemanticAgrees98 values
- | ⟨99, _⟩, values => refinementSemanticAgrees99 values
- | ⟨100, _⟩, values => refinementSemanticAgrees100 values
- | ⟨101, _⟩, values => refinementSemanticAgrees101 values
- | ⟨102, _⟩, values => refinementSemanticAgrees102 values
- | ⟨103, _⟩, values => refinementSemanticAgrees103 values
- | ⟨104, _⟩, values => refinementSemanticAgrees104 values
- | ⟨105, _⟩, values => refinementSemanticAgrees105 values
- | ⟨106, _⟩, values => refinementSemanticAgrees106 values
- | ⟨107, _⟩, values => refinementSemanticAgrees107 values
- | ⟨108, _⟩, values => refinementSemanticAgrees108 values
- | ⟨109, _⟩, values => refinementSemanticAgrees109 values
- | ⟨110, _⟩, values => refinementSemanticAgrees110 values
- | ⟨111, _⟩, values => refinementSemanticAgrees111 values
- | ⟨112, _⟩, values => refinementSemanticAgrees112 values
- | ⟨113, _⟩, values => refinementSemanticAgrees113 values
- | ⟨114, _⟩, values => refinementSemanticAgrees114 values
- | ⟨115, _⟩, values => refinementSemanticAgrees115 values
- | ⟨116, _⟩, values => refinementSemanticAgrees116 values
- | ⟨117, _⟩, values => refinementSemanticAgrees117 values
- | ⟨118, _⟩, values => refinementSemanticAgrees118 values
- | ⟨119, _⟩, values => refinementSemanticAgrees119 values
- | ⟨120, _⟩, values => refinementSemanticAgrees120 values
- | ⟨121, _⟩, values => refinementSemanticAgrees121 values
- | ⟨122, _⟩, values => refinementSemanticAgrees122 values
- | ⟨123, _⟩, values => refinementSemanticAgrees123 values
- | ⟨124, _⟩, values => refinementSemanticAgrees124 values
- | ⟨125, _⟩, values => refinementSemanticAgrees125 values
- | ⟨126, _⟩, values => refinementSemanticAgrees126 values
- | ⟨127, _⟩, values => refinementSemanticAgrees127 values
- | ⟨128, _⟩, values => refinementSemanticAgrees128 values
- | ⟨129, _⟩, values => refinementSemanticAgrees129 values
- | ⟨130, _⟩, values => refinementSemanticAgrees130 values
- | ⟨131, _⟩, values => refinementSemanticAgrees131 values
- | ⟨132, _⟩, values => refinementSemanticAgrees132 values
- | ⟨133, _⟩, values => refinementSemanticAgrees133 values
- | ⟨134, _⟩, values => refinementSemanticAgrees134 values
- | ⟨135, _⟩, values => refinementSemanticAgrees135 values
- | ⟨136, _⟩, values => refinementSemanticAgrees136 values
- | ⟨137, _⟩, values => refinementSemanticAgrees137 values
- | ⟨138, _⟩, values => refinementSemanticAgrees138 values
- | ⟨139, _⟩, values => refinementSemanticAgrees139 values
- | ⟨140, _⟩, values => refinementSemanticAgrees140 values
- | ⟨141, _⟩, values => refinementSemanticAgrees141 values
- | ⟨142, _⟩, values => refinementSemanticAgrees142 values
- | ⟨143, _⟩, values => refinementSemanticAgrees143 values
- | ⟨144, _⟩, values => refinementSemanticAgrees144 values
- | ⟨145, _⟩, values => refinementSemanticAgrees145 values
- | ⟨146, _⟩, values => refinementSemanticAgrees146 values
- | ⟨147, _⟩, values => refinementSemanticAgrees147 values
- | ⟨148, _⟩, values => refinementSemanticAgrees148 values
- | ⟨149, _⟩, values => refinementSemanticAgrees149 values
- | ⟨150, _⟩, values => refinementSemanticAgrees150 values
- | ⟨151, _⟩, values => refinementSemanticAgrees151 values
- | ⟨152, _⟩, values => refinementSemanticAgrees152 values
- | ⟨153, _⟩, values => refinementSemanticAgrees153 values
- | ⟨154, _⟩, values => refinementSemanticAgrees154 values
- | ⟨155, _⟩, values => refinementSemanticAgrees155 values
- | ⟨156, _⟩, values => refinementSemanticAgrees156 values
- | ⟨157, _⟩, values => refinementSemanticAgrees157 values
- | ⟨158, _⟩, values => refinementSemanticAgrees158 values
- | ⟨159, _⟩, values => refinementSemanticAgrees159 values
- | ⟨160, _⟩, values => refinementSemanticAgrees160 values
- | ⟨161, _⟩, values => refinementSemanticAgrees161 values
- | ⟨162, _⟩, values => refinementSemanticAgrees162 values
- | ⟨163, _⟩, values => refinementSemanticAgrees163 values
- | ⟨164, _⟩, values => refinementSemanticAgrees164 values
- | ⟨165, _⟩, values => refinementSemanticAgrees165 values
- | ⟨166, _⟩, values => refinementSemanticAgrees166 values
- | ⟨167, _⟩, values => refinementSemanticAgrees167 values
- | ⟨168, _⟩, values => refinementSemanticAgrees168 values
- | ⟨169, _⟩, values => refinementSemanticAgrees169 values
- | ⟨170, _⟩, values => refinementSemanticAgrees170 values
- | ⟨171, _⟩, values => refinementSemanticAgrees171 values
- | ⟨172, _⟩, values => refinementSemanticAgrees172 values
- | ⟨173, _⟩, values => refinementSemanticAgrees173 values
- | ⟨174, _⟩, values => refinementSemanticAgrees174 values
- | ⟨175, _⟩, values => refinementSemanticAgrees175 values
- | ⟨176, _⟩, values => refinementSemanticAgrees176 values
- | ⟨177, _⟩, values => refinementSemanticAgrees177 values
- | ⟨178, _⟩, values => refinementSemanticAgrees178 values
- | ⟨179, _⟩, values => refinementSemanticAgrees179 values
- | ⟨180, _⟩, values => refinementSemanticAgrees180 values
- | ⟨181, _⟩, values => refinementSemanticAgrees181 values
- | ⟨182, _⟩, values => refinementSemanticAgrees182 values
- | ⟨183, _⟩, values => refinementSemanticAgrees183 values
- | ⟨n + 184, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨28, _⟩, spans, values => refinementSemanticAgrees28 spans values
+ | ⟨29, _⟩, spans, values => refinementSemanticAgrees29 spans values
+ | ⟨30, _⟩, spans, values => refinementSemanticAgrees30 spans values
+ | ⟨31, _⟩, spans, values => refinementSemanticAgrees31 spans values
+ | ⟨32, _⟩, spans, values => refinementSemanticAgrees32 spans values
+ | ⟨33, _⟩, spans, values => refinementSemanticAgrees33 spans values
+ | ⟨34, _⟩, spans, values => refinementSemanticAgrees34 spans values
+ | ⟨35, _⟩, spans, values => refinementSemanticAgrees35 spans values
+ | ⟨36, _⟩, spans, values => refinementSemanticAgrees36 spans values
+ | ⟨37, _⟩, spans, values => refinementSemanticAgrees37 spans values
+ | ⟨38, _⟩, spans, values => refinementSemanticAgrees38 spans values
+ | ⟨39, _⟩, spans, values => refinementSemanticAgrees39 spans values
+ | ⟨40, _⟩, spans, values => refinementSemanticAgrees40 spans values
+ | ⟨41, _⟩, spans, values => refinementSemanticAgrees41 spans values
+ | ⟨42, _⟩, spans, values => refinementSemanticAgrees42 spans values
+ | ⟨43, _⟩, spans, values => refinementSemanticAgrees43 spans values
+ | ⟨44, _⟩, spans, values => refinementSemanticAgrees44 spans values
+ | ⟨45, _⟩, spans, values => refinementSemanticAgrees45 spans values
+ | ⟨46, _⟩, spans, values => refinementSemanticAgrees46 spans values
+ | ⟨47, _⟩, spans, values => refinementSemanticAgrees47 spans values
+ | ⟨48, _⟩, spans, values => refinementSemanticAgrees48 spans values
+ | ⟨49, _⟩, spans, values => refinementSemanticAgrees49 spans values
+ | ⟨50, _⟩, spans, values => refinementSemanticAgrees50 spans values
+ | ⟨51, _⟩, spans, values => refinementSemanticAgrees51 spans values
+ | ⟨52, _⟩, spans, values => refinementSemanticAgrees52 spans values
+ | ⟨53, _⟩, spans, values => refinementSemanticAgrees53 spans values
+ | ⟨54, _⟩, spans, values => refinementSemanticAgrees54 spans values
+ | ⟨55, _⟩, spans, values => refinementSemanticAgrees55 spans values
+ | ⟨56, _⟩, spans, values => refinementSemanticAgrees56 spans values
+ | ⟨57, _⟩, spans, values => refinementSemanticAgrees57 spans values
+ | ⟨58, _⟩, spans, values => refinementSemanticAgrees58 spans values
+ | ⟨59, _⟩, spans, values => refinementSemanticAgrees59 spans values
+ | ⟨60, _⟩, spans, values => refinementSemanticAgrees60 spans values
+ | ⟨61, _⟩, spans, values => refinementSemanticAgrees61 spans values
+ | ⟨62, _⟩, spans, values => refinementSemanticAgrees62 spans values
+ | ⟨63, _⟩, spans, values => refinementSemanticAgrees63 spans values
+ | ⟨64, _⟩, spans, values => refinementSemanticAgrees64 spans values
+ | ⟨65, _⟩, spans, values => refinementSemanticAgrees65 spans values
+ | ⟨66, _⟩, spans, values => refinementSemanticAgrees66 spans values
+ | ⟨67, _⟩, spans, values => refinementSemanticAgrees67 spans values
+ | ⟨68, _⟩, spans, values => refinementSemanticAgrees68 spans values
+ | ⟨69, _⟩, spans, values => refinementSemanticAgrees69 spans values
+ | ⟨70, _⟩, spans, values => refinementSemanticAgrees70 spans values
+ | ⟨71, _⟩, spans, values => refinementSemanticAgrees71 spans values
+ | ⟨72, _⟩, spans, values => refinementSemanticAgrees72 spans values
+ | ⟨73, _⟩, spans, values => refinementSemanticAgrees73 spans values
+ | ⟨74, _⟩, spans, values => refinementSemanticAgrees74 spans values
+ | ⟨75, _⟩, spans, values => refinementSemanticAgrees75 spans values
+ | ⟨76, _⟩, spans, values => refinementSemanticAgrees76 spans values
+ | ⟨77, _⟩, spans, values => refinementSemanticAgrees77 spans values
+ | ⟨78, _⟩, spans, values => refinementSemanticAgrees78 spans values
+ | ⟨79, _⟩, spans, values => refinementSemanticAgrees79 spans values
+ | ⟨80, _⟩, spans, values => refinementSemanticAgrees80 spans values
+ | ⟨81, _⟩, spans, values => refinementSemanticAgrees81 spans values
+ | ⟨82, _⟩, spans, values => refinementSemanticAgrees82 spans values
+ | ⟨83, _⟩, spans, values => refinementSemanticAgrees83 spans values
+ | ⟨84, _⟩, spans, values => refinementSemanticAgrees84 spans values
+ | ⟨85, _⟩, spans, values => refinementSemanticAgrees85 spans values
+ | ⟨86, _⟩, spans, values => refinementSemanticAgrees86 spans values
+ | ⟨87, _⟩, spans, values => refinementSemanticAgrees87 spans values
+ | ⟨88, _⟩, spans, values => refinementSemanticAgrees88 spans values
+ | ⟨89, _⟩, spans, values => refinementSemanticAgrees89 spans values
+ | ⟨90, _⟩, spans, values => refinementSemanticAgrees90 spans values
+ | ⟨91, _⟩, spans, values => refinementSemanticAgrees91 spans values
+ | ⟨92, _⟩, spans, values => refinementSemanticAgrees92 spans values
+ | ⟨93, _⟩, spans, values => refinementSemanticAgrees93 spans values
+ | ⟨94, _⟩, spans, values => refinementSemanticAgrees94 spans values
+ | ⟨95, _⟩, spans, values => refinementSemanticAgrees95 spans values
+ | ⟨96, _⟩, spans, values => refinementSemanticAgrees96 spans values
+ | ⟨97, _⟩, spans, values => refinementSemanticAgrees97 spans values
+ | ⟨98, _⟩, spans, values => refinementSemanticAgrees98 spans values
+ | ⟨99, _⟩, spans, values => refinementSemanticAgrees99 spans values
+ | ⟨100, _⟩, spans, values => refinementSemanticAgrees100 spans values
+ | ⟨101, _⟩, spans, values => refinementSemanticAgrees101 spans values
+ | ⟨102, _⟩, spans, values => refinementSemanticAgrees102 spans values
+ | ⟨103, _⟩, spans, values => refinementSemanticAgrees103 spans values
+ | ⟨104, _⟩, spans, values => refinementSemanticAgrees104 spans values
+ | ⟨105, _⟩, spans, values => refinementSemanticAgrees105 spans values
+ | ⟨106, _⟩, spans, values => refinementSemanticAgrees106 spans values
+ | ⟨107, _⟩, spans, values => refinementSemanticAgrees107 spans values
+ | ⟨108, _⟩, spans, values => refinementSemanticAgrees108 spans values
+ | ⟨109, _⟩, spans, values => refinementSemanticAgrees109 spans values
+ | ⟨110, _⟩, spans, values => refinementSemanticAgrees110 spans values
+ | ⟨111, _⟩, spans, values => refinementSemanticAgrees111 spans values
+ | ⟨112, _⟩, spans, values => refinementSemanticAgrees112 spans values
+ | ⟨113, _⟩, spans, values => refinementSemanticAgrees113 spans values
+ | ⟨114, _⟩, spans, values => refinementSemanticAgrees114 spans values
+ | ⟨115, _⟩, spans, values => refinementSemanticAgrees115 spans values
+ | ⟨116, _⟩, spans, values => refinementSemanticAgrees116 spans values
+ | ⟨117, _⟩, spans, values => refinementSemanticAgrees117 spans values
+ | ⟨118, _⟩, spans, values => refinementSemanticAgrees118 spans values
+ | ⟨119, _⟩, spans, values => refinementSemanticAgrees119 spans values
+ | ⟨120, _⟩, spans, values => refinementSemanticAgrees120 spans values
+ | ⟨121, _⟩, spans, values => refinementSemanticAgrees121 spans values
+ | ⟨122, _⟩, spans, values => refinementSemanticAgrees122 spans values
+ | ⟨123, _⟩, spans, values => refinementSemanticAgrees123 spans values
+ | ⟨124, _⟩, spans, values => refinementSemanticAgrees124 spans values
+ | ⟨125, _⟩, spans, values => refinementSemanticAgrees125 spans values
+ | ⟨126, _⟩, spans, values => refinementSemanticAgrees126 spans values
+ | ⟨127, _⟩, spans, values => refinementSemanticAgrees127 spans values
+ | ⟨128, _⟩, spans, values => refinementSemanticAgrees128 spans values
+ | ⟨129, _⟩, spans, values => refinementSemanticAgrees129 spans values
+ | ⟨130, _⟩, spans, values => refinementSemanticAgrees130 spans values
+ | ⟨131, _⟩, spans, values => refinementSemanticAgrees131 spans values
+ | ⟨132, _⟩, spans, values => refinementSemanticAgrees132 spans values
+ | ⟨133, _⟩, spans, values => refinementSemanticAgrees133 spans values
+ | ⟨134, _⟩, spans, values => refinementSemanticAgrees134 spans values
+ | ⟨135, _⟩, spans, values => refinementSemanticAgrees135 spans values
+ | ⟨136, _⟩, spans, values => refinementSemanticAgrees136 spans values
+ | ⟨137, _⟩, spans, values => refinementSemanticAgrees137 spans values
+ | ⟨138, _⟩, spans, values => refinementSemanticAgrees138 spans values
+ | ⟨139, _⟩, spans, values => refinementSemanticAgrees139 spans values
+ | ⟨140, _⟩, spans, values => refinementSemanticAgrees140 spans values
+ | ⟨141, _⟩, spans, values => refinementSemanticAgrees141 spans values
+ | ⟨142, _⟩, spans, values => refinementSemanticAgrees142 spans values
+ | ⟨143, _⟩, spans, values => refinementSemanticAgrees143 spans values
+ | ⟨144, _⟩, spans, values => refinementSemanticAgrees144 spans values
+ | ⟨145, _⟩, spans, values => refinementSemanticAgrees145 spans values
+ | ⟨146, _⟩, spans, values => refinementSemanticAgrees146 spans values
+ | ⟨147, _⟩, spans, values => refinementSemanticAgrees147 spans values
+ | ⟨148, _⟩, spans, values => refinementSemanticAgrees148 spans values
+ | ⟨149, _⟩, spans, values => refinementSemanticAgrees149 spans values
+ | ⟨150, _⟩, spans, values => refinementSemanticAgrees150 spans values
+ | ⟨151, _⟩, spans, values => refinementSemanticAgrees151 spans values
+ | ⟨152, _⟩, spans, values => refinementSemanticAgrees152 spans values
+ | ⟨153, _⟩, spans, values => refinementSemanticAgrees153 spans values
+ | ⟨154, _⟩, spans, values => refinementSemanticAgrees154 spans values
+ | ⟨155, _⟩, spans, values => refinementSemanticAgrees155 spans values
+ | ⟨156, _⟩, spans, values => refinementSemanticAgrees156 spans values
+ | ⟨157, _⟩, spans, values => refinementSemanticAgrees157 spans values
+ | ⟨158, _⟩, spans, values => refinementSemanticAgrees158 spans values
+ | ⟨159, _⟩, spans, values => refinementSemanticAgrees159 spans values
+ | ⟨160, _⟩, spans, values => refinementSemanticAgrees160 spans values
+ | ⟨161, _⟩, spans, values => refinementSemanticAgrees161 spans values
+ | ⟨162, _⟩, spans, values => refinementSemanticAgrees162 spans values
+ | ⟨163, _⟩, spans, values => refinementSemanticAgrees163 spans values
+ | ⟨164, _⟩, spans, values => refinementSemanticAgrees164 spans values
+ | ⟨165, _⟩, spans, values => refinementSemanticAgrees165 spans values
+ | ⟨166, _⟩, spans, values => refinementSemanticAgrees166 spans values
+ | ⟨167, _⟩, spans, values => refinementSemanticAgrees167 spans values
+ | ⟨168, _⟩, spans, values => refinementSemanticAgrees168 spans values
+ | ⟨169, _⟩, spans, values => refinementSemanticAgrees169 spans values
+ | ⟨170, _⟩, spans, values => refinementSemanticAgrees170 spans values
+ | ⟨171, _⟩, spans, values => refinementSemanticAgrees171 spans values
+ | ⟨172, _⟩, spans, values => refinementSemanticAgrees172 spans values
+ | ⟨173, _⟩, spans, values => refinementSemanticAgrees173 spans values
+ | ⟨174, _⟩, spans, values => refinementSemanticAgrees174 spans values
+ | ⟨175, _⟩, spans, values => refinementSemanticAgrees175 spans values
+ | ⟨176, _⟩, spans, values => refinementSemanticAgrees176 spans values
+ | ⟨177, _⟩, spans, values => refinementSemanticAgrees177 spans values
+ | ⟨178, _⟩, spans, values => refinementSemanticAgrees178 spans values
+ | ⟨179, _⟩, spans, values => refinementSemanticAgrees179 spans values
+ | ⟨180, _⟩, spans, values => refinementSemanticAgrees180 spans values
+ | ⟨181, _⟩, spans, values => refinementSemanticAgrees181 spans values
+ | ⟨182, _⟩, spans, values => refinementSemanticAgrees182 spans values
+ | ⟨183, _⟩, spans, values => refinementSemanticAgrees183 spans values
+ | ⟨n + 184, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -5702,17 +5708,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- C99Parser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ C99Parser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) C99Parser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) C99Parser.V := {
table := C99Parser.table
- decode := fun t => C99Parser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := C99Parser.semV
+ decode := C99Parser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -5757,13 +5765,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change C99Parser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change C99Parser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -5771,21 +5780,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (C99Parser.run input logNSteps) := by
+ have hrun : C99Parser.run input logNSteps
= Runtime.Exec.run C99Parser.table (input.map executableRefinement.decode) logNSteps := by
simp only [C99Parser.run]
rw [Runtime.Exec.runFast_eq_run C99Parser.stackOps C99Parser.flat C99Parser.fuse
C99Parser.termOf C99Parser.valOf C99Parser.stackLawful C99Parser.fuseOK]
- simp only [C99Parser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- C99Parser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ C99Parser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold C99Parser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -5793,49 +5802,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : C99Parser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : TranslationUnit)
- (accepted : C99Parser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : C99Parser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (C99Parser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (C99Parser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : C99Parser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -5844,7 +5855,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- C99Parser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ C99Parser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -5860,13 +5871,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- C99Parser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ C99Parser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -5876,14 +5889,20 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
end C99Verified
diff --git a/test/calc/CalcLexer.lean b/test/calc/CalcLexer.lean
index 5b93725..15fc6fa 100644
--- a/test/calc/CalcLexer.lean
+++ b/test/calc/CalcLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
public import calc.CalcAst
@@ -132,9 +136,93 @@ theorem CalcLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees CalcLexer.fastActs CalcLexer.cbyte.flat.base.acts :=
CalcLexer.fastActs_agree
-theorem CalcLexer.byteValidated0 :
- Lexer.byteValidate (CalcLexer.cbyte.bytes.getD 0 default)
- (CalcLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def CalcLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte CalcLexer.cbyte input
+
+theorem CalcLexer.byteUnicodeValidated : Lexer.byteValidAll CalcLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem CalcLexer.posLexerAgrees : Lexer.PosLexerAgrees CalcLexer.cbyte CalcLexer.tokenize := by
+ intro s
+ rw [CalcLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll CalcLexer.cbyte CalcLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem CalcLexer.tokenizeByte_toOption (s : String) :
+ (CalcLexer.tokenizeByte s).toOption = (CalcLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption CalcLexer.cbyte CalcLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem CalcLexer.noEofEmit :
+ ∀ m r, (CalcLexer.fastActs.get m r).emit = true → ∀ s, (CalcLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL CalcLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (by intro h; cases h) Lexer.AllL.nil)))))))
+ Lexer.AllL.nil)
+
+theorem CalcLexer.stay0 : ∀ r, (CalcLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL CalcLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil))))))) Lexer.AllL.nil) 0
+
+theorem CalcLexer.textIndep0 : ∀ r, CalcLexer.cflat.needsText 0 r = false →
+ ∀ s, (CalcLexer.fastActs.get 0 r).toAct s = (CalcLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ CalcLexer.fastActs (CalcLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) Lexer.Forall₂.nil)))))))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem CalcLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CalcLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization CalcLexer.rules0 input.toList ∧
+ Lexer.tokenize CalcLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound CalcLexer.cflat CalcLexer.fastActs CalcLexer.fastActs_agree
+ CalcLexer.validated0 rfl CalcLexer.flatValidated0 (by decide) CalcLexer.stay0
+ CalcLexer.textIndep0 (by rw [← CalcLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem CalcLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing CalcLexer.rules0 input.toList steps) :
+ ∃ ts, CalcLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CalcLexer.lexer CalcLexer.lexer.start input.toList steps := by
+ rw [CalcLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete CalcLexer.cflat CalcLexer.fastActs CalcLexer.fastActs_agree
+ CalcLexer.validated0 rfl CalcLexer.flatValidated0 (by decide) CalcLexer.stay0
+ CalcLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev CalcLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing CalcLexer.rules0 (Lexer.modeAct CalcLexer.lexer CalcLexer.lexer.start)
+ CalcLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem CalcLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ CalcLexer.tokenize s = .ok ts ↔ CalcLexer.Lexes s ts := by
+ rw [CalcLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' CalcLexer.cflat CalcLexer.fastActs
+ CalcLexer.fastActs_agree CalcLexer.validated0 rfl CalcLexer.flatValidated0 (by decide)
+ CalcLexer.stay0 CalcLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem CalcLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos CalcLexer.cbyte s = .ok ts ↔ CalcLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff CalcLexer.posLexerAgrees s ts).trans (CalcLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem CalcLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CalcLexer.Lexes s ts₁) (h₂ : CalcLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem CalcLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CalcLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees CalcLexer.lexer CalcLexer.fastActs CalcLexer.fastActs_agree
+ _ CalcLexer.noEofEmit _) h
diff --git a/test/calc/CalcParser.lean b/test/calc/CalcParser.lean
index 6b090db..abc72bf 100644
--- a/test/calc/CalcParser.lean
+++ b/test/calc/CalcParser.lean
@@ -58,30 +58,19 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def semS : Nat → List VP → Runtime.Span
- | 0, [(e_span, .v0 e), (__s1, _), (t_span, .v0 t)] => Runtime.Span.merge e_span t_span
- | 1, [(t_span, .v0 t)] => t_span
- | 2, [(t_span, .v0 t), (__s1, _), (f_span, .v0 f)] => Runtime.Span.merge t_span f_span
- | 3, [(t_span, .v0 t), (__s1, _), (f_span, .v0 f)] => Runtime.Span.merge t_span f_span
- | 4, [(f_span, .v0 f)] => f_span
- | 5, [(__s0, _), (e_span, .v0 e), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 6, [(n_span, .v0 n)] => n_span
- | 7, [x, _] => x.1
- | _, _ => Runtime.Span.dummy
-
-def semV : Nat → List V → V
- | 0, [.v0 e, _, .v0 t] => .v0 (e + t)
- | 1, [.v0 t] => .v0 (t)
- | 2, [.v0 t, _, .v0 f] => .v0 (t * f)
- | 3, [.v0 t, _, .v0 f] => .v0 (t / f)
- | 4, [.v0 f] => .v0 (f)
- | 5, [_, .v0 e, _] => .v0 (e)
- | 6, [.v0 n] => .v0 (n)
- | 7, [x, _] => x
- | _, _ => .unit ()
-
-def sem (p : Nat) (args : List VP) : VP :=
- (semS p args, semV p (args.map Prod.snd))
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v0 e, _, .v0 t] => .v0 (e + t)
+ | 1, _, [.v0 t] => .v0 (t)
+ | 2, _, [.v0 t, _, .v0 f] => .v0 (t * f)
+ | 3, _, [.v0 t, _, .v0 f] => .v0 (t / f)
+ | 4, _, [.v0 f] => .v0 (f)
+ | 5, _, [_, .v0 e, _] => .v0 (e)
+ | 6, _, [.v0 n] => .v0 (n)
+ | 7, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -116,6 +105,26 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .cUnit st _ _ _ => st
| .c0 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -151,6 +160,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.error, .error, .shift 4, .error, .error, .shift 5, .error, .error, .shift 6, .error, .error, .error, .error,
@@ -243,6 +253,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -370,19 +381,6 @@ theorem parseStr_total (input : String) (k : Nat) :
· left; rw [h]
· right; rw [h]
-theorem semSpanFree : Runtime.Exec.SemSpanFree sem :=
- Runtime.Exec.SemSpanFree.of_split semS semV
-
-theorem parse_spanIndependent : Runtime.Exec.SpanIndependent (fun ts k => parse ts k) :=
- Runtime.Exec.SpanIndependent.of_run flat.toExecTable semSpanFree termOf valOf
- (fun r => match r with | .ok (.v0 x) => some x | _ => none) (by
- intro ts k
- unfold parse run
- rw [Runtime.Exec.runFast_eq_run stackOps flat fuse termOf valOf stackLawful fuseOK]
- cases Runtime.Exec.run flat.toExecTable (ts.map (Runtime.Exec.decodeWith termOf valOf)) k with
- | ok v => obtain ⟨_, v⟩ := v; cases v <;> rfl
- | _ => rfl)
-
/-- The readable name of a terminal index (EOF is "end of input"). -/
def terminalName : Nat → String
| 0 => "PLUS"
diff --git a/test/calc/CalcParserRoundtrip.lean b/test/calc/CalcParserRoundtrip.lean
index 6d8d5c8..d90dfb5 100644
--- a/test/calc/CalcParserRoundtrip.lean
+++ b/test/calc/CalcParserRoundtrip.lean
@@ -26,10 +26,11 @@ namespace CalcParserRoundtrip
open Lexer Runtime CalcUnparse
/-- A parse tree certifying that `tokens` parse to `value`. The start tree
- includes the explicit EOF required by the augmented grammar. -/
+ includes the explicit EOF required by the augmented grammar. Its tokens carry
+ the dummy span, as the token generator produces no positions. -/
structure Certificate (tokens : List Tok) (value : Int) where
- tree : CalcVerified.ParserStartTree (tokens ++ [Tok.EOF])
- semantics : Runtime.Grammar.ptSem tree = value
+ tree : CalcVerified.ParserStartTree ((tokens ++ [Tok.EOF]).map Positioned.dummy)
+ semantics : Runtime.SpanGrammar.ptSem ⟨0⟩ tree = value
/-- Sufficient logarithmic fuel computed from the certified tree. -/
def Certificate.logFuel {tokens : List Tok} {value : Int}
diff --git a/test/calc/CalcVerified.lean b/test/calc/CalcVerified.lean
index ee9e05d..a77c72b 100644
--- a/test/calc/CalcVerified.lean
+++ b/test/calc/CalcVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -28,6 +30,9 @@ public import calc.CalcParser
import all calc.CalcParser
meta import calc.CalcParser
public import LeanParserGenerator.Lexer.StreamRun
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.SpanText
+public import LeanParserGenerator.Runtime.ParseEnd
public import calc.CalcLexer
@@ -44,6 +49,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace CalcVerified
abbrev Terminal := Fin 8
@@ -102,21 +109,21 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 3
augmentedProduction := 7 }
-def semTbl : List (Σ T : Type, T → CalcParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → CalcParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → CalcParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Int : Type), fun v => .v0 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Int : Type), fun v => .v0 v⟩,
+ ⟨(Int : Type), fun v => .v0 v⟩,
+ ⟨(Int : Type), fun v => .v0 v⟩,
+ ⟨(Int : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → CalcParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -125,34 +132,34 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : Int) (_ : Unit) (e : Int) => (e + t)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : Int) (_ : Unit) (e : Int) => (e + t)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : Int) => (t)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : Int) => (t)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : Int) (_ : Unit) (t : Int) => (t * f)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : Int) (_ : Unit) (t : Int) => (t * f)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : Int) (_ : Unit) (t : Int) => (t / f)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : Int) (_ : Unit) (t : Int) => (t / f)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : Int) => (f)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : Int) => (f)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Int) (_ : Unit) => (e)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Int) (_ : Unit) => (e)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Int) => (n)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Int) => (n)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction2
@@ -169,7 +176,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -206,193 +213,214 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
/-- Terminal parse tree for `PLUS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPLUS :
+noncomputable def parseTreeTokenPLUS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PLUS] :=
+ (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PLUS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PLUS))
+ (.terminal (G := grammarInst) (⟨Tok.PLUS, span⟩))
/-- Terminal parse tree for `TIMES` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTIMES :
+noncomputable def parseTreeTokenTIMES
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [Tok.TIMES] :=
+ (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.TIMES, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.TIMES))
+ (.terminal (G := grammarInst) (⟨Tok.TIMES, span⟩))
/-- Terminal parse tree for `LPAR` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLPAR :
+noncomputable def parseTreeTokenLPAR
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LPAR] :=
+ (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LPAR, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LPAR))
+ (.terminal (G := grammarInst) (⟨Tok.LPAR, span⟩))
/-- Terminal parse tree for `RPAR` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRPAR :
+noncomputable def parseTreeTokenRPAR
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RPAR] :=
+ (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RPAR, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RPAR))
+ (.terminal (G := grammarInst) (⟨Tok.RPAR, span⟩))
/-- Terminal parse tree for `DIV` with its concrete grammar index. -/
-noncomputable def parseTreeTokenDIV :
+noncomputable def parseTreeTokenDIV
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [Tok.DIV] :=
+ (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.DIV, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.DIV))
+ (.terminal (G := grammarInst) (⟨Tok.DIV, span⟩))
/-- Terminal parse tree for `NUM` with its concrete grammar index. -/
noncomputable def parseTreeTokenNUM
- (value : Int) :
+ (value : Int)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NUM value] :=
+ (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NUM value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NUM value))
+ (.terminal (G := grammarInst) (⟨Tok.NUM value, span⟩))
/-- Terminal parse tree for `EOF` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEOF :
+noncomputable def parseTreeTokenEOF
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EOF] :=
+ (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EOF, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EOF))
+ (.terminal (G := grammarInst) (⟨Tok.EOF, span⟩))
/-- Parse-tree constructor for production 0, in source RHS order. -/
noncomputable def parseTreeProduction0
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.PLUS] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenPLUS))) (tree2))
+ ((word0 ++ [Tok.PLUS] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenPLUS))) (tree2)))
@[simp] theorem parseTreeProduction0_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction0 tree0 tree2) = semanticAction0 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction0 tree0 tree2) = semanticAction0 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenPLUS))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.PLUS)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction0
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 1, in source RHS order. -/
noncomputable def parseTreeProduction1
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction1_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction1 tree0) = semanticAction1 (Grammar.ptSem tree0) := by
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction1 tree0) = semanticAction1 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction1
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 2, in source RHS order. -/
noncomputable def parseTreeProduction2
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.TIMES] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenTIMES))) (tree2))
+ ((word0 ++ [Tok.TIMES] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenTIMES))) (tree2)))
@[simp] theorem parseTreeProduction2_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction2 tree0 tree2) = semanticAction2 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction2 tree0 tree2) = semanticAction2 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenTIMES))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.TIMES)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction2
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 3, in source RHS order. -/
noncomputable def parseTreeProduction3
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.DIV] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenDIV))) (tree2))
+ ((word0 ++ [Tok.DIV] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenDIV))) (tree2)))
@[simp] theorem parseTreeProduction3_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction3 tree0 tree2) = semanticAction3 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction3 tree0 tree2) = semanticAction3 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenDIV))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.DIV)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction3
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 4, in source RHS order. -/
noncomputable def parseTreeProduction4
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction4_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction4 tree0) = semanticAction4 (Grammar.ptSem tree0) := by
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction4 tree0) = semanticAction4 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction4
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 5, in source RHS order. -/
noncomputable def parseTreeProduction5
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LPAR] ++ word1 ++ [Tok.RPAR]) :=
- .nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR)))
+ (([Tok.LPAR] ++ word1 ++ [Tok.RPAR]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR))))
@[simp] theorem parseTreeProduction5_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction5 tree1) = semanticAction5 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction5 tree1) = semanticAction5 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LPAR)])) tree1) (()) := by
unfold parseTreeProduction5
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 6, in source RHS order. -/
@@ -400,33 +428,37 @@ noncomputable def parseTreeProduction6
(value0 : Int) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NUM value0]) :=
- .nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNUM value0)))
+ (([Tok.NUM value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNUM value0))))
@[simp] theorem parseTreeProduction6_sem
- (value0 : Int) :
- Grammar.ptSem (parseTreeProduction6 value0) = semanticAction6 (value0) := by
+ (value0 : Int)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction6 value0) = semanticAction6 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenNUM value0)))) (value0) := by
unfold parseTreeProduction6
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 7, in source RHS order. -/
noncomputable def parseTreeProduction7
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.EOF]) :=
- .nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))
+ ((word0 ++ [Tok.EOF]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF))))
@[simp] theorem parseTreeProduction7_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction7 tree0) = semanticAction7 (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction7 tree0) = semanticAction7 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction7
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
@@ -663,87 +695,87 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Int :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Int :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CalcParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CalcParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- CalcParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ CalcParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- CalcParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ CalcParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨n + 8, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨n + 8, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -850,17 +882,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- CalcParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ CalcParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) CalcParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) CalcParser.V := {
table := CalcParser.table
- decode := fun t => CalcParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := CalcParser.semV
+ decode := CalcParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -905,13 +939,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change CalcParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change CalcParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -919,21 +954,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (CalcParser.run input logNSteps) := by
+ have hrun : CalcParser.run input logNSteps
= Runtime.Exec.run CalcParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [CalcParser.run]
rw [Runtime.Exec.runFast_eq_run CalcParser.stackOps CalcParser.flat CalcParser.fuse
CalcParser.termOf CalcParser.valOf CalcParser.stackLawful CalcParser.fuseOK]
- simp only [CalcParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- CalcParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ CalcParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold CalcParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -941,49 +976,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : CalcParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Int)
- (accepted : CalcParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : CalcParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (CalcParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (CalcParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : CalcParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -992,7 +1029,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- CalcParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ CalcParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -1008,13 +1045,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- CalcParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ CalcParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -1024,65 +1063,59 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
-
-/-- `lexPos` and `CalcLexer.tokenize` succeed on the same inputs with the same tokens. Stated, not proved. -/
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
+
+/-- `lexPos` and `CalcLexer.tokenize` succeed on the same inputs with the same tokens. Proved as
+ `posLexerAgrees`. -/
abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees CalcLexer.cbyte CalcLexer.tokenize
-/-- `CalcParser.parse` ignores token spans. Proved as `spanIndependent`. -/
-abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => CalcParser.parse ts k)
+theorem posLexerAgrees : PosLexerAgrees := CalcLexer.posLexerAgrees
-theorem spanIndependent : SpanIndependent := CalcParser.parse_spanIndependent
+theorem lexPos_eq_of_tokenize (s : String) (ts : List (Runtime.Positioned Tok)) (h : CalcLexer.tokenize s = .ok ts) :
+ Lexer.lexPos CalcLexer.cbyte s = .ok ts := by
+ have hagree := posLexerAgrees s
+ rw [h] at hagree
+ revert hagree
+ cases Lexer.lexPos CalcLexer.cbyte s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
-theorem parse_eq_dependent_spans (input : List (Runtime.Positioned Tok)) (k : Nat) :
- CalcParser.parse input k = parse (input.map (·.val)) k := by
- have hs : CalcParser.parse input k = CalcParser.parse (input.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent input k
- rw [hs, ← parse_eq_dependent (input.map (·.val)) k, List.map_map]
- rfl
-
-theorem parseStr_eq (hlex : PosLexerAgrees) (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+theorem parseStr_eq (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
(h : CalcLexer.tokenize s = .ok ts) : CalcParser.parseStr s k = CalcParser.parse ts k := by
- have hp : Lexer.lexPos CalcLexer.cbyte s = .ok ts := by
- have hagree := hlex s
- rw [h] at hagree
- revert hagree
- cases Lexer.lexPos CalcLexer.cbyte s with
- | error e => intro hc; simp [Except.toOption] at hc
- | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+ have hp : Lexer.lexPos CalcLexer.cbyte s = .ok ts := lexPos_eq_of_tokenize s ts h
exact CalcParser.parseStr_eq_lexPos s k ts hp
-theorem parseStr_eq_dependent (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_eq_dependent (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : CalcLexer.tokenize s = .ok ts) :
- CalcParser.parseStr s k = parse (ts.map (·.val)) k := by
- have hs : CalcParser.parse ts k = CalcParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs, ← parse_eq_dependent (ts.map (·.val)) k, List.map_map]
- rfl
+ CalcParser.parseStr s k = parse ts k := by
+ rw [parseStr_eq s k ts h, parse_eq_dependent]
-theorem parseStr_sound (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_sound (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : CalcLexer.tokenize s = .ok ts) (p : Int)
(accepted : CalcParser.parseStr s k = some p) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
- toStream (ts.map (·.val)) = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = p := by
- have hs : CalcParser.parse ts k = CalcParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs] at accepted
- exact parser_sound (ts.map (·.val)) k p
- (by simpa [List.map_map, Function.comp_def] using accepted)
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ rw [parseStr_eq s k ts h] at accepted
+ exact parser_sound ts k p accepted
/-- When `tokenize` fails, the byte lexer delivers a prefix `ts` and fails, and `parseStr`
is `none` or `parse` of an extension of `ts`. -/
-theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat)
+theorem parseStr_of_tokenize_error (s : String) (k : Nat)
(e : Lexer.LexError) (h : CalcLexer.tokenize s = .error e) :
∃ ts e', Runtime.Exec.Fails (Lexer.pullSource (Lexer.pullAux CalcLexer.cbyte s.toUTF8))
⟨false, s.toUTF8.size + 1, 0, [CalcLexer.cbyte.flat.base.start]⟩ ts e' ∧
@@ -1091,10 +1124,281 @@ theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat
· exfalso
have hp : Lexer.lexPos CalcLexer.cbyte s = .ok ts :=
Lexer.lexPosAux_of_denotes CalcLexer.cbyte s.toUTF8 _ _ _ ts hD
- have hagree := hlex s
+ have hagree := posLexerAgrees s
rw [hp, h] at hagree
simp [Except.toOption] at hagree
· exact hF
+/-- Every production of the start symbol has the end marker `$` on its right-hand side. -/
+theorem startProds_end : ∀ p : Production,
+ prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ Symbol.T (⟨7, of_decide_eq_true rfl⟩ : Terminal) ∈ prodRhsRev' p := by
+ native_decide
+
+theorem tokenTerm_eq_end (t : Tok)
+ (h : tokenTerm' t = (⟨7, of_decide_eq_true rfl⟩ : Terminal)) : t = .EOF := by
+ cases t <;> first | rfl | exact absurd (congrArg Fin.val h) (Nat.ne_of_beq_eq_false rfl)
+
+/-- The dependent parser does not accept a token list with no `EOF` that is longer than
+ `2^k`: it has not reached the end marker. -/
+theorem dependent_ne_parsed_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length)
+ (r : SpanGrammar.semR (SG := spanGrammarInst) (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))))
+ (rest : Runtime.NatStream grammarInst.Token) :
+ Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k ≠ .Parsed r rest :=
+ Runtime.parse_ne_parsed_of_no_end (G := grammarInst) (A := automatonInst) _ _
+ startProds_end input ⟨.EOF, Runtime.Span.dummy⟩ rfl
+ (fun t ht he => hin t ht (tokenTerm_eq_end t.val he)) k hlen r rest
+
+theorem parse_eq_none_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length) : parse input k = none := by
+ unfold parse
+ cases hp : Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k with
+ | Parsed r rest => exact absurd hp (dependent_ne_parsed_of_no_eof input k hin hlen r rest)
+ | _ => rfl
+
+/-- A prefix of lexed tokens with no `EOF`, padded with copies of its first token. -/
+theorem no_eof_pad (t0 : Runtime.Positioned Tok) (ts : List (Runtime.Positioned Tok))
+ (hts : ∀ t ∈ t0 :: ts, t.val ≠ .EOF) (k : Nat) :
+ (∀ t ∈ t0 :: ts ++ List.replicate (2 ^ k + 1) t0, t.val ≠ .EOF) ∧
+ 2 ^ k < (t0 :: ts ++ List.replicate (2 ^ k + 1) t0).length := by
+ constructor
+ · intro x hx
+ rcases List.mem_append.mp hx with hx | hx
+ · exact hts x hx
+ · rw [List.eq_of_mem_replicate hx]; exact hts t0 (List.mem_cons_self ..)
+ · simp only [List.length_append, List.length_replicate, List.length_cons]
+ omega
+
+/-- **Lex failure.** When the positioned byte lexer fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_lexPos (s : String) (k : Nat)
+ (h : ∀ ts, Lexer.lexPos CalcLexer.cbyte s ≠ .ok ts) : CalcParser.parseStr s k = none := by
+ rcases CalcParser.parseStr_total s k with ⟨ts, hD, _⟩ | ⟨ts, e, hF, hr⟩
+ · exact absurd (Lexer.lexPosAux_of_denotes CalcLexer.cbyte s.toUTF8 _ _ _ ts hD) (h ts)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens CalcLexer.cbyte CalcLexer.fastActs CalcLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) CalcLexer.noEofEmit s.toUTF8 _ ts e hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ unfold CalcParser.parseStr
+ rw [CalcParser.runStream_eq_runSrc]
+ unfold Runtime.Exec.runSrc
+ rw [hn]
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · exact h1
+ · rw [h1, parse_eq_dependent]
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ exact parse_eq_none_of_no_eof _ k hin hlen
+
+/-- **Lex failure.** When `tokenize` fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_tokenize_error (s : String) (k : Nat)
+ (e : Lexer.LexError) (h : CalcLexer.tokenize s = .error e) : CalcParser.parseStr s k = none :=
+ parseStr_eq_none_of_lexPos s k (fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree)
+
+/-- **Lex failure, stream engine.** When `tokenize` fails, `runStream` does not accept. It may
+ reject or run out of steps before it reaches the lex error, so the result need not be
+ `.err`. -/
+theorem runStream_ne_ok_of_tokenize_error (s : String) (k : Nat) (e : Lexer.LexError)
+ (h : CalcLexer.tokenize s = .error e) : ∀ v, CalcParser.runStream s k ≠ .ok v := by
+ intro v hok
+ have hlex : ∀ ts, Lexer.lexPos CalcLexer.cbyte s ≠ .ok ts := fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree
+ unfold CalcParser.runStream at hok
+ rcases Lexer.runStreamFast_total (ops := CalcParser.stackOps) CalcParser.flat CalcParser.fuse CalcParser.termOf CalcLexer.cbyte
+ CalcLexer.fastActs CalcLexer.fastActs_agree_byte s (2 ^ k) with ⟨ts, hD, _⟩ | ⟨ts, e', hF, hr⟩
+ · exact hlex ts (Lexer.lexPosAux_of_denotes CalcLexer.cbyte s.toUTF8 _ _ _ ts hD)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens CalcLexer.cbyte CalcLexer.fastActs CalcLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) CalcLexer.noEofEmit s.toUTF8 _ ts e' hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ rw [Lexer.runStreamFast_eq_runSrc (ops := CalcParser.stackOps) CalcParser.flat CalcParser.fuse CalcParser.termOf
+ CalcLexer.cbyte CalcLexer.fastActs CalcLexer.fastActs_agree_byte] at hok
+ unfold Runtime.Exec.runSrc at hok
+ rw [hn] at hok
+ cases hok
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · rw [h1] at hok; cases hok
+ · rw [h1] at hok
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ have related := parserRunRefines (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k
+ have hw : CalcParser.run (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k = .ok v := hok
+ rw [hw] at related
+ generalize hdep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (Runtime.Refinement.listStream executableRefinement
+ (t0 :: rest ++ List.replicate (2 ^ k + 1) t0)) k = dep at related
+ cases related with
+ | parsed value stream =>
+ exact dependent_ne_parsed_of_no_eof _ k hin hlen value stream hdep
+
+/-- **End to end.** If `parseStr` accepts `s` with value `p`, then `tokenize` lexes `s` to
+ `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem parseStr_sound_tokenize (s : String) (k : Nat) (p : Int)
+ (accepted : CalcParser.parseStr s k = some p) :
+ ∃ ts, CalcLexer.tokenize s = .ok ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ cases ht : CalcLexer.tokenize s with
+ | error e =>
+ rw [parseStr_eq_none_of_tokenize_error s k e ht] at accepted
+ cases accepted
+ | ok ts => exact ⟨ts, rfl, parseStr_sound s k ts ht p accepted⟩
+
+/-- **End to end, with the lexer specification.** If `parseStr` accepts `s` with value `p`,
+ then `s` has a maximal-munch tokenization (`Lexer.Tokenization`), the spec tokenizer
+ returns the token values of `ts = tokenize s`, and `ts` starts with the word of a parse
+ tree whose value is `p`. -/
+theorem parseStr_sound_tokenization (s : String) (k : Nat) (p : Int)
+ (accepted : CalcParser.parseStr s k = some p) :
+ ∃ ts, CalcLexer.tokenize s = .ok ts ∧ Lexer.Tokenization CalcLexer.rules0 s.toList ∧
+ Lexer.tokenize CalcLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ obtain ⟨htok, hspec⟩ := CalcLexer.tokenize_sound ht
+ exact ⟨ts, ht, htok, hspec, hp⟩
+
+/-- **`tokenize` then `parse`.** If `tokenize` lexes `s` to `ts` and `parse` accepts `ts` with
+ value `p`, then `s` has a maximal-munch tokenization, the spec tokenizer returns the token
+ values of `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem tokenize_parse_sound (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok)) (p : Int)
+ (h : CalcLexer.tokenize s = .ok ts) (accepted : CalcParser.parse ts k = some p) :
+ Lexer.Tokenization CalcLexer.rules0 s.toList ∧ Lexer.tokenize CalcLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨htok, hspec⟩ := CalcLexer.tokenize_sound h
+ exact ⟨htok, hspec, parser_sound ts k p accepted⟩
+
+/-- **Completeness.** If `tokenize` lexes `s` to `ts` and a parse tree of the start symbol
+ spans exactly `ts`, within the fuel, `parseStr` returns the tree's value. -/
+theorem parseStr_complete (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : CalcLexer.tokenize s = .ok ts) (tree : ParserStartTree ts)
+ (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ CalcParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ rw [parseStr_eq s k ts h]
+ exact parser_complete tree k fuel
+
+/-- **Completeness from a tokenization (value level).** A maximal-munch `Lexer.Lexing` of `s`
+ gives the tokens `ts` of `tokenize s`, whose values are the tokens of its steps, and
+ `parseStr` accepts every parse tree over `ts` within the fuel, with the tree's value. -/
+theorem parseStr_complete_lexing (s : String) (k : Nat) (steps : List (Nat × Nat))
+ (hsteps : Lexer.Lexing CalcLexer.rules0 s.toList steps) :
+ ∃ ts, CalcLexer.tokenize s = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CalcLexer.lexer CalcLexer.lexer.start s.toList steps ∧
+ ∀ tree : ParserStartTree ts, Grammar.ptSize tree ≤ 2 ^ k →
+ CalcParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ obtain ⟨ts, ht, hv⟩ := CalcLexer.tokenize_complete hsteps
+ exact ⟨ts, ht, hv, fun tree fuel => parseStr_complete s k ts ht tree fuel⟩
+
+/-- **Unambiguity (value level).** Two derivations of `s`, each the tokens `tokenize` returns
+ for `s` and a parse tree over them, have the same tokens and the same value. -/
+theorem parseStr_unambiguous (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CalcLexer.tokenize s = .ok ts₁) (h₂ : CalcLexer.tokenize s = .ok ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ rw [h₁] at h₂
+ cases h₂
+ exact ⟨rfl, (parser_unambiguous tree₁ tree₂).2⟩
+
+/-- **Completeness over positioned tokens.** If `ts` is the positioned tokenization of `s`
+ (`CalcLexer.Lexes`) and a parse tree of the start symbol spans exactly `ts`, within the fuel,
+ `parseStr` returns the tree's value. -/
+theorem parseStr_complete_lexes (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : CalcLexer.Lexes s ts) (tree : ParserStartTree ts) (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ CalcParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) :=
+ parseStr_complete s k ts ((CalcLexer.tokenize_iff_lexes s ts).mpr h) tree fuel
+
+/-- **Unambiguity over positioned tokens.** Two derivations of `s`, each a positioned
+ tokenization and a parse tree over it, have the same tokens, and their trees have the
+ same span and value. -/
+theorem parseStr_unambiguous_lexes (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CalcLexer.Lexes s ts₁) (h₂ : CalcLexer.Lexes s ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSpan ⟨0⟩ tree₁ = SpanGrammar.ptSpan ⟨0⟩ tree₂ ∧
+ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ have he := CalcLexer.lexes_unique h₁ h₂
+ subst he
+ exact ⟨rfl, parser_unambiguous tree₁ tree₂⟩
+
+/-- **Node spans as text of `s`.** In a parse tree over the positioned tokenization `ts` of
+ `s` (`CalcLexer.Lexes`), every leaf's span is `[a, b)` for positions `a ≤ b` of `s`, and a rule's
+ action emits the leaf's token from the lexeme `s.extract a b` (or the leaf is the
+ end-of-input token at the end of `s`). Every inner node's span is `[a, b)` for positions
+ `a ≤ b` of `s`; `b` is the end of the lexeme of the node's last token, and `a` is the start
+ of the lexeme of its first token or, when its word is empty or its leftmost children
+ derive the empty word, the end of the token before it (`Lexer.AllNodeText`). -/
+theorem parseStr_node_spans (s : String) (ts : List (Runtime.Positioned Tok)) (h : CalcLexer.Lexes s ts)
+ (tree : ParserStartTree ts) :
+ Lexer.AllNodeText (Lexer.modeAct CalcLexer.lexer CalcLexer.lexer.start) CalcLexer.lexer.eofToken s ⟨0⟩ tree :=
+ Lexer.PosLexing.allNodeText h tree
+
+/-- **End to end over positioned tokens.** If `parseStr` accepts `s` with value `p`, then
+ `s` has a positioned tokenization `ts` (`CalcLexer.Lexes`), and `ts` starts with the word of a
+ parse tree whose value is `p`. -/
+theorem parseStr_sound_lexes (s : String) (k : Nat) (p : Int)
+ (accepted : CalcParser.parseStr s k = some p) :
+ ∃ ts, CalcLexer.Lexes s ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ exact ⟨ts, (CalcLexer.tokenize_iff_lexes s ts).mp ht, hp⟩
+
+/-- The end marker `$` is the last symbol of every production of the start symbol, and no
+ other position of a right-hand side holds `$` or the start symbol. -/
+theorem endMarker_last : ∀ p : Production,
+ (prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ (prodRhsRev' p).head? = some (Symbol.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) ∧
+ ∀ x ∈ (prodRhsRev' p).tail, x ≠ Symbol.T (⟨7, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) ∧
+ (prodLhs' p ≠ startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ ∀ x ∈ prodRhsRev' p, x ≠ Symbol.T (⟨7, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) := by
+ native_decide
+
+/-- **The tree covers the tokens.** If `ts` is the positioned tokenization of `s`
+ (`CalcLexer.Lexes`), the word of a start tree that begins the stream of `ts` is `ts`: the lexer
+ emits `EOF` only as its last token (`CalcLexer.lexes_eof_last`), and a start tree's word ends
+ with its only `$` token (`endMarker_last`). -/
+theorem word_eq_of_lexes (s : String) (ts : List (Runtime.Positioned Tok)) (h : CalcLexer.Lexes s ts)
+ {word : List grammarInst.Token} (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token)
+ (hs : toStream ts = Runtime.NatStream.appList word rest) : word = ts := by
+ obtain ⟨ts0, rfl, hno⟩ := CalcLexer.lexes_eof_last h
+ exact Runtime.start_word_eq (G := grammarInst) (A := automatonInst) _ _ endMarker_last _ ts0 _
+ rfl (fun t ht he => hno t ht (tokenTerm_eq_end t.val he)) tree rest hs
+
+/-- **End to end, over the whole input.** If `parseStr` accepts `s` with value `p`, then
+ `tokenize` lexes `s` to `ts`, `ts` is the positioned tokenization of `s` (`CalcLexer.Lexes`),
+ and a parse tree over exactly `ts` has the value `p`. -/
+theorem parseStr_sound_exact (s : String) (k : Nat) (p : Int)
+ (accepted : CalcParser.parseStr s k = some p) :
+ ∃ ts, CalcLexer.tokenize s = .ok ts ∧ CalcLexer.Lexes s ts ∧
+ ∃ tree : ParserStartTree ts, SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, word, tree, rest, hs, hp⟩ := parseStr_sound_tokenize s k p accepted
+ have hl := (CalcLexer.tokenize_iff_lexes s ts).mp ht
+ obtain rfl := word_eq_of_lexes s ts hl tree rest hs
+ exact ⟨word, ht, hl, tree, hp⟩
+
end CalcVerified
diff --git a/test/calc/CompletenessValidatorTest.lean b/test/calc/CompletenessValidatorTest.lean
index b7b94d3..be2d5eb 100644
--- a/test/calc/CompletenessValidatorTest.lean
+++ b/test/calc/CompletenessValidatorTest.lean
@@ -29,37 +29,41 @@ Importing `CalcVerified` elaborates both generated validation proofs:
`CalcVerified.safetyValidation` and `CalcVerified.completenessValidation`, then
derives `safety : Safe` and `completeness : Complete`. The examples below also
exercise the explicit-EOF augmented production and its semantic action by kernel
-reduction.
+reduction. They use `decide +kernel`: the elaborator's reduction (plain `decide`) does not
+finish on the derived span semantics (`Runtime.SpanGrammar.toGrammar`), whose values are
+functions of a position.
-/
-example : parse [.NUM 2, .PLUS, .NUM 3, .TIMES, .NUM 4, .EOF] = some 14 := by
- decide
+example : parse ([.NUM 2, .PLUS, .NUM 3, .TIMES, .NUM 4, .EOF].map Positioned.dummy) = some 14 := by
+ decide +kernel
-example : parse [.NUM 2, .PLUS, .EOF] = none := by
- decide
+example : parse ([.NUM 2, .PLUS, .EOF].map Positioned.dummy) = none := by
+ decide +kernel
/-!
Operational completeness and unambiguity specialize to the generated calculator.
-These are compile-time checks that `Runtime.parseComplete` / `Runtime.unambiguity`
-apply with the generated `completeness` certificate; they need no hand
-constructed parse trees.
+These are compile-time checks that `Runtime.SpanGrammar.parseComplete` /
+`Runtime.SpanGrammar.unambiguity` apply with the generated `completeness` certificate;
+they need no hand constructed parse trees.
-/
-/-- Unambiguity of the calculator: any two parse trees of one token list agree on
- their semantic value. Instantiates `Runtime.unambiguity` with the generated
- `completeness` proof. -/
+/-- Unambiguity of the calculator: any two parse trees of one positioned token list agree
+ on their span and semantic value. Instantiates `Runtime.SpanGrammar.unambiguity` with
+ the generated `completeness` proof. -/
theorem calc_unambiguity (init : automatonInst.InitState)
- {word : List Tok}
- (t1 t2 : ParseTree (G := grammarInst) (.NT (automatonInst.startNt init)) word) :
- ptSem t1 = ptSem t2 := by
- haveI : Inhabited grammarInst.Token := inferInstanceAs (Inhabited Tok)
- exact unambiguity (G := grammarInst) (A := automatonInst) completeness init t1 t2
+ {word : List (Positioned Tok)}
+ (t1 t2 : ParseTree (G := grammarInst) (.NT (automatonInst.startNt init)) word)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSpan pe t1 = SpanGrammar.ptSpan pe t2 ∧
+ SpanGrammar.ptSem pe t1 = SpanGrammar.ptSem pe t2 := by
+ haveI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst) completeness init t1 t2 pe
-/-- Operational completeness of the calculator: `Runtime.parseComplete` applies
- with the generated `completeness` proof. The result type (Parsed ⇒ exact
- sem/rest with `ptSize ≤ 2^logN`; Timeout ⇒ `2^logN < ptSize`; Fail/Err
- impossible) is inferred from `parseComplete`. -/
+/-- Operational completeness of the calculator: `Runtime.SpanGrammar.parseComplete`
+ applies with the generated `completeness` proof. The result type (Parsed ⇒ the
+ derived value is the tree's span and value, exact rest, `ptSize ≤ 2^logN`;
+ Timeout ⇒ `2^logN < ptSize`; Fail/Err impossible) is inferred from `parseComplete`. -/
example (init : automatonInst.InitState) (logN : Nat)
- {word : List Tok} (bufEnd : NatStream Tok)
+ {word : List (Positioned Tok)} (bufEnd : NatStream (Positioned Tok))
(tree : ParseTree (G := grammarInst) (.NT (automatonInst.startNt init)) word) :=
- parseComplete (G := grammarInst) (A := automatonInst) completeness init logN bufEnd tree
+ SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst) completeness init logN bufEnd tree
diff --git a/test/calc/RefinementTest.lean b/test/calc/RefinementTest.lean
index 81f82fc..6e93146 100644
--- a/test/calc/RefinementTest.lean
+++ b/test/calc/RefinementTest.lean
@@ -26,48 +26,47 @@ open Calc CalcVerified Runtime
/-! Regression checks for the generated parser refinement witness.
- The executable parser runs over `Runtime.Positioned Tok`; the verified
- corollaries relate it to the dependent spec on dummy-spanned input (spans are
- diagnostic metadata and do not affect the dependent value). `pos` wraps a bare
- token list with dummy spans. -/
+ The executable parser and the dependent spec both run over `Runtime.Positioned Tok`;
+ the refinement holds on the real spans. `pos` wraps a bare token list with dummy
+ spans. -/
private def pos (ts : List Tok) : List (Runtime.Positioned Tok) :=
ts.map (fun t => ⟨t, Runtime.Span.dummy⟩)
-example (input : List Tok) (logNSteps : Nat) :
- CalcParser.parse (pos input) logNSteps = CalcVerified.parse input logNSteps :=
+example (input : List (Runtime.Positioned Tok)) (logNSteps : Nat) :
+ CalcParser.parse input logNSteps = CalcVerified.parse input logNSteps :=
parse_eq_dependent input logNSteps
-example : CalcParser.parse (pos [.NUM 7]) 20 = CalcVerified.parse [.NUM 7] 20 := by
- simpa [pos] using parse_eq_dependent [.NUM 7] 20
+example : CalcParser.parse (pos [.NUM 7]) 20 = CalcVerified.parse (pos [.NUM 7]) 20 :=
+ parse_eq_dependent _ 20
/-! Parser-facing guarantees require no manual refinement/safety/completeness arguments. -/
-example (input : List Tok) (logNSteps : Nat) (semantic : Int)
- (accepted : CalcParser.parse (pos input) logNSteps = some semantic) :
- ∃ (word : List Tok) (tree : CalcVerified.ParserStartTree word)
- (rest : Runtime.NatStream Tok),
+example (input : List (Runtime.Positioned Tok)) (logNSteps : Nat) (semantic : Int)
+ (accepted : CalcParser.parse input logNSteps = some semantic) :
+ ∃ (word : List (Runtime.Positioned Tok)) (tree : CalcVerified.ParserStartTree word)
+ (rest : Runtime.NatStream (Runtime.Positioned Tok)),
CalcVerified.toStream input = Runtime.NatStream.appList word rest ∧
- Runtime.Grammar.ptSem tree = semantic :=
+ Runtime.SpanGrammar.ptSem ⟨0⟩ tree = semantic :=
CalcVerified.parser_sound input logNSteps semantic accepted
-example (input : List Tok) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (CalcParser.run (pos input) logNSteps) :=
+example (input : List (Runtime.Positioned Tok)) (logNSteps : Nat) :
+ Runtime.Exec.ResultErrFree (CalcParser.run input logNSteps) :=
CalcVerified.parser_err_free input logNSteps
-example (input : List Tok) (logNSteps : Nat) (message : String) :
- CalcParser.run (pos input) logNSteps ≠ .err message :=
+example (input : List (Runtime.Positioned Tok)) (logNSteps : Nat) (message : String) :
+ CalcParser.run input logNSteps ≠ .err message :=
CalcVerified.parser_ne_err input logNSteps message
-example {word : List Tok} (tree : CalcVerified.ParserStartTree word)
+example {word : List (Runtime.Positioned Tok)} (tree : CalcVerified.ParserStartTree word)
(logNSteps : Nat) (fuel : Runtime.Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- CalcParser.parse (pos word) logNSteps = some (Runtime.Grammar.ptSem tree) :=
+ CalcParser.parse word logNSteps = some (Runtime.SpanGrammar.ptSem ⟨0⟩ tree) :=
CalcVerified.parser_complete tree logNSteps fuel
-example {word : List Tok} (tree1 tree2 : CalcVerified.ParserStartTree word) :
- Runtime.Grammar.ptSem tree1 = Runtime.Grammar.ptSem tree2 :=
- CalcVerified.parser_unambiguous tree1 tree2
+example {word : List (Runtime.Positioned Tok)} (tree1 tree2 : CalcVerified.ParserStartTree word) :
+ Runtime.SpanGrammar.ptSem ⟨0⟩ tree1 = Runtime.SpanGrammar.ptSem ⟨0⟩ tree2 :=
+ (CalcVerified.parser_unambiguous tree1 tree2).2
namespace CalcRefinementNegative
/-- A parser whose action table rejects every lookahead cannot refine the verified calculator. -/
@@ -79,24 +78,19 @@ example : CalcVerified.refinementStructuralCheck badActionTable = false := by
/-- A wrong semantic dispatcher cannot reuse the generated refinement proof. -/
def badSemanticTable : Runtime.Exec.ExecTable CalcParser.VP :=
- { CalcParser.table with sem := fun _ _ => (Runtime.Span.dummy, .unit ()) }
+ { CalcParser.table with sem := fun _ _ _ => (Runtime.Span.dummy, .unit ()) }
/--
error: Type mismatch
- __src✝.semantic_agrees
+ __src✝.sem_agrees
has type
- ∀ (production : GrammarSig.Production) (values : Refinement.Values (GrammarSig.prodRhsRev production)),
- __src✝.table.sem (__src✝.productionIndex production) (Refinement.Values.encode __src✝.encodeValue values).reverse =
- __src✝.encodeValue (Symbol.NT (GrammarSig.prodLhs production)) (values.apply (Grammar.prodAction production))
+ __src✝.table.sem = Exec.spanSem __src✝.semV
but is expected to have type
- ∀ (production : GrammarSig.Production) (values : Refinement.Values (GrammarSig.prodRhsRev production)),
- badSemanticTable.sem (__src✝.productionIndex production)
- (Refinement.Values.encode __src✝.encodeValue values).reverse =
- __src✝.encodeValue (Symbol.NT (GrammarSig.prodLhs production)) (values.apply (Grammar.prodAction production))
+ badSemanticTable.sem = Exec.spanSem __src✝.semV
-/
#guard_msgs in
def badSemanticRefinement : Runtime.Refinement.ExecRefinement
- (G := CalcVerified.grammarInst) (A := CalcVerified.automatonInst) CalcParser.VP :=
+ (SG := CalcVerified.spanGrammarInst) (A := CalcVerified.automatonInst) CalcParser.V :=
{ CalcVerified.executableRefinement with table := badSemanticTable }
end CalcRefinementNegative
diff --git a/test/cedar/CedarLexer.lean b/test/cedar/CedarLexer.lean
index c91dbcf..c16a3ba 100644
--- a/test/cedar/CedarLexer.lean
+++ b/test/cedar/CedarLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
public import cedar.CedarAst
@@ -364,9 +368,93 @@ theorem CedarLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees CedarLexer.fastActs CedarLexer.cbyte.flat.base.acts :=
CedarLexer.fastActs_agree
-theorem CedarLexer.byteValidated0 :
- Lexer.byteValidate (CedarLexer.cbyte.bytes.getD 0 default)
- (CedarLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def CedarLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte CedarLexer.cbyte input
+
+theorem CedarLexer.byteUnicodeValidated : Lexer.byteValidAll CedarLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem CedarLexer.posLexerAgrees : Lexer.PosLexerAgrees CedarLexer.cbyte CedarLexer.tokenize := by
+ intro s
+ rw [CedarLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll CedarLexer.cbyte CedarLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem CedarLexer.tokenizeByte_toOption (s : String) :
+ (CedarLexer.tokenizeByte s).toOption = (CedarLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption CedarLexer.cbyte CedarLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem CedarLexer.noEofEmit :
+ ∀ m r, (CedarLexer.fastActs.get m r).emit = true → ∀ s, (CedarLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL CedarLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ h => by first | (dsimp only at h; unfold keywordOrIdentifier at h; (repeat' split at h) <;> contradiction) | (dsimp only at h; set_option linter.unusedSimpArgs false in simp [keywordOrIdentifier, stripStringQuotes] at h; (repeat' split at h) <;> simp_all)) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) Lexer.AllL.nil)))))))))))))))))))))))))))))))))))
+ Lexer.AllL.nil)
+
+theorem CedarLexer.stay0 : ∀ r, (CedarLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL CedarLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil))))))))))))))))))))))))))))))))))) Lexer.AllL.nil) 0
+
+theorem CedarLexer.textIndep0 : ∀ r, CedarLexer.cflat.needsText 0 r = false →
+ ∀ s, (CedarLexer.fastActs.get 0 r).toAct s = (CedarLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ CedarLexer.fastActs (CedarLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) Lexer.Forall₂.nil)))))))))))))))))))))))))))))))))))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem CedarLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CedarLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization CedarLexer.rules0 input.toList ∧
+ Lexer.tokenize CedarLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound CedarLexer.cflat CedarLexer.fastActs CedarLexer.fastActs_agree
+ CedarLexer.validated0 rfl CedarLexer.flatValidated0 (by decide) CedarLexer.stay0
+ CedarLexer.textIndep0 (by rw [← CedarLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem CedarLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing CedarLexer.rules0 input.toList steps) :
+ ∃ ts, CedarLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CedarLexer.lexer CedarLexer.lexer.start input.toList steps := by
+ rw [CedarLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete CedarLexer.cflat CedarLexer.fastActs CedarLexer.fastActs_agree
+ CedarLexer.validated0 rfl CedarLexer.flatValidated0 (by decide) CedarLexer.stay0
+ CedarLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev CedarLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing CedarLexer.rules0 (Lexer.modeAct CedarLexer.lexer CedarLexer.lexer.start)
+ CedarLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem CedarLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ CedarLexer.tokenize s = .ok ts ↔ CedarLexer.Lexes s ts := by
+ rw [CedarLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' CedarLexer.cflat CedarLexer.fastActs
+ CedarLexer.fastActs_agree CedarLexer.validated0 rfl CedarLexer.flatValidated0 (by decide)
+ CedarLexer.stay0 CedarLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem CedarLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos CedarLexer.cbyte s = .ok ts ↔ CedarLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff CedarLexer.posLexerAgrees s ts).trans (CedarLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem CedarLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarLexer.Lexes s ts₁) (h₂ : CedarLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem CedarLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CedarLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees CedarLexer.lexer CedarLexer.fastActs CedarLexer.fastActs_agree
+ _ CedarLexer.noEofEmit _) h
diff --git a/test/cedar/CedarParser.lean b/test/cedar/CedarParser.lean
index cb08c56..c68e58d 100644
--- a/test/cedar/CedarParser.lean
+++ b/test/cedar/CedarParser.lean
@@ -190,302 +190,155 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def semS : Nat → List VP → Runtime.Span
- | 0, [(ps_span, .v38 ps)] => ps_span
- | 1, [(__s0, _), (key_span, .v37 key)] => Runtime.Span.merge __s0 key_span
- | 2, [(__s0, _), (key_span, .v37 key), (__s2, _), (value_span, .v36 value), (__s4, _)] => Runtime.Span.merge __s0 __s4
- | 3, [(annotations_span, .v39 annotations), (effect_span, .v37 effect), (__s2, _), (variables_span, .v3 variables), (__s4, _), (conds_span, .v40 conds), (__s6, _)] => Runtime.Span.merge annotations_span __s6
- | 4, [] => Runtime.Span.dummy
- | 5, [(v_span, .v4 v), (rest_span, .v3 rest)] => Runtime.Span.merge v_span rest_span
- | 6, [] => Runtime.Span.dummy
- | 7, [(__s0, _)] => __s0
- | 8, [(__s0, _), (v_span, .v4 v), (rest_span, .v3 rest)] => Runtime.Span.merge __s0 rest_span
- | 9, [(varName_span, .v37 varName), (unused_span, .v5 unused), (entity_span, .v6 entity), (ineq_span, .v7 ineq)] => Runtime.Span.merge varName_span ineq_span
- | 10, [] => Runtime.Span.dummy
- | 11, [(__s0, _), (name_span, .v31 name)] => Runtime.Span.merge __s0 name_span
- | 12, [] => Runtime.Span.dummy
- | 13, [(__s0, _), (entity_span, .v19 entity)] => Runtime.Span.merge __s0 entity_span
- | 14, [] => Runtime.Span.dummy
- | 15, [(op_span, .v16 op), (expression_span, .v9 expression)] => Runtime.Span.merge op_span expression_span
- | 16, [(kind_span, .v37 kind), (__s1, _), (expression_span, .v9 expression), (__s3, _)] => Runtime.Span.merge kind_span __s3
- | 17, [(value_span, .v10 value)] => value_span
- | 18, [(__s0, _), (condition_span, .v9 condition), (__s2, _), (thenExpr_span, .v9 thenExpr), (__s4, _), (elseExpr_span, .v9 elseExpr)] => Runtime.Span.merge __s0 elseExpr_span
- | 19, [(initial_span, .v12 initial), (extended_span, .v11 extended)] => Runtime.Span.merge initial_span extended_span
- | 20, [] => Runtime.Span.dummy
- | 21, [(__s0, _), (next_span, .v12 next), (rest_span, .v11 rest)] => Runtime.Span.merge __s0 rest_span
- | 22, [(initial_span, .v14 initial), (extended_span, .v13 extended)] => Runtime.Span.merge initial_span extended_span
- | 23, [] => Runtime.Span.dummy
- | 24, [(__s0, _), (next_span, .v14 next), (rest_span, .v13 rest)] => Runtime.Span.merge __s0 rest_span
- | 25, [(target_span, .v19 target), (__s1, _), (field_span, .v19 field)] => Runtime.Span.merge target_span field_span
- | 26, [(target_span, .v19 target), (__s1, _), (__s2, _), (access_span, .v41 access)] => Runtime.Span.merge target_span access_span
- | 27, [(target_span, .v19 target), (__s1, _), (pattern_span, .v19 pattern)] => Runtime.Span.merge target_span pattern_span
- | 28, [(target_span, .v19 target), (__s1, _), (entityType_span, .v19 entityType), (inEntity_span, .v6 inEntity)] => Runtime.Span.merge target_span inEntity_span
- | 29, [(initial_span, .v19 initial), (extended_span, .v15 extended)] => Runtime.Span.merge initial_span extended_span
- | 30, [] => Runtime.Span.dummy
- | 31, [(op_span, .v16 op), (next_span, .v19 next), (rest_span, .v15 rest)] => Runtime.Span.merge op_span rest_span
- | 32, [] => Runtime.Span.dummy
- | 33, [(__s0, _), (entity_span, .v19 entity)] => Runtime.Span.merge __s0 entity_span
- | 34, [(__s0, _)] => __s0
- | 35, [(__s0, _)] => __s0
- | 36, [(__s0, _)] => __s0
- | 37, [(__s0, _)] => __s0
- | 38, [(__s0, _)] => __s0
- | 39, [(__s0, _)] => __s0
- | 40, [(__s0, _)] => __s0
- | 41, [(__s0, _)] => __s0
- | 42, [(__s0, _)] => __s0
- | 43, [(__s0, _)] => __s0
- | 44, [(__s0, _)] => __s0
- | 45, [(__s0, _)] => __s0
- | 46, [(__s0, _)] => __s0
- | 47, [(initial_span, .v21 initial), (extended_span, .v20 extended)] => Runtime.Span.merge initial_span extended_span
- | 48, [] => Runtime.Span.dummy
- | 49, [(op_span, .v17 op), (next_span, .v21 next), (rest_span, .v20 rest)] => Runtime.Span.merge op_span rest_span
- | 50, [(initial_span, .v23 initial), (extended_span, .v22 extended)] => Runtime.Span.merge initial_span extended_span
- | 51, [] => Runtime.Span.dummy
- | 52, [(op_span, .v18 op), (next_span, .v23 next), (rest_span, .v22 rest)] => Runtime.Span.merge op_span rest_span
- | 53, [(item_span, .v24 item)] => item_span
- | 54, [(__s0, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 55, [(__s0, _), (__s1, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 56, [(__s0, _), (__s1, _), (__s2, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 57, [(__s0, _), (__s1, _), (__s2, _), (__s3, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 58, [(__s0, _), (__s1, _), (__s2, _), (__s3, _), (_bang_span, .unit _bang), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 59, [(__s0, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 60, [(__s0, _), (__s1, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 61, [(__s0, _), (__s1, _), (__s2, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 62, [(__s0, _), (__s1, _), (__s2, _), (__s3, _), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 63, [(__s0, _), (__s1, _), (__s2, _), (__s3, _), (_dash_span, .unit _dash), (item_span, .v24 item)] => Runtime.Span.merge __s0 item_span
- | 64, [(__s0, _)] => __s0
- | 65, [(__s0, _), (_rest_span, .unit _rest)] => Runtime.Span.merge __s0 _rest_span
- | 66, [(__s0, _)] => __s0
- | 67, [(__s0, _), (_rest_span, .unit _rest)] => Runtime.Span.merge __s0 _rest_span
- | 68, [(item_span, .v26 item), (access_span, .v41 access)] => Runtime.Span.merge item_span access_span
- | 69, [(__s0, _), (field_span, .v37 field)] => Runtime.Span.merge __s0 field_span
- | 70, [(__s0, _), (args_span, .v27 args), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 71, [(__s0, _), (index_span, .v9 index), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 72, [(literal_span, .v35 literal)] => literal_span
- | 73, [(value_span, .v26 value)] => value_span
- | 74, [(__s0, _)] => __s0
- | 75, [(__s0, _)] => __s0
- | 76, [(slot_span, .v42 slot)] => slot_span
- | 77, [(__s0, _), (expression_span, .v9 expression), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 78, [(__s0, _), (elements_span, .v27 elements), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 79, [(__s0, _), (fields_span, .v28 fields), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 80, [] => Runtime.Span.dummy
- | 81, [(expression_span, .v9 expression), (rest_span, .v27 rest)] => Runtime.Span.merge expression_span rest_span
- | 82, [] => Runtime.Span.dummy
- | 83, [(__s0, _)] => __s0
- | 84, [(__s0, _), (expression_span, .v9 expression), (rest_span, .v27 rest)] => Runtime.Span.merge __s0 rest_span
- | 85, [] => Runtime.Span.dummy
- | 86, [(init_span, .v29 init), (rest_span, .v28 rest)] => Runtime.Span.merge init_span rest_span
- | 87, [] => Runtime.Span.dummy
- | 88, [(__s0, _)] => __s0
- | 89, [(__s0, _), (init_span, .v29 init), (rest_span, .v28 rest)] => Runtime.Span.merge __s0 rest_span
- | 90, [(__s0, _), (__s1, _), (value_span, .v9 value)] => Runtime.Span.merge __s0 value_span
- | 91, [(key_span, .v9 key), (__s1, _), (value_span, .v9 value)] => Runtime.Span.merge key_span value_span
- | 92, [(first_span, .v37 first)] => first_span
- | 93, [(first_span, .v37 first), (__s1, _), (tail_span, .v30 tail)] => Runtime.Span.merge first_span tail_span
- | 94, [(first_span, .v37 first), (__s1, _), (last_span, .v37 last)] => Runtime.Span.merge first_span last_span
- | 95, [(first_span, .v37 first), (__s1, _), (next_span, .v37 next), (__s3, _), (tail_span, .v30 tail)] => Runtime.Span.merge first_span tail_span
- | 96, [(last_span, .v37 last)] => last_span
- | 97, [(eid_span, .v36 eid)] => eid_span
- | 98, [(__s0, _), (fields_span, .v33 fields), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 99, [(next_span, .v37 next), (__s1, _), (tail_span, .v30 tail)] => Runtime.Span.merge next_span tail_span
- | 100, [(name_span, .v37 name)] => name_span
- | 101, [(first_span, .v37 first), (__s1, _), (tail_span, .v32 tail)] => Runtime.Span.merge first_span tail_span
- | 102, [(last_span, .v37 last)] => last_span
- | 103, [(next_span, .v37 next), (__s1, _), (tail_span, .v32 tail)] => Runtime.Span.merge next_span tail_span
- | 104, [] => Runtime.Span.dummy
- | 105, [(init_span, .v34 init), (rest_span, .v33 rest)] => Runtime.Span.merge init_span rest_span
- | 106, [] => Runtime.Span.dummy
- | 107, [(__s0, _)] => __s0
- | 108, [(__s0, _), (init_span, .v34 init), (rest_span, .v33 rest)] => Runtime.Span.merge __s0 rest_span
- | 109, [(field_span, .v37 field), (__s1, _), (value_span, .v35 value)] => Runtime.Span.merge field_span value_span
- | 110, [(__s0, _)] => __s0
- | 111, [(__s0, _)] => __s0
- | 112, [(number_span, .v44 number)] => number_span
- | 113, [(value_span, .v36 value)] => value_span
- | 114, [(value_span, .v42 value)] => value_span
- | 115, [(__s0, _)] => __s0
- | 116, [(__s0, _)] => __s0
- | 117, [(__s0, _)] => __s0
- | 118, [(__s0, _)] => __s0
- | 119, [(__s0, _)] => __s0
- | 120, [(__s0, _)] => __s0
- | 121, [(__s0, _)] => __s0
- | 122, [(__s0, _)] => __s0
- | 123, [(__s0, _)] => __s0
- | 124, [(__s0, _)] => __s0
- | 125, [(__s0, _)] => __s0
- | 126, [(__s0, _)] => __s0
- | 127, [(__s0, _)] => __s0
- | 128, [(__s0, _)] => __s0
- | 129, [(value_span, .v43 value)] => value_span
- | 130, [(__s0, _)] => __s0
- | 131, [(__s0, _)] => __s0
- | 132, [(__s0, _)] => __s0
- | 133, [(value_span, .v37 value)] => value_span
- | 134, [(value_span, .v37 value)] => value_span
- | 135, [] => Runtime.Span.dummy
- | 136, [(xs_span, .v38 xs), (x_span, .v2 x)] => Runtime.Span.merge xs_span x_span
- | 137, [] => Runtime.Span.dummy
- | 138, [(xs_span, .v39 xs), (x_span, .v1 x)] => Runtime.Span.merge xs_span x_span
- | 139, [] => Runtime.Span.dummy
- | 140, [(xs_span, .v40 xs), (x_span, .v8 x)] => Runtime.Span.merge xs_span x_span
- | 141, [] => Runtime.Span.dummy
- | 142, [(xs_span, .v41 xs), (x_span, .v25 x)] => Runtime.Span.merge xs_span x_span
- | 143, [x, _] => x.1
- | _, _ => Runtime.Span.dummy
-
-def semV : Nat → List V → V
- | 0, [.v38 ps] => .v0 (Policies.mk ps.toList)
- | 1, [_, .v37 key] => .v1 (Annotation.mk key none)
- | 2, [_, .v37 key, _, .v36 value, _] => .v1 (Annotation.mk key (some value))
- | 3, [.v39 annotations, .v37 effect, _, .v3 variables, _, .v40 conds, _] => .v2 (Policy.policy (PolicyImpl.mk annotations.toList effect variables conds.toList))
- | 4, [] => .v3 ([])
- | 5, [.v4 v, .v3 rest] => .v3 (v :: rest)
- | 6, [] => .v3 ([])
- | 7, [_] => .v3 ([])
- | 8, [_, .v4 v, .v3 rest] => .v3 (v :: rest)
- | 9, [.v37 varName, .v5 unused, .v6 entity, .v7 ineq] => .v4 (VariableDef.mk varName unused entity ineq)
- | 10, [] => .v5 (none)
- | 11, [_, .v31 name] => .v5 (some name)
- | 12, [] => .v6 (none)
- | 13, [_, .v19 entity] => .v6 (some entity)
- | 14, [] => .v7 (none)
- | 15, [.v16 op, .v9 expression] => .v7 (some (op, expression))
- | 16, [.v37 kind, _, .v9 expression, _] => .v8 (Cond.mk kind expression)
- | 17, [.v10 value] => .v9 (Expr.expr (ExprImpl.mk (ExprData.or value)))
- | 18, [_, .v9 condition, _, .v9 thenExpr, _, .v9 elseExpr] => .v9 (Expr.expr (ExprImpl.mk (ExprData.ifThenElse condition thenExpr elseExpr)))
- | 19, [.v12 initial, .v11 extended] => .v10 (Or.mk initial extended)
- | 20, [] => .v11 ([])
- | 21, [_, .v12 next, .v11 rest] => .v11 (next :: rest)
- | 22, [.v14 initial, .v13 extended] => .v12 (And.mk initial extended)
- | 23, [] => .v13 ([])
- | 24, [_, .v14 next, .v13 rest] => .v13 (next :: rest)
- | 25, [.v19 target, _, .v19 field] => .v14 (Relation.has target field)
- | 26, [.v19 target, _, _, .v41 access] => .v14 (Relation.has target (Cedar.Add.fromIdent .ifIdent access.toList))
- | 27, [.v19 target, _, .v19 pattern] => .v14 (Relation.like target pattern)
- | 28, [.v19 target, _, .v19 entityType, .v6 inEntity] => .v14 (Relation.isIn target entityType inEntity)
- | 29, [.v19 initial, .v15 extended] => .v14 (Relation.common initial extended)
- | 30, [] => .v15 ([])
- | 31, [.v16 op, .v19 next, .v15 rest] => .v15 ((op, next) :: rest)
- | 32, [] => .v6 (none)
- | 33, [_, .v19 entity] => .v6 (some entity)
- | 34, [_] => .v16 (.less)
- | 35, [_] => .v16 (.lessEq)
- | 36, [_] => .v16 (.greaterEq)
- | 37, [_] => .v16 (.greater)
- | 38, [_] => .v16 (.notEq)
- | 39, [_] => .v16 (.eq)
- | 40, [_] => .v16 (.inOp)
- | 41, [_] => .v16 (.invalidSingleEq)
- | 42, [_] => .v17 (.plus)
- | 43, [_] => .v17 (.minus)
- | 44, [_] => .v18 (.times)
- | 45, [_] => .v18 (.divide)
- | 46, [_] => .v18 (.mod)
- | 47, [.v21 initial, .v20 extended] => .v19 (Cedar.Add.mk initial extended)
- | 48, [] => .v20 ([])
- | 49, [.v17 op, .v21 next, .v20 rest] => .v20 ((op, next) :: rest)
- | 50, [.v23 initial, .v22 extended] => .v21 (Mult.mk initial extended)
- | 51, [] => .v22 ([])
- | 52, [.v18 op, .v23 next, .v22 rest] => .v22 ((op, next) :: rest)
- | 53, [.v24 item] => .v23 (Unary.mk none item)
- | 54, [_, .v24 item] => .v23 (Unary.mk (some (.bang 1)) item)
- | 55, [_, _, .v24 item] => .v23 (Unary.mk (some (.bang 2)) item)
- | 56, [_, _, _, .v24 item] => .v23 (Unary.mk (some (.bang 3)) item)
- | 57, [_, _, _, _, .v24 item] => .v23 (Unary.mk (some (.bang 4)) item)
- | 58, [_, _, _, _, .unit _bang, .v24 item] => .v23 (Unary.mk (some .overBang) item)
- | 59, [_, .v24 item] => .v23 (Unary.mk (some (.dash 1)) item)
- | 60, [_, _, .v24 item] => .v23 (Unary.mk (some (.dash 2)) item)
- | 61, [_, _, _, .v24 item] => .v23 (Unary.mk (some (.dash 3)) item)
- | 62, [_, _, _, _, .v24 item] => .v23 (Unary.mk (some (.dash 4)) item)
- | 63, [_, _, _, _, .unit _dash, .v24 item] => .v23 (Unary.mk (some .overDash) item)
- | 64, [_] => .unit (())
- | 65, [_, .unit _rest] => .unit (())
- | 66, [_] => .unit (())
- | 67, [_, .unit _rest] => .unit (())
- | 68, [.v26 item, .v41 access] => .v24 (Member.mk item access.toList)
- | 69, [_, .v37 field] => .v25 (MemAccess.field field)
- | 70, [_, .v27 args, _] => .v25 (MemAccess.call args)
- | 71, [_, .v9 index, _] => .v25 (MemAccess.index index)
- | 72, [.v35 literal] => .v26 (Primary.literal literal)
- | 73, [.v26 value] => .v26 (value)
- | 74, [_] => .v26 (Primary.slot .principal)
- | 75, [_] => .v26 (Primary.slot .resource)
- | 76, [.v42 slot] => .v26 (Primary.slot (.other slot))
- | 77, [_, .v9 expression, _] => .v26 (Primary.expr expression)
- | 78, [_, .v27 elements, _] => .v26 (Primary.exprList elements)
- | 79, [_, .v28 fields, _] => .v26 (Primary.record fields)
- | 80, [] => .v27 ([])
- | 81, [.v9 expression, .v27 rest] => .v27 (expression :: rest)
- | 82, [] => .v27 ([])
- | 83, [_] => .v27 ([])
- | 84, [_, .v9 expression, .v27 rest] => .v27 (expression :: rest)
- | 85, [] => .v28 ([])
- | 86, [.v29 init, .v28 rest] => .v28 (init :: rest)
- | 87, [] => .v28 ([])
- | 88, [_] => .v28 ([])
- | 89, [_, .v29 init, .v28 rest] => .v28 (init :: rest)
- | 90, [_, _, .v9 value] => .v29 (RecInit.mk (Expr.fromIdent .ifIdent) value)
- | 91, [.v9 key, _, .v9 value] => .v29 (RecInit.mk key value)
- | 92, [.v37 first] => .v26 (Primary.name (Name.mk [] first))
- | 93, [.v37 first, _, .v30 tail] => .v26 (tail [first])
- | 94, [.v37 first, _, .v37 last] => .v26 (Primary.name (Name.mk [first] last))
- | 95, [.v37 first, _, .v37 next, _, .v30 tail] => .v26 (tail [first, next])
- | 96, [.v37 last] => .v30 (fun path => Primary.name (Name.mk path last))
- | 97, [.v36 eid] => .v30 (fun components => Primary.ref (Ref.uid (Name.fromComponents components) eid))
- | 98, [_, .v33 fields, _] => .v30 (fun components => Primary.ref (Ref.ref (Name.fromComponents components) fields))
- | 99, [.v37 next, _, .v30 tail] => .v30 (fun path => tail (path ++ [next]))
- | 100, [.v37 name] => .v31 (Name.mk [] name)
- | 101, [.v37 first, _, .v32 tail] => .v31 (Name.mk (first :: tail.1) tail.2)
- | 102, [.v37 last] => .v32 (([], last))
- | 103, [.v37 next, _, .v32 tail] => .v32 ((next :: tail.1, tail.2))
- | 104, [] => .v33 ([])
- | 105, [.v34 init, .v33 rest] => .v33 (init :: rest)
- | 106, [] => .v33 ([])
- | 107, [_] => .v33 ([])
- | 108, [_, .v34 init, .v33 rest] => .v33 (init :: rest)
- | 109, [.v37 field, _, .v35 value] => .v34 (RefInit.mk field value)
- | 110, [_] => .v35 (.trueLit)
- | 111, [_] => .v35 (.falseLit)
- | 112, [.v44 number] => .v35 (.num number)
- | 113, [.v36 value] => .v35 (.str value)
- | 114, [.v42 value] => .v36 (.string value)
- | 115, [_] => .v37 (.principal)
- | 116, [_] => .v37 (.action)
- | 117, [_] => .v37 (.resource)
- | 118, [_] => .v37 (.context)
- | 119, [_] => .v37 (.permit)
- | 120, [_] => .v37 (.forbid)
- | 121, [_] => .v37 (.when)
- | 122, [_] => .v37 (.unless)
- | 123, [_] => .v37 (.inIdent)
- | 124, [_] => .v37 (.has)
- | 125, [_] => .v37 (.like)
- | 126, [_] => .v37 (.is)
- | 127, [_] => .v37 (.thenIdent)
- | 128, [_] => .v37 (.elseIdent)
- | 129, [.v43 value] => .v37 (.ident value)
- | 130, [_] => .v37 (.ifIdent)
- | 131, [_] => .v37 (.trueIdent)
- | 132, [_] => .v37 (.falseIdent)
- | 133, [.v37 value] => .v37 (value)
- | 134, [.v37 value] => .v37 (value)
- | 135, [] => .v38 (#[])
- | 136, [.v38 xs, .v2 x] => .v38 (xs.push x)
- | 137, [] => .v39 (#[])
- | 138, [.v39 xs, .v1 x] => .v39 (xs.push x)
- | 139, [] => .v40 (#[])
- | 140, [.v40 xs, .v8 x] => .v40 (xs.push x)
- | 141, [] => .v41 (#[])
- | 142, [.v41 xs, .v25 x] => .v41 (xs.push x)
- | 143, [x, _] => x
- | _, _ => .unit ()
-
-def sem (p : Nat) (args : List VP) : VP :=
- (semS p args, semV p (args.map Prod.snd))
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v38 ps] => .v0 (Policies.mk ps.toList)
+ | 1, _, [_, .v37 key] => .v1 (Annotation.mk key none)
+ | 2, _, [_, .v37 key, _, .v36 value, _] => .v1 (Annotation.mk key (some value))
+ | 3, _, [.v39 annotations, .v37 effect, _, .v3 variables, _, .v40 conds, _] => .v2 (Policy.policy (PolicyImpl.mk annotations.toList effect variables conds.toList))
+ | 4, _, [] => .v3 ([])
+ | 5, _, [.v4 v, .v3 rest] => .v3 (v :: rest)
+ | 6, _, [] => .v3 ([])
+ | 7, _, [_] => .v3 ([])
+ | 8, _, [_, .v4 v, .v3 rest] => .v3 (v :: rest)
+ | 9, _, [.v37 varName, .v5 unused, .v6 entity, .v7 ineq] => .v4 (VariableDef.mk varName unused entity ineq)
+ | 10, _, [] => .v5 (none)
+ | 11, _, [_, .v31 name] => .v5 (some name)
+ | 12, _, [] => .v6 (none)
+ | 13, _, [_, .v19 entity] => .v6 (some entity)
+ | 14, _, [] => .v7 (none)
+ | 15, _, [.v16 op, .v9 expression] => .v7 (some (op, expression))
+ | 16, _, [.v37 kind, _, .v9 expression, _] => .v8 (Cond.mk kind expression)
+ | 17, _, [.v10 value] => .v9 (Expr.expr (ExprImpl.mk (ExprData.or value)))
+ | 18, _, [_, .v9 condition, _, .v9 thenExpr, _, .v9 elseExpr] => .v9 (Expr.expr (ExprImpl.mk (ExprData.ifThenElse condition thenExpr elseExpr)))
+ | 19, _, [.v12 initial, .v11 extended] => .v10 (Or.mk initial extended)
+ | 20, _, [] => .v11 ([])
+ | 21, _, [_, .v12 next, .v11 rest] => .v11 (next :: rest)
+ | 22, _, [.v14 initial, .v13 extended] => .v12 (And.mk initial extended)
+ | 23, _, [] => .v13 ([])
+ | 24, _, [_, .v14 next, .v13 rest] => .v13 (next :: rest)
+ | 25, _, [.v19 target, _, .v19 field] => .v14 (Relation.has target field)
+ | 26, _, [.v19 target, _, _, .v41 access] => .v14 (Relation.has target (Cedar.Add.fromIdent .ifIdent access.toList))
+ | 27, _, [.v19 target, _, .v19 pattern] => .v14 (Relation.like target pattern)
+ | 28, _, [.v19 target, _, .v19 entityType, .v6 inEntity] => .v14 (Relation.isIn target entityType inEntity)
+ | 29, _, [.v19 initial, .v15 extended] => .v14 (Relation.common initial extended)
+ | 30, _, [] => .v15 ([])
+ | 31, _, [.v16 op, .v19 next, .v15 rest] => .v15 ((op, next) :: rest)
+ | 32, _, [] => .v6 (none)
+ | 33, _, [_, .v19 entity] => .v6 (some entity)
+ | 34, _, [_] => .v16 (.less)
+ | 35, _, [_] => .v16 (.lessEq)
+ | 36, _, [_] => .v16 (.greaterEq)
+ | 37, _, [_] => .v16 (.greater)
+ | 38, _, [_] => .v16 (.notEq)
+ | 39, _, [_] => .v16 (.eq)
+ | 40, _, [_] => .v16 (.inOp)
+ | 41, _, [_] => .v16 (.invalidSingleEq)
+ | 42, _, [_] => .v17 (.plus)
+ | 43, _, [_] => .v17 (.minus)
+ | 44, _, [_] => .v18 (.times)
+ | 45, _, [_] => .v18 (.divide)
+ | 46, _, [_] => .v18 (.mod)
+ | 47, _, [.v21 initial, .v20 extended] => .v19 (Cedar.Add.mk initial extended)
+ | 48, _, [] => .v20 ([])
+ | 49, _, [.v17 op, .v21 next, .v20 rest] => .v20 ((op, next) :: rest)
+ | 50, _, [.v23 initial, .v22 extended] => .v21 (Mult.mk initial extended)
+ | 51, _, [] => .v22 ([])
+ | 52, _, [.v18 op, .v23 next, .v22 rest] => .v22 ((op, next) :: rest)
+ | 53, _, [.v24 item] => .v23 (Unary.mk none item)
+ | 54, _, [_, .v24 item] => .v23 (Unary.mk (some (.bang 1)) item)
+ | 55, _, [_, _, .v24 item] => .v23 (Unary.mk (some (.bang 2)) item)
+ | 56, _, [_, _, _, .v24 item] => .v23 (Unary.mk (some (.bang 3)) item)
+ | 57, _, [_, _, _, _, .v24 item] => .v23 (Unary.mk (some (.bang 4)) item)
+ | 58, _, [_, _, _, _, .unit _bang, .v24 item] => .v23 (Unary.mk (some .overBang) item)
+ | 59, _, [_, .v24 item] => .v23 (Unary.mk (some (.dash 1)) item)
+ | 60, _, [_, _, .v24 item] => .v23 (Unary.mk (some (.dash 2)) item)
+ | 61, _, [_, _, _, .v24 item] => .v23 (Unary.mk (some (.dash 3)) item)
+ | 62, _, [_, _, _, _, .v24 item] => .v23 (Unary.mk (some (.dash 4)) item)
+ | 63, _, [_, _, _, _, .unit _dash, .v24 item] => .v23 (Unary.mk (some .overDash) item)
+ | 64, _, [_] => .unit (())
+ | 65, _, [_, .unit _rest] => .unit (())
+ | 66, _, [_] => .unit (())
+ | 67, _, [_, .unit _rest] => .unit (())
+ | 68, _, [.v26 item, .v41 access] => .v24 (Member.mk item access.toList)
+ | 69, _, [_, .v37 field] => .v25 (MemAccess.field field)
+ | 70, _, [_, .v27 args, _] => .v25 (MemAccess.call args)
+ | 71, _, [_, .v9 index, _] => .v25 (MemAccess.index index)
+ | 72, _, [.v35 literal] => .v26 (Primary.literal literal)
+ | 73, _, [.v26 value] => .v26 (value)
+ | 74, _, [_] => .v26 (Primary.slot .principal)
+ | 75, _, [_] => .v26 (Primary.slot .resource)
+ | 76, _, [.v42 slot] => .v26 (Primary.slot (.other slot))
+ | 77, _, [_, .v9 expression, _] => .v26 (Primary.expr expression)
+ | 78, _, [_, .v27 elements, _] => .v26 (Primary.exprList elements)
+ | 79, _, [_, .v28 fields, _] => .v26 (Primary.record fields)
+ | 80, _, [] => .v27 ([])
+ | 81, _, [.v9 expression, .v27 rest] => .v27 (expression :: rest)
+ | 82, _, [] => .v27 ([])
+ | 83, _, [_] => .v27 ([])
+ | 84, _, [_, .v9 expression, .v27 rest] => .v27 (expression :: rest)
+ | 85, _, [] => .v28 ([])
+ | 86, _, [.v29 init, .v28 rest] => .v28 (init :: rest)
+ | 87, _, [] => .v28 ([])
+ | 88, _, [_] => .v28 ([])
+ | 89, _, [_, .v29 init, .v28 rest] => .v28 (init :: rest)
+ | 90, _, [_, _, .v9 value] => .v29 (RecInit.mk (Expr.fromIdent .ifIdent) value)
+ | 91, _, [.v9 key, _, .v9 value] => .v29 (RecInit.mk key value)
+ | 92, _, [.v37 first] => .v26 (Primary.name (Name.mk [] first))
+ | 93, _, [.v37 first, _, .v30 tail] => .v26 (tail [first])
+ | 94, _, [.v37 first, _, .v37 last] => .v26 (Primary.name (Name.mk [first] last))
+ | 95, _, [.v37 first, _, .v37 next, _, .v30 tail] => .v26 (tail [first, next])
+ | 96, _, [.v37 last] => .v30 (fun path => Primary.name (Name.mk path last))
+ | 97, _, [.v36 eid] => .v30 (fun components => Primary.ref (Ref.uid (Name.fromComponents components) eid))
+ | 98, _, [_, .v33 fields, _] => .v30 (fun components => Primary.ref (Ref.ref (Name.fromComponents components) fields))
+ | 99, _, [.v37 next, _, .v30 tail] => .v30 (fun path => tail (path ++ [next]))
+ | 100, _, [.v37 name] => .v31 (Name.mk [] name)
+ | 101, _, [.v37 first, _, .v32 tail] => .v31 (Name.mk (first :: tail.1) tail.2)
+ | 102, _, [.v37 last] => .v32 (([], last))
+ | 103, _, [.v37 next, _, .v32 tail] => .v32 ((next :: tail.1, tail.2))
+ | 104, _, [] => .v33 ([])
+ | 105, _, [.v34 init, .v33 rest] => .v33 (init :: rest)
+ | 106, _, [] => .v33 ([])
+ | 107, _, [_] => .v33 ([])
+ | 108, _, [_, .v34 init, .v33 rest] => .v33 (init :: rest)
+ | 109, _, [.v37 field, _, .v35 value] => .v34 (RefInit.mk field value)
+ | 110, _, [_] => .v35 (.trueLit)
+ | 111, _, [_] => .v35 (.falseLit)
+ | 112, _, [.v44 number] => .v35 (.num number)
+ | 113, _, [.v36 value] => .v35 (.str value)
+ | 114, _, [.v42 value] => .v36 (.string value)
+ | 115, _, [_] => .v37 (.principal)
+ | 116, _, [_] => .v37 (.action)
+ | 117, _, [_] => .v37 (.resource)
+ | 118, _, [_] => .v37 (.context)
+ | 119, _, [_] => .v37 (.permit)
+ | 120, _, [_] => .v37 (.forbid)
+ | 121, _, [_] => .v37 (.when)
+ | 122, _, [_] => .v37 (.unless)
+ | 123, _, [_] => .v37 (.inIdent)
+ | 124, _, [_] => .v37 (.has)
+ | 125, _, [_] => .v37 (.like)
+ | 126, _, [_] => .v37 (.is)
+ | 127, _, [_] => .v37 (.thenIdent)
+ | 128, _, [_] => .v37 (.elseIdent)
+ | 129, _, [.v43 value] => .v37 (.ident value)
+ | 130, _, [_] => .v37 (.ifIdent)
+ | 131, _, [_] => .v37 (.trueIdent)
+ | 132, _, [_] => .v37 (.falseIdent)
+ | 133, _, [.v37 value] => .v37 (value)
+ | 134, _, [.v37 value] => .v37 (value)
+ | 135, _, [] => .v38 (#[])
+ | 136, _, [.v38 xs, .v2 x] => .v38 (xs.push x)
+ | 137, _, [] => .v39 (#[])
+ | 138, _, [.v39 xs, .v1 x] => .v39 (xs.push x)
+ | 139, _, [] => .v40 (#[])
+ | 140, _, [.v40 xs, .v8 x] => .v40 (xs.push x)
+ | 141, _, [] => .v41 (#[])
+ | 142, _, [.v41 xs, .v25 x] => .v41 (xs.push x)
+ | 143, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
def buildDense {α : Type} (n : Nat) (dflt : α) (cells : Array (Nat × α)) : Array α := Id.run do
let mut a : Array α := Array.replicate n dflt
@@ -701,6 +554,114 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c43 st _ _ _ _ => st
| .c44 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+ | .c7 _ _ e _ _ => e
+ | .c8 _ _ e _ _ => e
+ | .c9 _ _ e _ _ => e
+ | .c10 _ _ e _ _ => e
+ | .c11 _ _ e _ _ => e
+ | .c12 _ _ e _ _ => e
+ | .c13 _ _ e _ _ => e
+ | .c14 _ _ e _ _ => e
+ | .c15 _ _ e _ _ => e
+ | .c16 _ _ e _ _ => e
+ | .c17 _ _ e _ _ => e
+ | .c18 _ _ e _ _ => e
+ | .c19 _ _ e _ _ => e
+ | .c20 _ _ e _ _ => e
+ | .c21 _ _ e _ _ => e
+ | .c22 _ _ e _ _ => e
+ | .c23 _ _ e _ _ => e
+ | .c24 _ _ e _ _ => e
+ | .c25 _ _ e _ _ => e
+ | .c26 _ _ e _ _ => e
+ | .c27 _ _ e _ _ => e
+ | .c28 _ _ e _ _ => e
+ | .c29 _ _ e _ _ => e
+ | .c30 _ _ e _ _ => e
+ | .c31 _ _ e _ _ => e
+ | .c32 _ _ e _ _ => e
+ | .c33 _ _ e _ _ => e
+ | .c34 _ _ e _ _ => e
+ | .c35 _ _ e _ _ => e
+ | .c36 _ _ e _ _ => e
+ | .c37 _ _ e _ _ => e
+ | .c38 _ _ e _ _ => e
+ | .c39 _ _ e _ _ => e
+ | .c40 _ _ e _ _ => e
+ | .c41 _ _ e _ _ => e
+ | .c42 _ _ e _ _ => e
+ | .c43 _ _ e _ _ => e
+ | .c44 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+ | .c7 st _ e _ _ => k st e
+ | .c8 st _ e _ _ => k st e
+ | .c9 st _ e _ _ => k st e
+ | .c10 st _ e _ _ => k st e
+ | .c11 st _ e _ _ => k st e
+ | .c12 st _ e _ _ => k st e
+ | .c13 st _ e _ _ => k st e
+ | .c14 st _ e _ _ => k st e
+ | .c15 st _ e _ _ => k st e
+ | .c16 st _ e _ _ => k st e
+ | .c17 st _ e _ _ => k st e
+ | .c18 st _ e _ _ => k st e
+ | .c19 st _ e _ _ => k st e
+ | .c20 st _ e _ _ => k st e
+ | .c21 st _ e _ _ => k st e
+ | .c22 st _ e _ _ => k st e
+ | .c23 st _ e _ _ => k st e
+ | .c24 st _ e _ _ => k st e
+ | .c25 st _ e _ _ => k st e
+ | .c26 st _ e _ _ => k st e
+ | .c27 st _ e _ _ => k st e
+ | .c28 st _ e _ _ => k st e
+ | .c29 st _ e _ _ => k st e
+ | .c30 st _ e _ _ => k st e
+ | .c31 st _ e _ _ => k st e
+ | .c32 st _ e _ _ => k st e
+ | .c33 st _ e _ _ => k st e
+ | .c34 st _ e _ _ => k st e
+ | .c35 st _ e _ _ => k st e
+ | .c36 st _ e _ _ => k st e
+ | .c37 st _ e _ _ => k st e
+ | .c38 st _ e _ _ => k st e
+ | .c39 st _ e _ _ => k st e
+ | .c40 st _ e _ _ => k st e
+ | .c41 st _ e _ _ => k st e
+ | .c42 st _ e _ _ => k st e
+ | .c43 st _ e _ _ => k st e
+ | .c44 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -824,6 +785,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionCells : Array (Nat × Runtime.Exec.Act) :=
#[(0, .reduce 135), (1, .reduce 135), (2, .reduce 135), (3, .reduce 135), (4, .reduce 135), (5, .reduce 135),
@@ -1841,7 +1803,7 @@ def fuse3 : Stk → Stk :=
| _ => .fail stk
def fuse4 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 3 (Stk.top 0 __tail) (fun __st => .c3 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 3 __top (fun __st => .c3 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse5 : Stk → Stk :=
fun stk => match stk with
@@ -1849,7 +1811,7 @@ def fuse5 : Stk → Stk :=
| _ => .fail stk
def fuse6 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 4 (Stk.top 0 __tail) (fun __st => .c3 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 4 __top (fun __st => .c3 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse7 : Stk → Stk :=
fun stk => match stk with
@@ -1867,7 +1829,7 @@ def fuse9 : Stk → Stk :=
| _ => .fail stk
def fuse10 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 6 (Stk.top 0 __tail) (fun __st => .c5 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 6 __top (fun __st => .c5 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse11 : Stk → Stk :=
fun stk => match stk with
@@ -1875,7 +1837,7 @@ def fuse11 : Stk → Stk :=
| _ => .fail stk
def fuse12 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 7 (Stk.top 0 __tail) (fun __st => .c6 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 7 __top (fun __st => .c6 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse13 : Stk → Stk :=
fun stk => match stk with
@@ -1883,7 +1845,7 @@ def fuse13 : Stk → Stk :=
| _ => .fail stk
def fuse14 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 8 (Stk.top 0 __tail) (fun __st => .c7 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 8 __top (fun __st => .c7 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse15 : Stk → Stk :=
fun stk => match stk with
@@ -1911,7 +1873,7 @@ def fuse19 : Stk → Stk :=
| _ => .fail stk
def fuse20 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 12 (Stk.top 0 __tail) (fun __st => .c11 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 12 __top (fun __st => .c11 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse21 : Stk → Stk :=
fun stk => match stk with
@@ -1924,7 +1886,7 @@ def fuse22 : Stk → Stk :=
| _ => .fail stk
def fuse23 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 14 (Stk.top 0 __tail) (fun __st => .c13 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 14 __top (fun __st => .c13 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse24 : Stk → Stk :=
fun stk => match stk with
@@ -1957,7 +1919,7 @@ def fuse29 : Stk → Stk :=
| _ => .fail stk
def fuse30 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 16 (Stk.top 0 __tail) (fun __st => .c15 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 16 __top (fun __st => .c15 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse31 : Stk → Stk :=
fun stk => match stk with
@@ -1965,7 +1927,7 @@ def fuse31 : Stk → Stk :=
| _ => .fail stk
def fuse32 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 17 (Stk.top 0 __tail) (fun __st => .c6 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 17 __top (fun __st => .c6 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse33 : Stk → Stk :=
fun stk => match stk with
@@ -2043,7 +2005,7 @@ def fuse47 : Stk → Stk :=
| _ => .fail stk
def fuse48 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 22 (Stk.top 0 __tail) (fun __st => .c20 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 22 __top (fun __st => .c20 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse49 : Stk → Stk :=
fun stk => match stk with
@@ -2056,7 +2018,7 @@ def fuse50 : Stk → Stk :=
| _ => .fail stk
def fuse51 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 24 (Stk.top 0 __tail) (fun __st => .c22 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 24 __top (fun __st => .c22 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse52 : Stk → Stk :=
fun stk => match stk with
@@ -2199,7 +2161,7 @@ def fuse79 : Stk → Stk :=
| _ => .fail stk
def fuse80 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 31 (Stk.top 0 __tail) (fun __st => .c27 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 31 __top (fun __st => .c27 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse81 : Stk → Stk :=
fun stk => match stk with
@@ -2207,7 +2169,7 @@ def fuse81 : Stk → Stk :=
| _ => .fail stk
def fuse82 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 32 (Stk.top 0 __tail) (fun __st => .c27 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 32 __top (fun __st => .c27 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse83 : Stk → Stk :=
fun stk => match stk with
@@ -2220,7 +2182,7 @@ def fuse84 : Stk → Stk :=
| _ => .fail stk
def fuse85 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 33 (Stk.top 0 __tail) (fun __st => .c28 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 33 __top (fun __st => .c28 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse86 : Stk → Stk :=
fun stk => match stk with
@@ -2228,7 +2190,7 @@ def fuse86 : Stk → Stk :=
| _ => .fail stk
def fuse87 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 34 (Stk.top 0 __tail) (fun __st => .c28 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 34 __top (fun __st => .c28 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse88 : Stk → Stk :=
fun stk => match stk with
@@ -2311,7 +2273,7 @@ def fuse103 : Stk → Stk :=
| _ => .fail stk
def fuse104 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 40 (Stk.top 0 __tail) (fun __st => .c33 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 40 __top (fun __st => .c33 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse105 : Stk → Stk :=
fun stk => match stk with
@@ -2319,7 +2281,7 @@ def fuse105 : Stk → Stk :=
| _ => .fail stk
def fuse106 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 41 (Stk.top 0 __tail) (fun __st => .c33 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 41 __top (fun __st => .c33 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse107 : Stk → Stk :=
fun stk => match stk with
@@ -2462,7 +2424,7 @@ def fuse134 : Stk → Stk :=
| _ => .fail stk
def fuse135 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 48 (Stk.top 0 __tail) (fun __st => .c38 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 48 __top (fun __st => .c38 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse136 : Stk → Stk :=
fun stk => match stk with
@@ -2470,7 +2432,7 @@ def fuse136 : Stk → Stk :=
| _ => .fail stk
def fuse137 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 49 (Stk.top 0 __tail) (fun __st => .c39 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 49 __top (fun __st => .c39 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse138 : Stk → Stk :=
fun stk => match stk with
@@ -2478,7 +2440,7 @@ def fuse138 : Stk → Stk :=
| _ => .fail stk
def fuse139 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 50 (Stk.top 0 __tail) (fun __st => .c40 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 50 __top (fun __st => .c40 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse140 : Stk → Stk :=
fun stk => match stk with
@@ -2486,7 +2448,7 @@ def fuse140 : Stk → Stk :=
| _ => .fail stk
def fuse141 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 53 51 (Stk.top 0 __tail) (fun __st => .c41 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 53 51 __top (fun __st => .c41 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse142 : Stk → Stk :=
fun stk => match stk with
@@ -2521,6 +2483,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -2560,9 +2523,9 @@ theorem fuseOK3 : Runtime.Exec.FuseOKAt stackOps flat 3 fuse3 := by
theorem fuseOK4 : Runtime.Exec.FuseOKAt stackOps flat 4 fuse4 := by
intro stk
- unfold fuse4
+ simp only [fuse4, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 4
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 4
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK5 : Runtime.Exec.FuseOKAt stackOps flat 5 fuse5 := by
@@ -2576,9 +2539,9 @@ theorem fuseOK5 : Runtime.Exec.FuseOKAt stackOps flat 5 fuse5 := by
theorem fuseOK6 : Runtime.Exec.FuseOKAt stackOps flat 6 fuse6 := by
intro stk
- unfold fuse6
+ simp only [fuse6, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 6
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 6
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK7 : Runtime.Exec.FuseOKAt stackOps flat 7 fuse7 := by
@@ -2610,9 +2573,9 @@ theorem fuseOK9 : Runtime.Exec.FuseOKAt stackOps flat 9 fuse9 := by
theorem fuseOK10 : Runtime.Exec.FuseOKAt stackOps flat 10 fuse10 := by
intro stk
- unfold fuse10
+ simp only [fuse10, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 10
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 10
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK11 : Runtime.Exec.FuseOKAt stackOps flat 11 fuse11 := by
@@ -2626,9 +2589,9 @@ theorem fuseOK11 : Runtime.Exec.FuseOKAt stackOps flat 11 fuse11 := by
theorem fuseOK12 : Runtime.Exec.FuseOKAt stackOps flat 12 fuse12 := by
intro stk
- unfold fuse12
+ simp only [fuse12, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 12
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 12
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK13 : Runtime.Exec.FuseOKAt stackOps flat 13 fuse13 := by
@@ -2642,9 +2605,9 @@ theorem fuseOK13 : Runtime.Exec.FuseOKAt stackOps flat 13 fuse13 := by
theorem fuseOK14 : Runtime.Exec.FuseOKAt stackOps flat 14 fuse14 := by
intro stk
- unfold fuse14
+ simp only [fuse14, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 14
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 14
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK15 : Runtime.Exec.FuseOKAt stackOps flat 15 fuse15 := by
@@ -2694,9 +2657,9 @@ theorem fuseOK19 : Runtime.Exec.FuseOKAt stackOps flat 19 fuse19 := by
theorem fuseOK20 : Runtime.Exec.FuseOKAt stackOps flat 20 fuse20 := by
intro stk
- unfold fuse20
+ simp only [fuse20, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 20
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 20
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK21 : Runtime.Exec.FuseOKAt stackOps flat 21 fuse21 := by
@@ -2719,9 +2682,9 @@ theorem fuseOK22 : Runtime.Exec.FuseOKAt stackOps flat 22 fuse22 := by
theorem fuseOK23 : Runtime.Exec.FuseOKAt stackOps flat 23 fuse23 := by
intro stk
- unfold fuse23
+ simp only [fuse23, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 23
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 23
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK24 : Runtime.Exec.FuseOKAt stackOps flat 24 fuse24 := by
@@ -2780,9 +2743,9 @@ theorem fuseOK29 : Runtime.Exec.FuseOKAt stackOps flat 29 fuse29 := by
theorem fuseOK30 : Runtime.Exec.FuseOKAt stackOps flat 30 fuse30 := by
intro stk
- unfold fuse30
+ simp only [fuse30, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 30
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 30
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK31 : Runtime.Exec.FuseOKAt stackOps flat 31 fuse31 := by
@@ -2796,9 +2759,9 @@ theorem fuseOK31 : Runtime.Exec.FuseOKAt stackOps flat 31 fuse31 := by
theorem fuseOK32 : Runtime.Exec.FuseOKAt stackOps flat 32 fuse32 := by
intro stk
- unfold fuse32
+ simp only [fuse32, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 32
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 32
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK33 : Runtime.Exec.FuseOKAt stackOps flat 33 fuse33 := by
@@ -2938,9 +2901,9 @@ theorem fuseOK47 : Runtime.Exec.FuseOKAt stackOps flat 47 fuse47 := by
theorem fuseOK48 : Runtime.Exec.FuseOKAt stackOps flat 48 fuse48 := by
intro stk
- unfold fuse48
+ simp only [fuse48, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 48
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 48
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK49 : Runtime.Exec.FuseOKAt stackOps flat 49 fuse49 := by
@@ -2963,9 +2926,9 @@ theorem fuseOK50 : Runtime.Exec.FuseOKAt stackOps flat 50 fuse50 := by
theorem fuseOK51 : Runtime.Exec.FuseOKAt stackOps flat 51 fuse51 := by
intro stk
- unfold fuse51
+ simp only [fuse51, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 51
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 51
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK52 : Runtime.Exec.FuseOKAt stackOps flat 52 fuse52 := by
@@ -3222,9 +3185,9 @@ theorem fuseOK79 : Runtime.Exec.FuseOKAt stackOps flat 79 fuse79 := by
theorem fuseOK80 : Runtime.Exec.FuseOKAt stackOps flat 80 fuse80 := by
intro stk
- unfold fuse80
+ simp only [fuse80, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 80
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 80
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK81 : Runtime.Exec.FuseOKAt stackOps flat 81 fuse81 := by
@@ -3238,9 +3201,9 @@ theorem fuseOK81 : Runtime.Exec.FuseOKAt stackOps flat 81 fuse81 := by
theorem fuseOK82 : Runtime.Exec.FuseOKAt stackOps flat 82 fuse82 := by
intro stk
- unfold fuse82
+ simp only [fuse82, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 82
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 82
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK83 : Runtime.Exec.FuseOKAt stackOps flat 83 fuse83 := by
@@ -3263,9 +3226,9 @@ theorem fuseOK84 : Runtime.Exec.FuseOKAt stackOps flat 84 fuse84 := by
theorem fuseOK85 : Runtime.Exec.FuseOKAt stackOps flat 85 fuse85 := by
intro stk
- unfold fuse85
+ simp only [fuse85, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 85
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 85
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK86 : Runtime.Exec.FuseOKAt stackOps flat 86 fuse86 := by
@@ -3279,9 +3242,9 @@ theorem fuseOK86 : Runtime.Exec.FuseOKAt stackOps flat 86 fuse86 := by
theorem fuseOK87 : Runtime.Exec.FuseOKAt stackOps flat 87 fuse87 := by
intro stk
- unfold fuse87
+ simp only [fuse87, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 87
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 87
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK88 : Runtime.Exec.FuseOKAt stackOps flat 88 fuse88 := by
@@ -3430,9 +3393,9 @@ theorem fuseOK103 : Runtime.Exec.FuseOKAt stackOps flat 103 fuse103 := by
theorem fuseOK104 : Runtime.Exec.FuseOKAt stackOps flat 104 fuse104 := by
intro stk
- unfold fuse104
+ simp only [fuse104, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 104
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 104
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK105 : Runtime.Exec.FuseOKAt stackOps flat 105 fuse105 := by
@@ -3446,9 +3409,9 @@ theorem fuseOK105 : Runtime.Exec.FuseOKAt stackOps flat 105 fuse105 := by
theorem fuseOK106 : Runtime.Exec.FuseOKAt stackOps flat 106 fuse106 := by
intro stk
- unfold fuse106
+ simp only [fuse106, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 106
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 106
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK107 : Runtime.Exec.FuseOKAt stackOps flat 107 fuse107 := by
@@ -3705,9 +3668,9 @@ theorem fuseOK134 : Runtime.Exec.FuseOKAt stackOps flat 134 fuse134 := by
theorem fuseOK135 : Runtime.Exec.FuseOKAt stackOps flat 135 fuse135 := by
intro stk
- unfold fuse135
+ simp only [fuse135, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 135
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 135
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK136 : Runtime.Exec.FuseOKAt stackOps flat 136 fuse136 := by
@@ -3721,9 +3684,9 @@ theorem fuseOK136 : Runtime.Exec.FuseOKAt stackOps flat 136 fuse136 := by
theorem fuseOK137 : Runtime.Exec.FuseOKAt stackOps flat 137 fuse137 := by
intro stk
- unfold fuse137
+ simp only [fuse137, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 137
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 137
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK138 : Runtime.Exec.FuseOKAt stackOps flat 138 fuse138 := by
@@ -3737,9 +3700,9 @@ theorem fuseOK138 : Runtime.Exec.FuseOKAt stackOps flat 138 fuse138 := by
theorem fuseOK139 : Runtime.Exec.FuseOKAt stackOps flat 139 fuse139 := by
intro stk
- unfold fuse139
+ simp only [fuse139, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 139
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 139
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK140 : Runtime.Exec.FuseOKAt stackOps flat 140 fuse140 := by
@@ -3753,9 +3716,9 @@ theorem fuseOK140 : Runtime.Exec.FuseOKAt stackOps flat 140 fuse140 := by
theorem fuseOK141 : Runtime.Exec.FuseOKAt stackOps flat 141 fuse141 := by
intro stk
- unfold fuse141
+ simp only [fuse141, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 141
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 141
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK142 : Runtime.Exec.FuseOKAt stackOps flat 142 fuse142 := by
@@ -3830,19 +3793,6 @@ theorem parseStr_total (input : String) (k : Nat) :
· left; rw [h]
· right; rw [h]
-theorem semSpanFree : Runtime.Exec.SemSpanFree sem :=
- Runtime.Exec.SemSpanFree.of_split semS semV
-
-theorem parse_spanIndependent : Runtime.Exec.SpanIndependent (fun ts k => parse ts k) :=
- Runtime.Exec.SpanIndependent.of_run flat.toExecTable semSpanFree termOf valOf
- (fun r => match r with | .ok (.v0 x) => some x | _ => none) (by
- intro ts k
- unfold parse run
- rw [Runtime.Exec.runFast_eq_run stackOps flat fuse termOf valOf stackLawful fuseOK]
- cases Runtime.Exec.run flat.toExecTable (ts.map (Runtime.Exec.decodeWith termOf valOf)) k with
- | ok v => obtain ⟨_, v⟩ := v; cases v <;> rfl
- | _ => rfl)
-
/-- The readable name of a terminal index (EOF is "end of input"). -/
def terminalName : Nat → String
| 0 => "TRUE"
diff --git a/test/cedar/CedarParserRoundtrip.lean b/test/cedar/CedarParserRoundtrip.lean
index fe5744c..224fb32 100644
--- a/test/cedar/CedarParserRoundtrip.lean
+++ b/test/cedar/CedarParserRoundtrip.lean
@@ -26,10 +26,11 @@ namespace CedarParserRoundtrip
open Lexer Runtime CedarUnparse
/-- A parse tree certifying that `tokens` parse to `value`. The start tree
- includes the explicit EOF required by the augmented grammar. -/
+ includes the explicit EOF required by the augmented grammar. Its tokens carry
+ the dummy span, as the token generator produces no positions. -/
structure Certificate (tokens : List Tok) (value : Policies) where
- tree : CedarVerified.ParserStartTree (tokens ++ [Tok.EOF])
- semantics : Runtime.Grammar.ptSem tree = value
+ tree : CedarVerified.ParserStartTree ((tokens ++ [Tok.EOF]).map Positioned.dummy)
+ semantics : Runtime.SpanGrammar.ptSem ⟨0⟩ tree = value
/-- Sufficient logarithmic fuel computed from the certified tree. -/
def Certificate.logFuel {tokens : List Tok} {value : Policies}
diff --git a/test/cedar/CedarParserRoundtripProof.lean b/test/cedar/CedarParserRoundtripProof.lean
index 4b44d56..6cdcb7b 100644
--- a/test/cedar/CedarParserRoundtripProof.lean
+++ b/test/cedar/CedarParserRoundtripProof.lean
@@ -31,13 +31,13 @@ open Cedar CedarPrintable Runtime Runtime.Grammar
noncomputable def effectTree : (effect : PrintableEffect) →
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨47, by omega⟩ : CedarVerified.NonTerminal)) [effect.token]
+ (.NT (⟨47, by omega⟩ : CedarVerified.NonTerminal)) (([effect.token]).map Positioned.dummy)
| .permit => CedarVerified.parseTreeProduction133 CedarVerified.parseTreeProduction119
| .forbid => CedarVerified.parseTreeProduction133 CedarVerified.parseTreeProduction120
noncomputable def variableIdentTree : (v : PrintableVar) →
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨47, by omega⟩ : CedarVerified.NonTerminal)) [v.token]
+ (.NT (⟨47, by omega⟩ : CedarVerified.NonTerminal)) (([v.token]).map Positioned.dummy)
| .principal => CedarVerified.parseTreeProduction133 CedarVerified.parseTreeProduction115
| .action => CedarVerified.parseTreeProduction133 CedarVerified.parseTreeProduction116
| .resource => CedarVerified.parseTreeProduction133 CedarVerified.parseTreeProduction117
@@ -45,7 +45,7 @@ noncomputable def variableIdentTree : (v : PrintableVar) →
noncomputable def variableTree (v : PrintableVar) :
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨5, by omega⟩ : CedarVerified.NonTerminal)) [v.token] :=
+ (.NT (⟨5, by omega⟩ : CedarVerified.NonTerminal)) (([v.token]).map Positioned.dummy) :=
CedarVerified.parseTreeProduction9 (variableIdentTree v)
CedarVerified.parseTreeProduction10 CedarVerified.parseTreeProduction12
CedarVerified.parseTreeProduction14
@@ -54,14 +54,14 @@ mutual
noncomputable def variablesTree : (variables : List PrintableVar) →
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨3, by omega⟩ : CedarVerified.NonTerminal)) (unparseVariables variables)
+ (.NT (⟨3, by omega⟩ : CedarVerified.NonTerminal)) ((unparseVariables variables).map Positioned.dummy)
| [] => CedarVerified.parseTreeProduction4
| v :: rest =>
CedarVerified.parseTreeProduction5 (variableTree v) (variableTailTree rest)
noncomputable def variableTailTree : (variables : List PrintableVar) →
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨4, by omega⟩ : CedarVerified.NonTerminal)) (unparseVariableTail variables)
+ (.NT (⟨4, by omega⟩ : CedarVerified.NonTerminal)) ((unparseVariableTail variables).map Positioned.dummy)
| [] => CedarVerified.parseTreeProduction6
| v :: rest =>
CedarVerified.parseTreeProduction8 (variableTree v) (variableTailTree rest)
@@ -70,7 +70,7 @@ end
noncomputable def policyTree (policy : PrintablePolicy) :
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨2, by omega⟩ : CedarVerified.NonTerminal)) (unparsePolicy policy) :=
+ (.NT (⟨2, by omega⟩ : CedarVerified.NonTerminal)) ((unparsePolicy policy).map Positioned.dummy) :=
CedarVerified.parseTreeProduction3 CedarVerified.parseTreeProduction137
(effectTree policy.effect) (variablesTree policy.variables)
CedarVerified.parseTreeProduction139
@@ -87,14 +87,14 @@ theorem unparsePolicyList_snoc (ps : List PrintablePolicy) (p : PrintablePolicy)
/-- Rewrite the word index of a parse tree. -/
noncomputable def castWord {head : CedarVerified.grammarInst.Sym} {w w' : List Tok} (h : w = w')
- (t : ParseTree (G := CedarVerified.grammarInst) head w) :
- ParseTree (G := CedarVerified.grammarInst) head w' := h ▸ t
+ (t : ParseTree (G := CedarVerified.grammarInst) head (w.map Positioned.dummy)) :
+ ParseTree (G := CedarVerified.grammarInst) head (w'.map Positioned.dummy) := h ▸ t
/-- The policy list is left-recursive (`xs x`), so its tree is built from the last policy:
`policyListTreeRev rs` is the tree of `rs.reverse`. -/
noncomputable def policyListTreeRev : (rev : List PrintablePolicy) →
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨48, by omega⟩ : CedarVerified.NonTerminal)) (unparsePolicyList rev.reverse)
+ (.NT (⟨48, by omega⟩ : CedarVerified.NonTerminal)) ((unparsePolicyList rev.reverse).map Positioned.dummy)
| [] => CedarVerified.parseTreeProduction135
| policy :: rest =>
castWord (by rw [List.reverse_cons]; exact unparsePolicyList_snoc rest.reverse policy)
@@ -102,16 +102,16 @@ noncomputable def policyListTreeRev : (rev : List PrintablePolicy) →
noncomputable def policyListTree (policies : List PrintablePolicy) :
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨48, by omega⟩ : CedarVerified.NonTerminal)) (unparsePolicyList policies) :=
+ (.NT (⟨48, by omega⟩ : CedarVerified.NonTerminal)) ((unparsePolicyList policies).map Positioned.dummy) :=
castWord (by rw [List.reverse_reverse]) (policyListTreeRev policies.reverse)
noncomputable def policiesTree (policies : PrintablePolicies) :
ParseTree (G := CedarVerified.grammarInst)
- (.NT (⟨0, by omega⟩ : CedarVerified.NonTerminal)) (unparsePolicies policies) :=
+ (.NT (⟨0, by omega⟩ : CedarVerified.NonTerminal)) ((unparsePolicies policies).map Positioned.dummy) :=
CedarVerified.parseTreeProduction0 (policyListTree policies.policies)
-theorem effectTree_sem (effect : PrintableEffect) :
- ptSem (effectTree effect) = effect.toIdent := by
+theorem effectTree_sem (effect : PrintableEffect) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (effectTree effect) = effect.toIdent := by
cases effect with
| permit =>
erw [CedarVerified.parseTreeProduction133_sem,
@@ -122,8 +122,8 @@ theorem effectTree_sem (effect : PrintableEffect) :
CedarVerified.parseTreeProduction120_sem]
rfl
-theorem variableIdentTree_sem (v : PrintableVar) :
- ptSem (variableIdentTree v) = v.toIdent := by
+theorem variableIdentTree_sem (v : PrintableVar) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (variableIdentTree v) = v.toIdent := by
cases v <;>
erw [CedarVerified.parseTreeProduction133_sem] <;>
first
@@ -132,8 +132,8 @@ theorem variableIdentTree_sem (v : PrintableVar) :
| erw [CedarVerified.parseTreeProduction117_sem]; rfl
| erw [CedarVerified.parseTreeProduction118_sem]; rfl
-theorem variableTree_sem (v : PrintableVar) :
- ptSem (variableTree v) = v.toVariable := by
+theorem variableTree_sem (v : PrintableVar) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (variableTree v) = v.toVariable := by
unfold variableTree
erw [CedarVerified.parseTreeProduction9_sem, variableIdentTree_sem,
CedarVerified.parseTreeProduction10_sem, CedarVerified.parseTreeProduction12_sem,
@@ -142,8 +142,8 @@ theorem variableTree_sem (v : PrintableVar) :
mutual
-theorem variablesTree_sem (variables : List PrintableVar) :
- ptSem (variablesTree variables) = variables.map PrintableVar.toVariable := by
+theorem variablesTree_sem (variables : List PrintableVar) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (variablesTree variables) = variables.map PrintableVar.toVariable := by
cases variables with
| nil =>
simp only [variablesTree, List.map_nil]
@@ -154,8 +154,8 @@ theorem variablesTree_sem (variables : List PrintableVar) :
erw [CedarVerified.parseTreeProduction5_sem, variableTree_sem, variableTailTree_sem]
rfl
-theorem variableTailTree_sem (variables : List PrintableVar) :
- ptSem (variableTailTree variables) = variables.map PrintableVar.toVariable := by
+theorem variableTailTree_sem (variables : List PrintableVar) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (variableTailTree variables) = variables.map PrintableVar.toVariable := by
cases variables with
| nil =>
simp only [variableTailTree, List.map_nil]
@@ -168,8 +168,8 @@ theorem variableTailTree_sem (variables : List PrintableVar) :
end
-theorem policyTree_sem (policy : PrintablePolicy) :
- ptSem (policyTree policy) = policy.toPolicy := by
+theorem policyTree_sem (policy : PrintablePolicy) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (policyTree policy) = policy.toPolicy := by
unfold policyTree
erw [CedarVerified.parseTreeProduction3_sem,
CedarVerified.parseTreeProduction137_sem, effectTree_sem, variablesTree_sem,
@@ -178,12 +178,13 @@ theorem policyTree_sem (policy : PrintablePolicy) :
/-- Rewriting the word index of a parse tree does not change its semantics. -/
theorem ptSem_cast {head : CedarVerified.grammarInst.Sym} {w w' : List Tok} (h : w = w')
- (t : ParseTree (G := CedarVerified.grammarInst) head w) : ptSem (castWord h t) = ptSem t := by
+ (t : ParseTree (G := CedarVerified.grammarInst) head (w.map Positioned.dummy)) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (castWord h t) = SpanGrammar.ptSem pe t := by
subst h; rfl
-theorem policyListTreeRev_sem (rev : List PrintablePolicy) :
- ptSem (policyListTreeRev rev) = (rev.reverse.map PrintablePolicy.toPolicy).toArray := by
- induction rev with
+theorem policyListTreeRev_sem (rev : List PrintablePolicy) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (policyListTreeRev rev) = (rev.reverse.map PrintablePolicy.toPolicy).toArray := by
+ induction rev generalizing pe with
| nil =>
simp only [policyListTreeRev]
erw [CedarVerified.parseTreeProduction135_sem]
@@ -195,13 +196,13 @@ theorem policyListTreeRev_sem (rev : List PrintablePolicy) :
simp [CedarVerified.semanticAction136]
rfl
-theorem policyListTree_sem (policies : List PrintablePolicy) :
- ptSem (policyListTree policies) = (policies.map PrintablePolicy.toPolicy).toArray := by
+theorem policyListTree_sem (policies : List PrintablePolicy) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (policyListTree policies) = (policies.map PrintablePolicy.toPolicy).toArray := by
unfold policyListTree
rw [ptSem_cast, policyListTreeRev_sem, List.reverse_reverse]
-theorem policiesTree_sem (policies : PrintablePolicies) :
- ptSem (policiesTree policies) = policies.toPolicies := by
+theorem policiesTree_sem (policies : PrintablePolicies) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (policiesTree policies) = policies.toPolicies := by
unfold policiesTree PrintablePolicies.toPolicies
erw [CedarVerified.parseTreeProduction0_sem, policyListTree_sem]
rfl
@@ -210,10 +211,10 @@ noncomputable def certificate (policies : PrintablePolicies) :
CedarParserRoundtrip.Certificate (unparsePolicies policies) policies.toPolicies := by
refine { tree := ?_, semantics := ?_ }
· with_unfolding_all exact CedarVerified.parseTreeProduction143 (policiesTree policies)
- · show ptSem (CedarVerified.parseTreeProduction143 (policiesTree policies)) =
+ · show SpanGrammar.ptSem ⟨0⟩ (CedarVerified.parseTreeProduction143 (policiesTree policies)) =
policies.toPolicies
erw [CedarVerified.parseTreeProduction143_sem]
- exact policiesTree_sem policies
+ exact policiesTree_sem policies _
/-- Universal token-level parser roundtrip for restricted printable policies. -/
theorem parse_roundtrip (policies : PrintablePolicies) :
diff --git a/test/cedar/CedarVerified.lean b/test/cedar/CedarVerified.lean
index 2128acb..aaefc32 100644
--- a/test/cedar/CedarVerified.lean
+++ b/test/cedar/CedarVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -28,6 +30,9 @@ public import cedar.CedarParser
import all cedar.CedarParser
meta import cedar.CedarParser
public import LeanParserGenerator.Lexer.StreamRun
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.SpanText
+public import LeanParserGenerator.Runtime.ParseEnd
public import cedar.CedarLexer
@@ -44,6 +49,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace CedarVerified
abbrev Terminal := Fin 52
@@ -375,114 +382,114 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 52
augmentedProduction := 143 }
-def semTbl : List (Σ T : Type, T → CedarParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v42 v)⟩,
- ⟨({ s : String // s ∉ keywords } : Type), fun v => (Runtime.Span.dummy, .v43 v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v44 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v42 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Policies : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Annotation : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(Policy : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(List VariableDef : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(List VariableDef : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(VariableDef : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Option Name : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(Option Add : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Option (RelOp × Expr) : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(Cond : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(Or : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(List And : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(And : Type), fun v => (Runtime.Span.dummy, .v12 v)⟩,
- ⟨(List Relation : Type), fun v => (Runtime.Span.dummy, .v13 v)⟩,
- ⟨(Relation : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(List (RelOp × Add) : Type), fun v => (Runtime.Span.dummy, .v15 v)⟩,
- ⟨(Option Add : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(RelOp : Type), fun v => (Runtime.Span.dummy, .v16 v)⟩,
- ⟨(AddOp : Type), fun v => (Runtime.Span.dummy, .v17 v)⟩,
- ⟨(MultOp : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(Add : Type), fun v => (Runtime.Span.dummy, .v19 v)⟩,
- ⟨(List (AddOp × Mult) : Type), fun v => (Runtime.Span.dummy, .v20 v)⟩,
- ⟨(Mult : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(List (MultOp × Unary) : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(Unary : Type), fun v => (Runtime.Span.dummy, .v23 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Member : Type), fun v => (Runtime.Span.dummy, .v24 v)⟩,
- ⟨(MemAccess : Type), fun v => (Runtime.Span.dummy, .v25 v)⟩,
- ⟨(Primary : Type), fun v => (Runtime.Span.dummy, .v26 v)⟩,
- ⟨(List Expr : Type), fun v => (Runtime.Span.dummy, .v27 v)⟩,
- ⟨(List Expr : Type), fun v => (Runtime.Span.dummy, .v27 v)⟩,
- ⟨(List RecInit : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(List RecInit : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(RecInit : Type), fun v => (Runtime.Span.dummy, .v29 v)⟩,
- ⟨(Primary : Type), fun v => (Runtime.Span.dummy, .v26 v)⟩,
- ⟨((List Ident → Primary) : Type), fun v => (Runtime.Span.dummy, .v30 v)⟩,
- ⟨(Name : Type), fun v => (Runtime.Span.dummy, .v31 v)⟩,
- ⟨((List Ident × Ident) : Type), fun v => (Runtime.Span.dummy, .v32 v)⟩,
- ⟨(List RefInit : Type), fun v => (Runtime.Span.dummy, .v33 v)⟩,
- ⟨(List RefInit : Type), fun v => (Runtime.Span.dummy, .v33 v)⟩,
- ⟨(RefInit : Type), fun v => (Runtime.Span.dummy, .v34 v)⟩,
- ⟨(Literal : Type), fun v => (Runtime.Span.dummy, .v35 v)⟩,
- ⟨(Str : Type), fun v => (Runtime.Span.dummy, .v36 v)⟩,
- ⟨(Ident : Type), fun v => (Runtime.Span.dummy, .v37 v)⟩,
- ⟨(Ident : Type), fun v => (Runtime.Span.dummy, .v37 v)⟩,
- ⟨(Ident : Type), fun v => (Runtime.Span.dummy, .v37 v)⟩,
- ⟨(Array (Policy) : Type), fun v => (Runtime.Span.dummy, .v38 v)⟩,
- ⟨(Array (Annotation) : Type), fun v => (Runtime.Span.dummy, .v39 v)⟩,
- ⟨(Array (Cond) : Type), fun v => (Runtime.Span.dummy, .v40 v)⟩,
- ⟨(Array (MemAccess) : Type), fun v => (Runtime.Span.dummy, .v41 v)⟩,
- ⟨(Policies : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → CedarParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → CedarParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(String : Type), fun v => .v42 v⟩,
+ ⟨({ s : String // s ∉ keywords } : Type), fun v => .v43 v⟩,
+ ⟨(Nat : Type), fun v => .v44 v⟩,
+ ⟨(String : Type), fun v => .v42 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Policies : Type), fun v => .v0 v⟩,
+ ⟨(Annotation : Type), fun v => .v1 v⟩,
+ ⟨(Policy : Type), fun v => .v2 v⟩,
+ ⟨(List VariableDef : Type), fun v => .v3 v⟩,
+ ⟨(List VariableDef : Type), fun v => .v3 v⟩,
+ ⟨(VariableDef : Type), fun v => .v4 v⟩,
+ ⟨(Option Name : Type), fun v => .v5 v⟩,
+ ⟨(Option Add : Type), fun v => .v6 v⟩,
+ ⟨(Option (RelOp × Expr) : Type), fun v => .v7 v⟩,
+ ⟨(Cond : Type), fun v => .v8 v⟩,
+ ⟨(Expr : Type), fun v => .v9 v⟩,
+ ⟨(Or : Type), fun v => .v10 v⟩,
+ ⟨(List And : Type), fun v => .v11 v⟩,
+ ⟨(And : Type), fun v => .v12 v⟩,
+ ⟨(List Relation : Type), fun v => .v13 v⟩,
+ ⟨(Relation : Type), fun v => .v14 v⟩,
+ ⟨(List (RelOp × Add) : Type), fun v => .v15 v⟩,
+ ⟨(Option Add : Type), fun v => .v6 v⟩,
+ ⟨(RelOp : Type), fun v => .v16 v⟩,
+ ⟨(AddOp : Type), fun v => .v17 v⟩,
+ ⟨(MultOp : Type), fun v => .v18 v⟩,
+ ⟨(Add : Type), fun v => .v19 v⟩,
+ ⟨(List (AddOp × Mult) : Type), fun v => .v20 v⟩,
+ ⟨(Mult : Type), fun v => .v21 v⟩,
+ ⟨(List (MultOp × Unary) : Type), fun v => .v22 v⟩,
+ ⟨(Unary : Type), fun v => .v23 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Member : Type), fun v => .v24 v⟩,
+ ⟨(MemAccess : Type), fun v => .v25 v⟩,
+ ⟨(Primary : Type), fun v => .v26 v⟩,
+ ⟨(List Expr : Type), fun v => .v27 v⟩,
+ ⟨(List Expr : Type), fun v => .v27 v⟩,
+ ⟨(List RecInit : Type), fun v => .v28 v⟩,
+ ⟨(List RecInit : Type), fun v => .v28 v⟩,
+ ⟨(RecInit : Type), fun v => .v29 v⟩,
+ ⟨(Primary : Type), fun v => .v26 v⟩,
+ ⟨((List Ident → Primary) : Type), fun v => .v30 v⟩,
+ ⟨(Name : Type), fun v => .v31 v⟩,
+ ⟨((List Ident × Ident) : Type), fun v => .v32 v⟩,
+ ⟨(List RefInit : Type), fun v => .v33 v⟩,
+ ⟨(List RefInit : Type), fun v => .v33 v⟩,
+ ⟨(RefInit : Type), fun v => .v34 v⟩,
+ ⟨(Literal : Type), fun v => .v35 v⟩,
+ ⟨(Str : Type), fun v => .v36 v⟩,
+ ⟨(Ident : Type), fun v => .v37 v⟩,
+ ⟨(Ident : Type), fun v => .v37 v⟩,
+ ⟨(Ident : Type), fun v => .v37 v⟩,
+ ⟨(Array (Policy) : Type), fun v => .v38 v⟩,
+ ⟨(Array (Annotation) : Type), fun v => .v39 v⟩,
+ ⟨(Array (Cond) : Type), fun v => .v40 v⟩,
+ ⟨(Array (MemAccess) : Type), fun v => .v41 v⟩,
+ ⟨(Policies : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → CedarParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -491,442 +498,442 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (ps : Array (Policy)) => (Policies.mk ps.toList)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ps : Array (Policy)) => (Policies.mk ps.toList)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (key : Ident) (_ : Unit) => (Annotation.mk key none)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (key : Ident) (_ : Unit) => (Annotation.mk key none)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (value : Str) (_ : Unit) (key : Ident) (_ : Unit) => (Annotation.mk key (some value))
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (value : Str) (_ : Unit) (key : Ident) (_ : Unit) => (Annotation.mk key (some value))
-def semanticAction3 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨50, of_decide_eq_true rfl⟩, Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.NT ⟨49, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (conds : Array (Cond)) (_ : Unit) (variables : List VariableDef) (_ : Unit) (effect : Ident) (annotations : Array (Annotation)) => (Policy.policy (PolicyImpl.mk annotations.toList effect variables conds.toList))
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨50, of_decide_eq_true rfl⟩, Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.NT ⟨49, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (conds : Array (Cond)) (_ : Unit) (variables : List VariableDef) (_ : Unit) (effect : Ident) (annotations : Array (Annotation)) => (Policy.policy (PolicyImpl.mk annotations.toList effect variables conds.toList))
-def semanticAction4 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List VariableDef)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List VariableDef)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List VariableDef) (v : VariableDef) => (v :: rest)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List VariableDef) (v : VariableDef) => (v :: rest)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List VariableDef)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List VariableDef)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction8 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List VariableDef) (v : VariableDef) (_ : Unit) => (v :: rest)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List VariableDef) (v : VariableDef) (_ : Unit) => (v :: rest)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (ineq : Option (RelOp × Expr)) (entity : Option Add) (unused : Option Name) (varName : Ident) => (VariableDef.mk varName unused entity ineq)
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ineq : Option (RelOp × Expr)) (entity : Option Add) (unused : Option Name) (varName : Ident) => (VariableDef.mk varName unused entity ineq)
-def semanticAction10 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option Name)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option Name)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (name : Name) (_ : Unit) => (some name)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (name : Name) (_ : Unit) => (some name)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option Add)
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option Add)
-def semanticAction13 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (entity : Add) (_ : Unit) => (some entity)
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (entity : Add) (_ : Unit) => (some entity)
-def semanticAction14 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option (RelOp × Expr))
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option (RelOp × Expr))
-def semanticAction15 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (expression : Expr) (op : RelOp) => (some (op, expression))
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (expression : Expr) (op : RelOp) => (some (op, expression))
-def semanticAction16 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (expression : Expr) (_ : Unit) (kind : Ident) => (Cond.mk kind expression)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (expression : Expr) (_ : Unit) (kind : Ident) => (Cond.mk kind expression)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Or) => (Expr.expr (ExprImpl.mk (ExprData.or value)))
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Or) => (Expr.expr (ExprImpl.mk (ExprData.or value)))
-def semanticAction18 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (elseExpr : Expr) (_ : Unit) (thenExpr : Expr) (_ : Unit) (condition : Expr) (_ : Unit) => (Expr.expr (ExprImpl.mk (ExprData.ifThenElse condition thenExpr elseExpr)))
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (elseExpr : Expr) (_ : Unit) (thenExpr : Expr) (_ : Unit) (condition : Expr) (_ : Unit) => (Expr.expr (ExprImpl.mk (ExprData.ifThenElse condition thenExpr elseExpr)))
-def semanticAction19 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (extended : List And) (initial : And) => (Or.mk initial extended)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (extended : List And) (initial : And) => (Or.mk initial extended)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List And)
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List And)
-def semanticAction21 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨41, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List And) (next : And) (_ : Unit) => (next :: rest)
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨41, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List And) (next : And) (_ : Unit) => (next :: rest)
-def semanticAction22 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (extended : List Relation) (initial : Relation) => (And.mk initial extended)
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (extended : List Relation) (initial : Relation) => (And.mk initial extended)
-def semanticAction23 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Relation)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Relation)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Relation) (next : Relation) (_ : Unit) => (next :: rest)
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Relation) (next : Relation) (_ : Unit) => (next :: rest)
-def semanticAction25 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (field : Add) (_ : Unit) (target : Add) => (Relation.has target field)
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (field : Add) (_ : Unit) (target : Add) => (Relation.has target field)
-def semanticAction26 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨51, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (access : Array (MemAccess)) (_ : Unit) (_ : Unit) (target : Add) => (Relation.has target (Cedar.Add.fromIdent .ifIdent access.toList))
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨51, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (access : Array (MemAccess)) (_ : Unit) (_ : Unit) (target : Add) => (Relation.has target (Cedar.Add.fromIdent .ifIdent access.toList))
-def semanticAction27 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (pattern : Add) (_ : Unit) (target : Add) => (Relation.like target pattern)
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (pattern : Add) (_ : Unit) (target : Add) => (Relation.like target pattern)
-def semanticAction28 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (inEntity : Option Add) (entityType : Add) (_ : Unit) (target : Add) => (Relation.isIn target entityType inEntity)
+def semanticAction28 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (inEntity : Option Add) (entityType : Add) (_ : Unit) (target : Add) => (Relation.isIn target entityType inEntity)
-def semanticAction29 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (extended : List (RelOp × Add)) (initial : Add) => (Relation.common initial extended)
+def semanticAction29 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (extended : List (RelOp × Add)) (initial : Add) => (Relation.common initial extended)
-def semanticAction30 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (RelOp × Add))
+def semanticAction30 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (RelOp × Add))
-def semanticAction31 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (RelOp × Add)) (next : Add) (op : RelOp) => ((op, next) :: rest)
+def semanticAction31 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (RelOp × Add)) (next : Add) (op : RelOp) => ((op, next) :: rest)
-def semanticAction32 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option Add)
+def semanticAction32 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option Add)
-def semanticAction33 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (entity : Add) (_ : Unit) => (some entity)
+def semanticAction33 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (entity : Add) (_ : Unit) => (some entity)
-def semanticAction34 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨37, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.less)
+def semanticAction34 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨37, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.less)
-def semanticAction35 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.lessEq)
+def semanticAction35 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨38, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.lessEq)
-def semanticAction36 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨39, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.greaterEq)
+def semanticAction36 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨39, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.greaterEq)
-def semanticAction37 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨40, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.greater)
+def semanticAction37 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨40, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.greater)
-def semanticAction38 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.notEq)
+def semanticAction38 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.notEq)
-def semanticAction39 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.eq)
+def semanticAction39 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.eq)
-def semanticAction40 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.inOp)
+def semanticAction40 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.inOp)
-def semanticAction41 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨49, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.invalidSingleEq)
+def semanticAction41 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨49, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.invalidSingleEq)
-def semanticAction42 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.plus)
+def semanticAction42 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨43, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.plus)
-def semanticAction43 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.minus)
+def semanticAction43 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.minus)
-def semanticAction44 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.times)
+def semanticAction44 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨45, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.times)
-def semanticAction45 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨46, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.divide)
+def semanticAction45 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨46, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.divide)
-def semanticAction46 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.mod)
+def semanticAction46 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.mod)
-def semanticAction47 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (extended : List (AddOp × Mult)) (initial : Mult) => (Cedar.Add.mk initial extended)
+def semanticAction47 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (extended : List (AddOp × Mult)) (initial : Mult) => (Cedar.Add.mk initial extended)
-def semanticAction48 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (AddOp × Mult))
+def semanticAction48 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (AddOp × Mult))
-def semanticAction49 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (AddOp × Mult)) (next : Mult) (op : AddOp) => ((op, next) :: rest)
+def semanticAction49 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (AddOp × Mult)) (next : Mult) (op : AddOp) => ((op, next) :: rest)
-def semanticAction50 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (extended : List (MultOp × Unary)) (initial : Unary) => (Mult.mk initial extended)
+def semanticAction50 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (extended : List (MultOp × Unary)) (initial : Unary) => (Mult.mk initial extended)
-def semanticAction51 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (MultOp × Unary))
+def semanticAction51 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (MultOp × Unary))
-def semanticAction52 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨25, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (MultOp × Unary)) (next : Unary) (op : MultOp) => ((op, next) :: rest)
+def semanticAction52 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨25, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (MultOp × Unary)) (next : Unary) (op : MultOp) => ((op, next) :: rest)
-def semanticAction53 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) => (Unary.mk none item)
+def semanticAction53 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) => (Unary.mk none item)
-def semanticAction54 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) => (Unary.mk (some (.bang 1)) item)
+def semanticAction54 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) => (Unary.mk (some (.bang 1)) item)
-def semanticAction55 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) (_ : Unit) => (Unary.mk (some (.bang 2)) item)
+def semanticAction55 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) (_ : Unit) => (Unary.mk (some (.bang 2)) item)
-def semanticAction56 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.bang 3)) item)
+def semanticAction56 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.bang 3)) item)
-def semanticAction57 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.bang 4)) item)
+def semanticAction57 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.bang 4)) item)
-def semanticAction58 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_bang : Unit) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some .overBang) item)
+def semanticAction58 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_bang : Unit) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some .overBang) item)
-def semanticAction59 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) => (Unary.mk (some (.dash 1)) item)
+def semanticAction59 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) => (Unary.mk (some (.dash 1)) item)
-def semanticAction60 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) (_ : Unit) => (Unary.mk (some (.dash 2)) item)
+def semanticAction60 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) (_ : Unit) => (Unary.mk (some (.dash 2)) item)
-def semanticAction61 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.dash 3)) item)
+def semanticAction61 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.dash 3)) item)
-def semanticAction62 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.dash 4)) item)
+def semanticAction62 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some (.dash 4)) item)
-def semanticAction63 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (item : Member) (_dash : Unit) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some .overDash) item)
+def semanticAction63 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (item : Member) (_dash : Unit) (_ : Unit) (_ : Unit) (_ : Unit) (_ : Unit) => (Unary.mk (some .overDash) item)
-def semanticAction64 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction64 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction65 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨26, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (_rest : Unit) (_ : Unit) => (())
+def semanticAction65 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨26, of_decide_eq_true rfl⟩, Symbol.T ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_rest : Unit) (_ : Unit) => (())
-def semanticAction66 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction66 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction67 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (_rest : Unit) (_ : Unit) => (())
+def semanticAction67 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_rest : Unit) (_ : Unit) => (())
-def semanticAction68 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨51, of_decide_eq_true rfl⟩, Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (access : Array (MemAccess)) (item : Primary) => (Member.mk item access.toList)
+def semanticAction68 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨51, of_decide_eq_true rfl⟩, Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (access : Array (MemAccess)) (item : Primary) => (Member.mk item access.toList)
-def semanticAction69 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (field : Ident) (_ : Unit) => (MemAccess.field field)
+def semanticAction69 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (field : Ident) (_ : Unit) => (MemAccess.field field)
-def semanticAction70 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (args : List Expr) (_ : Unit) => (MemAccess.call args)
+def semanticAction70 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (args : List Expr) (_ : Unit) => (MemAccess.call args)
-def semanticAction71 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (index : Expr) (_ : Unit) => (MemAccess.index index)
+def semanticAction71 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (index : Expr) (_ : Unit) => (MemAccess.index index)
-def semanticAction72 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨43, of_decide_eq_true rfl⟩].map semT') :=
- fun (literal : Literal) => (Primary.literal literal)
+def semanticAction72 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨43, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (literal : Literal) => (Primary.literal literal)
-def semanticAction73 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Primary) => (value)
+def semanticAction73 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨36, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Primary) => (value)
-def semanticAction74 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (Primary.slot .principal)
+def semanticAction74 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨17, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (Primary.slot .principal)
-def semanticAction75 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (Primary.slot .resource)
+def semanticAction75 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (Primary.slot .resource)
-def semanticAction76 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (slot : String) => (Primary.slot (.other slot))
+def semanticAction76 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (slot : String) => (Primary.slot (.other slot))
-def semanticAction77 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (expression : Expr) (_ : Unit) => (Primary.expr expression)
+def semanticAction77 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (expression : Expr) (_ : Unit) => (Primary.expr expression)
-def semanticAction78 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (elements : List Expr) (_ : Unit) => (Primary.exprList elements)
+def semanticAction78 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.T ⟨33, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (elements : List Expr) (_ : Unit) => (Primary.exprList elements)
-def semanticAction79 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (fields : List RecInit) (_ : Unit) => (Primary.record fields)
+def semanticAction79 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (fields : List RecInit) (_ : Unit) => (Primary.record fields)
-def semanticAction80 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Expr)
+def semanticAction80 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Expr)
-def semanticAction81 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Expr) (expression : Expr) => (expression :: rest)
+def semanticAction81 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Expr) (expression : Expr) => (expression :: rest)
-def semanticAction82 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Expr)
+def semanticAction82 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Expr)
-def semanticAction83 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction83 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction84 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Expr) (expression : Expr) (_ : Unit) => (expression :: rest)
+def semanticAction84 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Expr) (expression : Expr) (_ : Unit) => (expression :: rest)
-def semanticAction85 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List RecInit)
+def semanticAction85 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List RecInit)
-def semanticAction86 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List RecInit) (init : RecInit) => (init :: rest)
+def semanticAction86 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List RecInit) (init : RecInit) => (init :: rest)
-def semanticAction87 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List RecInit)
+def semanticAction87 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List RecInit)
-def semanticAction88 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction88 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction89 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List RecInit) (init : RecInit) (_ : Unit) => (init :: rest)
+def semanticAction89 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List RecInit) (init : RecInit) (_ : Unit) => (init :: rest)
-def semanticAction90 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Expr) (_ : Unit) (_ : Unit) => (RecInit.mk (Expr.fromIdent .ifIdent) value)
+def semanticAction90 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Expr) (_ : Unit) (_ : Unit) => (RecInit.mk (Expr.fromIdent .ifIdent) value)
-def semanticAction91 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Expr) (_ : Unit) (key : Expr) => (RecInit.mk key value)
+def semanticAction91 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Expr) (_ : Unit) (key : Expr) => (RecInit.mk key value)
-def semanticAction92 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
- fun (first : Ident) => (Primary.name (Name.mk [] first))
+def semanticAction92 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (first : Ident) => (Primary.name (Name.mk [] first))
-def semanticAction93 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
- fun (tail : (List Ident → Primary)) (_ : Unit) (first : Ident) => (tail [first])
+def semanticAction93 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tail : (List Ident → Primary)) (_ : Unit) (first : Ident) => (tail [first])
-def semanticAction94 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
- fun (last : Ident) (_ : Unit) (first : Ident) => (Primary.name (Name.mk [first] last))
+def semanticAction94 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (last : Ident) (_ : Unit) (first : Ident) => (Primary.name (Name.mk [first] last))
-def semanticAction95 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
- fun (tail : (List Ident → Primary)) (_ : Unit) (next : Ident) (_ : Unit) (first : Ident) => (tail [first, next])
+def semanticAction95 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tail : (List Ident → Primary)) (_ : Unit) (next : Ident) (_ : Unit) (first : Ident) => (tail [first, next])
-def semanticAction96 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (last : Ident) => (fun path => Primary.name (Name.mk path last))
+def semanticAction96 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (last : Ident) => (fun path => Primary.name (Name.mk path last))
-def semanticAction97 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (eid : Str) => (fun components => Primary.ref (Ref.uid (Name.fromComponents components) eid))
+def semanticAction97 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (eid : Str) => (fun components => Primary.ref (Ref.uid (Name.fromComponents components) eid))
-def semanticAction98 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (fields : List RefInit) (_ : Unit) => (fun components => Primary.ref (Ref.ref (Name.fromComponents components) fields))
+def semanticAction98 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (fields : List RefInit) (_ : Unit) => (fun components => Primary.ref (Ref.ref (Name.fromComponents components) fields))
-def semanticAction99 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (tail : (List Ident → Primary)) (_ : Unit) (next : Ident) => (fun path => tail (path ++ [next]))
+def semanticAction99 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tail : (List Ident → Primary)) (_ : Unit) (next : Ident) => (fun path => tail (path ++ [next]))
-def semanticAction100 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
- fun (name : Ident) => (Name.mk [] name)
+def semanticAction100 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (name : Ident) => (Name.mk [] name)
-def semanticAction101 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (tail : (List Ident × Ident)) (_ : Unit) (first : Ident) => (Name.mk (first :: tail.1) tail.2)
+def semanticAction101 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tail : (List Ident × Ident)) (_ : Unit) (first : Ident) => (Name.mk (first :: tail.1) tail.2)
-def semanticAction102 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (last : Ident) => (([], last))
+def semanticAction102 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (last : Ident) => (([], last))
-def semanticAction103 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (tail : (List Ident × Ident)) (_ : Unit) (next : Ident) => ((next :: tail.1, tail.2))
+def semanticAction103 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (tail : (List Ident × Ident)) (_ : Unit) (next : Ident) => ((next :: tail.1, tail.2))
-def semanticAction104 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List RefInit)
+def semanticAction104 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List RefInit)
-def semanticAction105 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List RefInit) (init : RefInit) => (init :: rest)
+def semanticAction105 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List RefInit) (init : RefInit) => (init :: rest)
-def semanticAction106 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List RefInit)
+def semanticAction106 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List RefInit)
-def semanticAction107 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction107 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction108 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List RefInit) (init : RefInit) (_ : Unit) => (init :: rest)
+def semanticAction108 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨41, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List RefInit) (init : RefInit) (_ : Unit) => (init :: rest)
-def semanticAction109 : arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Literal) (_ : Unit) (field : Ident) => (RefInit.mk field value)
+def semanticAction109 : List Runtime.Span → arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Literal) (_ : Unit) (field : Ident) => (RefInit.mk field value)
-def semanticAction110 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.trueLit)
+def semanticAction110 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.trueLit)
-def semanticAction111 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.falseLit)
+def semanticAction111 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.falseLit)
-def semanticAction112 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨21, of_decide_eq_true rfl⟩].map semT') :=
- fun (number : Nat) => (.num number)
+def semanticAction112 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨21, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (number : Nat) => (.num number)
-def semanticAction113 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Str) => (.str value)
+def semanticAction113 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Str) => (.str value)
-def semanticAction114 : arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (.string value)
+def semanticAction114 : List Runtime.Span → arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (.string value)
-def semanticAction115 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.principal)
+def semanticAction115 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.principal)
-def semanticAction116 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.action)
+def semanticAction116 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.action)
-def semanticAction117 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.resource)
+def semanticAction117 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.resource)
-def semanticAction118 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.context)
+def semanticAction118 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.context)
-def semanticAction119 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.permit)
+def semanticAction119 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.permit)
-def semanticAction120 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.forbid)
+def semanticAction120 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.forbid)
-def semanticAction121 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.when)
+def semanticAction121 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.when)
-def semanticAction122 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.unless)
+def semanticAction122 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.unless)
-def semanticAction123 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.inIdent)
+def semanticAction123 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.inIdent)
-def semanticAction124 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.has)
+def semanticAction124 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.has)
-def semanticAction125 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.like)
+def semanticAction125 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.like)
-def semanticAction126 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.is)
+def semanticAction126 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.is)
-def semanticAction127 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.thenIdent)
+def semanticAction127 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.thenIdent)
-def semanticAction128 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.elseIdent)
+def semanticAction128 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.elseIdent)
-def semanticAction129 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : { s : String // s ∉ keywords }) => (.ident value)
+def semanticAction129 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : { s : String // s ∉ keywords }) => (.ident value)
-def semanticAction130 : arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.ifIdent)
+def semanticAction130 : List Runtime.Span → arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.ifIdent)
-def semanticAction131 : arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.trueIdent)
+def semanticAction131 : List Runtime.Span → arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.trueIdent)
-def semanticAction132 : arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.falseIdent)
+def semanticAction132 : List Runtime.Span → arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.falseIdent)
-def semanticAction133 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Ident) => (value)
+def semanticAction133 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Ident) => (value)
-def semanticAction134 : arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Ident) => (value)
+def semanticAction134 : List Runtime.Span → arrowsRight (semT' (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨46, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Ident) => (value)
-def semanticAction135 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Policy))
+def semanticAction135 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Policy))
-def semanticAction136 : arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨48, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Policy) (xs : Array (Policy)) => (xs.push x)
+def semanticAction136 : List Runtime.Span → arrowsRight (semT' (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨48, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Policy) (xs : Array (Policy)) => (xs.push x)
-def semanticAction137 : arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Annotation))
+def semanticAction137 : List Runtime.Span → arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Annotation))
-def semanticAction138 : arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨49, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Annotation) (xs : Array (Annotation)) => (xs.push x)
+def semanticAction138 : List Runtime.Span → arrowsRight (semT' (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨49, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Annotation) (xs : Array (Annotation)) => (xs.push x)
-def semanticAction139 : arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Cond))
+def semanticAction139 : List Runtime.Span → arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Cond))
-def semanticAction140 : arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨50, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Cond) (xs : Array (Cond)) => (xs.push x)
+def semanticAction140 : List Runtime.Span → arrowsRight (semT' (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨50, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Cond) (xs : Array (Cond)) => (xs.push x)
-def semanticAction141 : arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (MemAccess))
+def semanticAction141 : List Runtime.Span → arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (MemAccess))
-def semanticAction142 : arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨51, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : MemAccess) (xs : Array (MemAccess)) => (xs.push x)
+def semanticAction142 : List Runtime.Span → arrowsRight (semT' (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨51, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : MemAccess) (xs : Array (MemAccess)) => (xs.push x)
-def semanticAction143 : arrowsRight (semT' (.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨51, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction143 : List Runtime.Span → arrowsRight (semT' (.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨51, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨48, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨30, of_decide_eq_true rfl⟩, Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨47, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩]) semanticAction2
@@ -1079,7 +1086,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -1248,1846 +1255,2051 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
/-- Terminal parse tree for `TRUE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTRUE :
+noncomputable def parseTreeTokenTRUE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [Tok.TRUE] :=
+ (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.TRUE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.TRUE))
+ (.terminal (G := grammarInst) (⟨Tok.TRUE, span⟩))
/-- Terminal parse tree for `FALSE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenFALSE :
+noncomputable def parseTreeTokenFALSE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [Tok.FALSE] :=
+ (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.FALSE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.FALSE))
+ (.terminal (G := grammarInst) (⟨Tok.FALSE, span⟩))
/-- Terminal parse tree for `IF` with its concrete grammar index. -/
-noncomputable def parseTreeTokenIF :
+noncomputable def parseTreeTokenIF
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IF] :=
+ (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IF, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IF))
+ (.terminal (G := grammarInst) (⟨Tok.IF, span⟩))
/-- Terminal parse tree for `PERMIT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPERMIT :
+noncomputable def parseTreeTokenPERMIT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PERMIT] :=
+ (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PERMIT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PERMIT))
+ (.terminal (G := grammarInst) (⟨Tok.PERMIT, span⟩))
/-- Terminal parse tree for `FORBID` with its concrete grammar index. -/
-noncomputable def parseTreeTokenFORBID :
+noncomputable def parseTreeTokenFORBID
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [Tok.FORBID] :=
+ (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.FORBID, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.FORBID))
+ (.terminal (G := grammarInst) (⟨Tok.FORBID, span⟩))
/-- Terminal parse tree for `WHEN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenWHEN :
+noncomputable def parseTreeTokenWHEN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [Tok.WHEN] :=
+ (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.WHEN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.WHEN))
+ (.terminal (G := grammarInst) (⟨Tok.WHEN, span⟩))
/-- Terminal parse tree for `UNLESS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenUNLESS :
+noncomputable def parseTreeTokenUNLESS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨6, of_decide_eq_true rfl⟩ : Terminal)) [Tok.UNLESS] :=
+ (.T (⟨6, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.UNLESS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.UNLESS))
+ (.terminal (G := grammarInst) (⟨Tok.UNLESS, span⟩))
/-- Terminal parse tree for `IN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenIN :
+noncomputable def parseTreeTokenIN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IN] :=
+ (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IN))
+ (.terminal (G := grammarInst) (⟨Tok.IN, span⟩))
/-- Terminal parse tree for `HAS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenHAS :
+noncomputable def parseTreeTokenHAS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨8, of_decide_eq_true rfl⟩ : Terminal)) [Tok.HAS] :=
+ (.T (⟨8, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.HAS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.HAS))
+ (.terminal (G := grammarInst) (⟨Tok.HAS, span⟩))
/-- Terminal parse tree for `LIKE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLIKE :
+noncomputable def parseTreeTokenLIKE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨9, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LIKE] :=
+ (.T (⟨9, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LIKE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LIKE))
+ (.terminal (G := grammarInst) (⟨Tok.LIKE, span⟩))
/-- Terminal parse tree for `IS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenIS :
+noncomputable def parseTreeTokenIS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨10, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IS] :=
+ (.T (⟨10, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IS))
+ (.terminal (G := grammarInst) (⟨Tok.IS, span⟩))
/-- Terminal parse tree for `THEN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTHEN :
+noncomputable def parseTreeTokenTHEN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨11, of_decide_eq_true rfl⟩ : Terminal)) [Tok.THEN] :=
+ (.T (⟨11, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.THEN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.THEN))
+ (.terminal (G := grammarInst) (⟨Tok.THEN, span⟩))
/-- Terminal parse tree for `ELSE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenELSE :
+noncomputable def parseTreeTokenELSE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨12, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ELSE] :=
+ (.T (⟨12, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ELSE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ELSE))
+ (.terminal (G := grammarInst) (⟨Tok.ELSE, span⟩))
/-- Terminal parse tree for `PRINCIPAL` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPRINCIPAL :
+noncomputable def parseTreeTokenPRINCIPAL
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨13, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PRINCIPAL] :=
+ (.T (⟨13, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PRINCIPAL, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PRINCIPAL))
+ (.terminal (G := grammarInst) (⟨Tok.PRINCIPAL, span⟩))
/-- Terminal parse tree for `ACTION` with its concrete grammar index. -/
-noncomputable def parseTreeTokenACTION :
+noncomputable def parseTreeTokenACTION
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨14, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ACTION] :=
+ (.T (⟨14, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ACTION, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ACTION))
+ (.terminal (G := grammarInst) (⟨Tok.ACTION, span⟩))
/-- Terminal parse tree for `RESOURCE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRESOURCE :
+noncomputable def parseTreeTokenRESOURCE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨15, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RESOURCE] :=
+ (.T (⟨15, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RESOURCE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RESOURCE))
+ (.terminal (G := grammarInst) (⟨Tok.RESOURCE, span⟩))
/-- Terminal parse tree for `CONTEXT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCONTEXT :
+noncomputable def parseTreeTokenCONTEXT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨16, of_decide_eq_true rfl⟩ : Terminal)) [Tok.CONTEXT] :=
+ (.T (⟨16, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.CONTEXT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.CONTEXT))
+ (.terminal (G := grammarInst) (⟨Tok.CONTEXT, span⟩))
/-- Terminal parse tree for `PRINCIPAL_SLOT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPRINCIPAL_SLOT :
+noncomputable def parseTreeTokenPRINCIPAL_SLOT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨17, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PRINCIPAL_SLOT] :=
+ (.T (⟨17, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PRINCIPAL_SLOT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PRINCIPAL_SLOT))
+ (.terminal (G := grammarInst) (⟨Tok.PRINCIPAL_SLOT, span⟩))
/-- Terminal parse tree for `RESOURCE_SLOT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRESOURCE_SLOT :
+noncomputable def parseTreeTokenRESOURCE_SLOT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨18, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RESOURCE_SLOT] :=
+ (.T (⟨18, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RESOURCE_SLOT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RESOURCE_SLOT))
+ (.terminal (G := grammarInst) (⟨Tok.RESOURCE_SLOT, span⟩))
/-- Terminal parse tree for `OTHER_SLOT` with its concrete grammar index. -/
noncomputable def parseTreeTokenOTHER_SLOT
- (value : String) :
+ (value : String)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨19, of_decide_eq_true rfl⟩ : Terminal)) [Tok.OTHER_SLOT value] :=
+ (.T (⟨19, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.OTHER_SLOT value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.OTHER_SLOT value))
+ (.terminal (G := grammarInst) (⟨Tok.OTHER_SLOT value, span⟩))
/-- Terminal parse tree for `IDENTIFIER` with its concrete grammar index. -/
noncomputable def parseTreeTokenIDENTIFIER
- (value : { s : String // s ∉ keywords }) :
+ (value : { s : String // s ∉ keywords })
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨20, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IDENTIFIER value] :=
+ (.T (⟨20, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IDENTIFIER value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IDENTIFIER value))
+ (.terminal (G := grammarInst) (⟨Tok.IDENTIFIER value, span⟩))
/-- Terminal parse tree for `NUMBER` with its concrete grammar index. -/
noncomputable def parseTreeTokenNUMBER
- (value : Nat) :
+ (value : Nat)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨21, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NUMBER value] :=
+ (.T (⟨21, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NUMBER value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NUMBER value))
+ (.terminal (G := grammarInst) (⟨Tok.NUMBER value, span⟩))
/-- Terminal parse tree for `STRINGLIT` with its concrete grammar index. -/
noncomputable def parseTreeTokenSTRINGLIT
- (value : String) :
+ (value : String)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) [Tok.STRINGLIT value] :=
+ (.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.STRINGLIT value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.STRINGLIT value))
+ (.terminal (G := grammarInst) (⟨Tok.STRINGLIT value, span⟩))
/-- Terminal parse tree for `AT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenAT :
+noncomputable def parseTreeTokenAT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨23, of_decide_eq_true rfl⟩ : Terminal)) [Tok.AT] :=
+ (.T (⟨23, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.AT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.AT))
+ (.terminal (G := grammarInst) (⟨Tok.AT, span⟩))
/-- Terminal parse tree for `DOT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenDOT :
+noncomputable def parseTreeTokenDOT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨24, of_decide_eq_true rfl⟩ : Terminal)) [Tok.DOT] :=
+ (.T (⟨24, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.DOT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.DOT))
+ (.terminal (G := grammarInst) (⟨Tok.DOT, span⟩))
/-- Terminal parse tree for `COMMA` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCOMMA :
+noncomputable def parseTreeTokenCOMMA
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨25, of_decide_eq_true rfl⟩ : Terminal)) [Tok.COMMA] :=
+ (.T (⟨25, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.COMMA, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.COMMA))
+ (.terminal (G := grammarInst) (⟨Tok.COMMA, span⟩))
/-- Terminal parse tree for `SEMICOLON` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSEMICOLON :
+noncomputable def parseTreeTokenSEMICOLON
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨26, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SEMICOLON] :=
+ (.T (⟨26, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SEMICOLON, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SEMICOLON))
+ (.terminal (G := grammarInst) (⟨Tok.SEMICOLON, span⟩))
/-- Terminal parse tree for `COLON` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCOLON :
+noncomputable def parseTreeTokenCOLON
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨27, of_decide_eq_true rfl⟩ : Terminal)) [Tok.COLON] :=
+ (.T (⟨27, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.COLON, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.COLON))
+ (.terminal (G := grammarInst) (⟨Tok.COLON, span⟩))
/-- Terminal parse tree for `COLONCOLON` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCOLONCOLON :
+noncomputable def parseTreeTokenCOLONCOLON
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨28, of_decide_eq_true rfl⟩ : Terminal)) [Tok.COLONCOLON] :=
+ (.T (⟨28, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.COLONCOLON, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.COLONCOLON))
+ (.terminal (G := grammarInst) (⟨Tok.COLONCOLON, span⟩))
/-- Terminal parse tree for `LPAREN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLPAREN :
+noncomputable def parseTreeTokenLPAREN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨29, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LPAREN] :=
+ (.T (⟨29, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LPAREN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LPAREN))
+ (.terminal (G := grammarInst) (⟨Tok.LPAREN, span⟩))
/-- Terminal parse tree for `RPAREN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRPAREN :
+noncomputable def parseTreeTokenRPAREN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨30, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RPAREN] :=
+ (.T (⟨30, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RPAREN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RPAREN))
+ (.terminal (G := grammarInst) (⟨Tok.RPAREN, span⟩))
/-- Terminal parse tree for `LBRACE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLBRACE :
+noncomputable def parseTreeTokenLBRACE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨31, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LBRACE] :=
+ (.T (⟨31, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LBRACE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LBRACE))
+ (.terminal (G := grammarInst) (⟨Tok.LBRACE, span⟩))
/-- Terminal parse tree for `RBRACE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRBRACE :
+noncomputable def parseTreeTokenRBRACE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨32, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RBRACE] :=
+ (.T (⟨32, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RBRACE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RBRACE))
+ (.terminal (G := grammarInst) (⟨Tok.RBRACE, span⟩))
/-- Terminal parse tree for `LBRACKET` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLBRACKET :
+noncomputable def parseTreeTokenLBRACKET
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨33, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LBRACKET] :=
+ (.T (⟨33, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LBRACKET, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LBRACKET))
+ (.terminal (G := grammarInst) (⟨Tok.LBRACKET, span⟩))
/-- Terminal parse tree for `RBRACKET` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRBRACKET :
+noncomputable def parseTreeTokenRBRACKET
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨34, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RBRACKET] :=
+ (.T (⟨34, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RBRACKET, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RBRACKET))
+ (.terminal (G := grammarInst) (⟨Tok.RBRACKET, span⟩))
/-- Terminal parse tree for `EQ` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEQ :
+noncomputable def parseTreeTokenEQ
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨35, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EQ] :=
+ (.T (⟨35, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EQ, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EQ))
+ (.terminal (G := grammarInst) (⟨Tok.EQ, span⟩))
/-- Terminal parse tree for `NEQ` with its concrete grammar index. -/
-noncomputable def parseTreeTokenNEQ :
+noncomputable def parseTreeTokenNEQ
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨36, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NEQ] :=
+ (.T (⟨36, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NEQ, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NEQ))
+ (.terminal (G := grammarInst) (⟨Tok.NEQ, span⟩))
/-- Terminal parse tree for `LT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLT :
+noncomputable def parseTreeTokenLT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨37, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LT] :=
+ (.T (⟨37, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LT))
+ (.terminal (G := grammarInst) (⟨Tok.LT, span⟩))
/-- Terminal parse tree for `LEQ` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLEQ :
+noncomputable def parseTreeTokenLEQ
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨38, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LEQ] :=
+ (.T (⟨38, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LEQ, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LEQ))
+ (.terminal (G := grammarInst) (⟨Tok.LEQ, span⟩))
/-- Terminal parse tree for `GEQ` with its concrete grammar index. -/
-noncomputable def parseTreeTokenGEQ :
+noncomputable def parseTreeTokenGEQ
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨39, of_decide_eq_true rfl⟩ : Terminal)) [Tok.GEQ] :=
+ (.T (⟨39, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.GEQ, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.GEQ))
+ (.terminal (G := grammarInst) (⟨Tok.GEQ, span⟩))
/-- Terminal parse tree for `GT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenGT :
+noncomputable def parseTreeTokenGT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨40, of_decide_eq_true rfl⟩ : Terminal)) [Tok.GT] :=
+ (.T (⟨40, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.GT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.GT))
+ (.terminal (G := grammarInst) (⟨Tok.GT, span⟩))
/-- Terminal parse tree for `OR` with its concrete grammar index. -/
-noncomputable def parseTreeTokenOR :
+noncomputable def parseTreeTokenOR
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨41, of_decide_eq_true rfl⟩ : Terminal)) [Tok.OR] :=
+ (.T (⟨41, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.OR, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.OR))
+ (.terminal (G := grammarInst) (⟨Tok.OR, span⟩))
/-- Terminal parse tree for `AND` with its concrete grammar index. -/
-noncomputable def parseTreeTokenAND :
+noncomputable def parseTreeTokenAND
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨42, of_decide_eq_true rfl⟩ : Terminal)) [Tok.AND] :=
+ (.T (⟨42, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.AND, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.AND))
+ (.terminal (G := grammarInst) (⟨Tok.AND, span⟩))
/-- Terminal parse tree for `PLUS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPLUS :
+noncomputable def parseTreeTokenPLUS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨43, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PLUS] :=
+ (.T (⟨43, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PLUS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PLUS))
+ (.terminal (G := grammarInst) (⟨Tok.PLUS, span⟩))
/-- Terminal parse tree for `MINUS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenMINUS :
+noncomputable def parseTreeTokenMINUS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨44, of_decide_eq_true rfl⟩ : Terminal)) [Tok.MINUS] :=
+ (.T (⟨44, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.MINUS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.MINUS))
+ (.terminal (G := grammarInst) (⟨Tok.MINUS, span⟩))
/-- Terminal parse tree for `STAR` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSTAR :
+noncomputable def parseTreeTokenSTAR
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨45, of_decide_eq_true rfl⟩ : Terminal)) [Tok.STAR] :=
+ (.T (⟨45, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.STAR, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.STAR))
+ (.terminal (G := grammarInst) (⟨Tok.STAR, span⟩))
/-- Terminal parse tree for `SLASH` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSLASH :
+noncomputable def parseTreeTokenSLASH
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨46, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SLASH] :=
+ (.T (⟨46, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SLASH, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SLASH))
+ (.terminal (G := grammarInst) (⟨Tok.SLASH, span⟩))
/-- Terminal parse tree for `PERCENT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPERCENT :
+noncomputable def parseTreeTokenPERCENT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨47, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PERCENT] :=
+ (.T (⟨47, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PERCENT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PERCENT))
+ (.terminal (G := grammarInst) (⟨Tok.PERCENT, span⟩))
/-- Terminal parse tree for `BANG` with its concrete grammar index. -/
-noncomputable def parseTreeTokenBANG :
+noncomputable def parseTreeTokenBANG
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨48, of_decide_eq_true rfl⟩ : Terminal)) [Tok.BANG] :=
+ (.T (⟨48, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.BANG, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.BANG))
+ (.terminal (G := grammarInst) (⟨Tok.BANG, span⟩))
/-- Terminal parse tree for `SINGLE_EQ` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSINGLE_EQ :
+noncomputable def parseTreeTokenSINGLE_EQ
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨49, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SINGLE_EQ] :=
+ (.T (⟨49, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SINGLE_EQ, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SINGLE_EQ))
+ (.terminal (G := grammarInst) (⟨Tok.SINGLE_EQ, span⟩))
/-- Terminal parse tree for `EOF` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEOF :
+noncomputable def parseTreeTokenEOF
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨51, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EOF] :=
+ (.T (⟨51, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EOF, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EOF))
+ (.terminal (G := grammarInst) (⟨Tok.EOF, span⟩))
/-- Parse-tree constructor for production 0, in source RHS order. -/
noncomputable def parseTreeProduction0
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction0_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction0 tree0) = semanticAction0 (Grammar.ptSem tree0) := by
+ (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction0 tree0) = semanticAction0 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction0
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 1, in source RHS order. -/
noncomputable def parseTreeProduction1
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.AT] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1))
+ (([Tok.AT] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)))
@[simp] theorem parseTreeProduction1_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction1 tree1) = semanticAction1 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction1 tree1) = semanticAction1 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AT)])) tree1) (()) := by
unfold parseTreeProduction1
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 2, in source RHS order. -/
noncomputable def parseTreeProduction2
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.AT] ++ word1 ++ [Tok.LPAREN] ++ word3 ++ [Tok.RPAREN]) :=
- .nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN)))
+ (([Tok.AT] ++ word1 ++ [Tok.LPAREN] ++ word3 ++ [Tok.RPAREN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN))))
@[simp] theorem parseTreeProduction2_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction2 tree1 tree3) = semanticAction2 (()) (Grammar.ptSem tree3) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction2 tree1 tree3) = semanticAction2 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AT)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LPAREN)])) tree3) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AT)])) tree1) (()) := by
unfold parseTreeProduction2
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 3, in source RHS order. -/
noncomputable def parseTreeProduction3
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
+ (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1 ++ [Tok.LPAREN] ++ word3 ++ [Tok.RPAREN] ++ word5 ++ [Tok.SEMICOLON]) :=
- .nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN))) (tree5)) ((parseTreeTokenSEMICOLON)))
+ ((word0 ++ word1 ++ [Tok.LPAREN] ++ word3 ++ [Tok.RPAREN] ++ word5 ++ [Tok.SEMICOLON]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN))) (tree5)) ((parseTreeTokenSEMICOLON))))
@[simp] theorem parseTreeProduction3_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
- Grammar.ptSem (parseTreeProduction3 tree0 tree1 tree3 tree5) = semanticAction3 (()) (Grammar.ptSem tree5) (()) (Grammar.ptSem tree3) (()) (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction3 tree0 tree1 tree3 tree5) = semanticAction3 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN))) (tree5)) ((parseTreeTokenSEMICOLON)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LPAREN)] ++ word3.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.RPAREN)])) tree5) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LPAREN)])) tree3) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction3
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 4, in source RHS order. -/
noncomputable def parseTreeProduction4 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction4_sem :
- Grammar.ptSem (parseTreeProduction4) = semanticAction4 := by
+@[simp] theorem parseTreeProduction4_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction4) = semanticAction4 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction4
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 5, in source RHS order. -/
noncomputable def parseTreeProduction5
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction5_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction5 tree0 tree1) = semanticAction5 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction5 tree0 tree1) = semanticAction5 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction5
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 6, in source RHS order. -/
noncomputable def parseTreeProduction6 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction6_sem :
- Grammar.ptSem (parseTreeProduction6) = semanticAction6 := by
+@[simp] theorem parseTreeProduction6_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction6) = semanticAction6 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction6
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 7, in source RHS order. -/
noncomputable def parseTreeProduction7 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction7_sem :
- Grammar.ptSem (parseTreeProduction7) = semanticAction7 (()) := by
+@[simp] theorem parseTreeProduction7_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction7) = semanticAction7 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction7
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 8, in source RHS order. -/
noncomputable def parseTreeProduction8
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨8, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))
+ (([Tok.COMMA] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨8, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction8_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction8 tree1 tree2) = semanticAction8 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction8 tree1 tree2) = semanticAction8 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction8
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 9, in source RHS order. -/
noncomputable def parseTreeProduction9
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1 ++ word2 ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨9, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)) (tree3))
+ ((word0 ++ word1 ++ word2 ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨9, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)) (tree3)))
@[simp] theorem parseTreeProduction9_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction9 tree0 tree1 tree2 tree3) = semanticAction9 (Grammar.ptSem tree3) (Grammar.ptSem tree2) (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction9 tree0 tree1 tree2 tree3) = semanticAction9 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy)) tree3) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction9
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 10, in source RHS order. -/
noncomputable def parseTreeProduction10 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨10, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨10, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction10_sem :
- Grammar.ptSem (parseTreeProduction10) = semanticAction10 := by
+@[simp] theorem parseTreeProduction10_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction10) = semanticAction10 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction10
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 11, in source RHS order. -/
noncomputable def parseTreeProduction11
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COLON] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨11, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOLON))) (tree1))
+ (([Tok.COLON] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨11, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOLON))) (tree1)))
@[simp] theorem parseTreeProduction11_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction11 tree1) = semanticAction11 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction11 tree1) = semanticAction11 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenCOLON))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree1) (()) := by
unfold parseTreeProduction11
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 12, in source RHS order. -/
noncomputable def parseTreeProduction12 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨12, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨12, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction12_sem :
- Grammar.ptSem (parseTreeProduction12) = semanticAction12 := by
+@[simp] theorem parseTreeProduction12_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction12) = semanticAction12 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction12
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 13, in source RHS order. -/
noncomputable def parseTreeProduction13
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IS] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨13, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIS))) (tree1))
+ (([Tok.IS] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨13, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIS))) (tree1)))
@[simp] theorem parseTreeProduction13_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction13 tree1) = semanticAction13 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction13 tree1) = semanticAction13 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenIS))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IS)])) tree1) (()) := by
unfold parseTreeProduction13
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 14, in source RHS order. -/
noncomputable def parseTreeProduction14 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨14, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨14, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction14_sem :
- Grammar.ptSem (parseTreeProduction14) = semanticAction14 := by
+@[simp] theorem parseTreeProduction14_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction14) = semanticAction14 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction14
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 15, in source RHS order. -/
noncomputable def parseTreeProduction15
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨15, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨15, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction15_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction15 tree0 tree1) = semanticAction15 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction15 tree0 tree1) = semanticAction15 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction15
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 16, in source RHS order. -/
noncomputable def parseTreeProduction16
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.LBRACE] ++ word2 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨16, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE)))
+ ((word0 ++ [Tok.LBRACE] ++ word2 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨16, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction16_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction16 tree0 tree2) = semanticAction16 (()) (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction16 tree0 tree2) = semanticAction16 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction16
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 17, in source RHS order. -/
noncomputable def parseTreeProduction17
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨17, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨17, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction17_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction17 tree0) = semanticAction17 (Grammar.ptSem tree0) := by
+ (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction17 tree0) = semanticAction17 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction17
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 18, in source RHS order. -/
noncomputable def parseTreeProduction18
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IF] ++ word1 ++ [Tok.THEN] ++ word3 ++ [Tok.ELSE] ++ word5) :=
- .nonTerminal (G := grammarInst) (⟨18, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) (tree1)) ((parseTreeTokenTHEN))) (tree3)) ((parseTreeTokenELSE))) (tree5))
+ (([Tok.IF] ++ word1 ++ [Tok.THEN] ++ word3 ++ [Tok.ELSE] ++ word5).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨18, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) (tree1)) ((parseTreeTokenTHEN))) (tree3)) ((parseTreeTokenELSE))) (tree5)))
@[simp] theorem parseTreeProduction18_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
- Grammar.ptSem (parseTreeProduction18 tree1 tree3 tree5) = semanticAction18 (Grammar.ptSem tree5) (()) (Grammar.ptSem tree3) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction18 tree1 tree3 tree5) = semanticAction18 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) (tree1)) ((parseTreeTokenTHEN))) (tree3)) ((parseTreeTokenELSE))) (tree5))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.THEN)] ++ word3.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.ELSE)])) tree5) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.THEN)])) tree3) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)])) tree1) (()) := by
unfold parseTreeProduction18
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 19, in source RHS order. -/
noncomputable def parseTreeProduction19
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨19, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨19, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction19_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction19 tree0 tree1) = semanticAction19 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction19 tree0 tree1) = semanticAction19 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction19
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 20, in source RHS order. -/
noncomputable def parseTreeProduction20 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨20, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨20, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction20_sem :
- Grammar.ptSem (parseTreeProduction20) = semanticAction20 := by
+@[simp] theorem parseTreeProduction20_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction20) = semanticAction20 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction20
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 21, in source RHS order. -/
noncomputable def parseTreeProduction21
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.OR] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨21, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenOR))) (tree1)) (tree2))
+ (([Tok.OR] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨21, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenOR))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction21_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction21 tree1 tree2) = semanticAction21 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction21 tree1 tree2) = semanticAction21 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenOR))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.OR)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.OR)])) tree1) (()) := by
unfold parseTreeProduction21
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 22, in source RHS order. -/
noncomputable def parseTreeProduction22
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨22, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨22, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction22_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction22 tree0 tree1) = semanticAction22 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction22 tree0 tree1) = semanticAction22 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction22
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 23, in source RHS order. -/
noncomputable def parseTreeProduction23 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨23, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨23, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction23_sem :
- Grammar.ptSem (parseTreeProduction23) = semanticAction23 := by
+@[simp] theorem parseTreeProduction23_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction23) = semanticAction23 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction23
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 24, in source RHS order. -/
noncomputable def parseTreeProduction24
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.AND] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨24, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenAND))) (tree1)) (tree2))
+ (([Tok.AND] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨24, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenAND))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction24_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction24 tree1 tree2) = semanticAction24 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction24 tree1 tree2) = semanticAction24 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenAND))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AND)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AND)])) tree1) (()) := by
unfold parseTreeProduction24
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 25, in source RHS order. -/
noncomputable def parseTreeProduction25
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.HAS] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨25, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenHAS))) (tree2))
+ ((word0 ++ [Tok.HAS] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨25, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenHAS))) (tree2)))
@[simp] theorem parseTreeProduction25_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction25 tree0 tree2) = semanticAction25 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction25 tree0 tree2) = semanticAction25 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenHAS))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.HAS)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction25
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 26, in source RHS order. -/
noncomputable def parseTreeProduction26
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.HAS] ++ [Tok.IF] ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨26, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenHAS))) ((parseTreeTokenIF))) (tree3))
+ ((word0 ++ [Tok.HAS] ++ [Tok.IF] ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨26, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenHAS))) ((parseTreeTokenIF))) (tree3)))
@[simp] theorem parseTreeProduction26_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction26 tree0 tree3) = semanticAction26 (Grammar.ptSem tree3) (()) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction26 tree0 tree3) = semanticAction26 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenHAS))) ((parseTreeTokenIF))) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.HAS)] ++ [Runtime.Positioned.dummy (Tok.IF)])) tree3) (()) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction26
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 27, in source RHS order. -/
noncomputable def parseTreeProduction27
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.LIKE] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨27, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLIKE))) (tree2))
+ ((word0 ++ [Tok.LIKE] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨27, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLIKE))) (tree2)))
@[simp] theorem parseTreeProduction27_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction27 tree0 tree2) = semanticAction27 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction27 tree0 tree2) = semanticAction27 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLIKE))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LIKE)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction27
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 28, in source RHS order. -/
noncomputable def parseTreeProduction28
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.IS] ++ word2 ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨28, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenIS))) (tree2)) (tree3))
+ ((word0 ++ [Tok.IS] ++ word2 ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨28, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenIS))) (tree2)) (tree3)))
@[simp] theorem parseTreeProduction28_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction28 tree0 tree2 tree3) = semanticAction28 (Grammar.ptSem tree3) (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction28 tree0 tree2 tree3) = semanticAction28 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenIS))) (tree2)) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.IS)] ++ word2.map Runtime.Positioned.dummy)) tree3) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.IS)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction28
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 29, in source RHS order. -/
noncomputable def parseTreeProduction29
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨29, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨29, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction29_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction29 tree0 tree1) = semanticAction29 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction29 tree0 tree1) = semanticAction29 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction29
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 30, in source RHS order. -/
noncomputable def parseTreeProduction30 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨30, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨30, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction30_sem :
- Grammar.ptSem (parseTreeProduction30) = semanticAction30 := by
+@[simp] theorem parseTreeProduction30_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction30) = semanticAction30 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction30
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 31, in source RHS order. -/
noncomputable def parseTreeProduction31
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨31, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2))
+ ((word0 ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨31, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction31_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction31 tree0 tree1 tree2) = semanticAction31 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction31 tree0 tree1 tree2) = semanticAction31 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction31
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 32, in source RHS order. -/
noncomputable def parseTreeProduction32 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨32, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨32, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction32_sem :
- Grammar.ptSem (parseTreeProduction32) = semanticAction32 := by
+@[simp] theorem parseTreeProduction32_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction32) = semanticAction32 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction32
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 33, in source RHS order. -/
noncomputable def parseTreeProduction33
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IN] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨33, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1))
+ (([Tok.IN] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨33, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1)))
@[simp] theorem parseTreeProduction33_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction33 tree1) = semanticAction33 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction33 tree1) = semanticAction33 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IN)])) tree1) (()) := by
unfold parseTreeProduction33
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 34, in source RHS order. -/
noncomputable def parseTreeProduction34 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LT]) :=
- .nonTerminal (G := grammarInst) (⟨34, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLT)))
+ (([Tok.LT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨34, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLT))))
-@[simp] theorem parseTreeProduction34_sem :
- Grammar.ptSem (parseTreeProduction34) = semanticAction34 (()) := by
+@[simp] theorem parseTreeProduction34_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction34) = semanticAction34 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenLT)))) (()) := by
unfold parseTreeProduction34
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 35, in source RHS order. -/
noncomputable def parseTreeProduction35 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LEQ]) :=
- .nonTerminal (G := grammarInst) (⟨35, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLEQ)))
+ (([Tok.LEQ]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨35, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLEQ))))
-@[simp] theorem parseTreeProduction35_sem :
- Grammar.ptSem (parseTreeProduction35) = semanticAction35 (()) := by
+@[simp] theorem parseTreeProduction35_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction35) = semanticAction35 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenLEQ)))) (()) := by
unfold parseTreeProduction35
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 36, in source RHS order. -/
noncomputable def parseTreeProduction36 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.GEQ]) :=
- .nonTerminal (G := grammarInst) (⟨36, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenGEQ)))
+ (([Tok.GEQ]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨36, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenGEQ))))
-@[simp] theorem parseTreeProduction36_sem :
- Grammar.ptSem (parseTreeProduction36) = semanticAction36 (()) := by
+@[simp] theorem parseTreeProduction36_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction36) = semanticAction36 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenGEQ)))) (()) := by
unfold parseTreeProduction36
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 37, in source RHS order. -/
noncomputable def parseTreeProduction37 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.GT]) :=
- .nonTerminal (G := grammarInst) (⟨37, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenGT)))
+ (([Tok.GT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨37, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenGT))))
-@[simp] theorem parseTreeProduction37_sem :
- Grammar.ptSem (parseTreeProduction37) = semanticAction37 (()) := by
+@[simp] theorem parseTreeProduction37_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction37) = semanticAction37 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenGT)))) (()) := by
unfold parseTreeProduction37
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 38, in source RHS order. -/
noncomputable def parseTreeProduction38 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NEQ]) :=
- .nonTerminal (G := grammarInst) (⟨38, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNEQ)))
+ (([Tok.NEQ]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨38, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNEQ))))
-@[simp] theorem parseTreeProduction38_sem :
- Grammar.ptSem (parseTreeProduction38) = semanticAction38 (()) := by
+@[simp] theorem parseTreeProduction38_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction38) = semanticAction38 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenNEQ)))) (()) := by
unfold parseTreeProduction38
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 39, in source RHS order. -/
noncomputable def parseTreeProduction39 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.EQ]) :=
- .nonTerminal (G := grammarInst) (⟨39, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenEQ)))
+ (([Tok.EQ]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨39, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenEQ))))
-@[simp] theorem parseTreeProduction39_sem :
- Grammar.ptSem (parseTreeProduction39) = semanticAction39 (()) := by
+@[simp] theorem parseTreeProduction39_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction39) = semanticAction39 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenEQ)))) (()) := by
unfold parseTreeProduction39
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 40, in source RHS order. -/
noncomputable def parseTreeProduction40 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IN]) :=
- .nonTerminal (G := grammarInst) (⟨40, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIN)))
+ (([Tok.IN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨40, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIN))))
-@[simp] theorem parseTreeProduction40_sem :
- Grammar.ptSem (parseTreeProduction40) = semanticAction40 (()) := by
+@[simp] theorem parseTreeProduction40_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction40) = semanticAction40 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIN)))) (()) := by
unfold parseTreeProduction40
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 41, in source RHS order. -/
noncomputable def parseTreeProduction41 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.SINGLE_EQ]) :=
- .nonTerminal (G := grammarInst) (⟨41, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSINGLE_EQ)))
+ (([Tok.SINGLE_EQ]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨41, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSINGLE_EQ))))
-@[simp] theorem parseTreeProduction41_sem :
- Grammar.ptSem (parseTreeProduction41) = semanticAction41 (()) := by
+@[simp] theorem parseTreeProduction41_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction41) = semanticAction41 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSINGLE_EQ)))) (()) := by
unfold parseTreeProduction41
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 42, in source RHS order. -/
noncomputable def parseTreeProduction42 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PLUS]) :=
- .nonTerminal (G := grammarInst) (⟨42, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPLUS)))
+ (([Tok.PLUS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨42, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPLUS))))
-@[simp] theorem parseTreeProduction42_sem :
- Grammar.ptSem (parseTreeProduction42) = semanticAction42 (()) := by
+@[simp] theorem parseTreeProduction42_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction42) = semanticAction42 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPLUS)))) (()) := by
unfold parseTreeProduction42
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 43, in source RHS order. -/
noncomputable def parseTreeProduction43 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS]) :=
- .nonTerminal (G := grammarInst) (⟨43, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenMINUS)))
+ (([Tok.MINUS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨43, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenMINUS))))
-@[simp] theorem parseTreeProduction43_sem :
- Grammar.ptSem (parseTreeProduction43) = semanticAction43 (()) := by
+@[simp] theorem parseTreeProduction43_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction43) = semanticAction43 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenMINUS)))) (()) := by
unfold parseTreeProduction43
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 44, in source RHS order. -/
noncomputable def parseTreeProduction44 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.STAR]) :=
- .nonTerminal (G := grammarInst) (⟨44, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTAR)))
+ (([Tok.STAR]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨44, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTAR))))
-@[simp] theorem parseTreeProduction44_sem :
- Grammar.ptSem (parseTreeProduction44) = semanticAction44 (()) := by
+@[simp] theorem parseTreeProduction44_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction44) = semanticAction44 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSTAR)))) (()) := by
unfold parseTreeProduction44
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 45, in source RHS order. -/
noncomputable def parseTreeProduction45 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.SLASH]) :=
- .nonTerminal (G := grammarInst) (⟨45, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSLASH)))
+ (([Tok.SLASH]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨45, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSLASH))))
-@[simp] theorem parseTreeProduction45_sem :
- Grammar.ptSem (parseTreeProduction45) = semanticAction45 (()) := by
+@[simp] theorem parseTreeProduction45_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction45) = semanticAction45 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSLASH)))) (()) := by
unfold parseTreeProduction45
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 46, in source RHS order. -/
noncomputable def parseTreeProduction46 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PERCENT]) :=
- .nonTerminal (G := grammarInst) (⟨46, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPERCENT)))
+ (([Tok.PERCENT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨46, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPERCENT))))
-@[simp] theorem parseTreeProduction46_sem :
- Grammar.ptSem (parseTreeProduction46) = semanticAction46 (()) := by
+@[simp] theorem parseTreeProduction46_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction46) = semanticAction46 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPERCENT)))) (()) := by
unfold parseTreeProduction46
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 47, in source RHS order. -/
noncomputable def parseTreeProduction47
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨47, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨47, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction47_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction47 tree0 tree1) = semanticAction47 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction47 tree0 tree1) = semanticAction47 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction47
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 48, in source RHS order. -/
noncomputable def parseTreeProduction48 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨48, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨48, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction48_sem :
- Grammar.ptSem (parseTreeProduction48) = semanticAction48 := by
+@[simp] theorem parseTreeProduction48_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction48) = semanticAction48 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction48
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 49, in source RHS order. -/
noncomputable def parseTreeProduction49
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨49, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2))
+ ((word0 ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨49, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction49_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction49 tree0 tree1 tree2) = semanticAction49 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction49 tree0 tree1 tree2) = semanticAction49 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction49
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 50, in source RHS order. -/
noncomputable def parseTreeProduction50
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨50, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨50, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction50_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction50 tree0 tree1) = semanticAction50 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction50 tree0 tree1) = semanticAction50 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction50
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 51, in source RHS order. -/
noncomputable def parseTreeProduction51 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨51, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨51, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction51_sem :
- Grammar.ptSem (parseTreeProduction51) = semanticAction51 := by
+@[simp] theorem parseTreeProduction51_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction51) = semanticAction51 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction51
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 52, in source RHS order. -/
noncomputable def parseTreeProduction52
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨52, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2))
+ ((word0 ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨52, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction52_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction52 tree0 tree1 tree2) = semanticAction52 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction52 tree0 tree1 tree2) = semanticAction52 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction52
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 53, in source RHS order. -/
noncomputable def parseTreeProduction53
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨53, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨53, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction53_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction53 tree0) = semanticAction53 (Grammar.ptSem tree0) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction53 tree0) = semanticAction53 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction53
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 54, in source RHS order. -/
noncomputable def parseTreeProduction54
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨54, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenBANG))) (tree1))
+ (([Tok.BANG] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨54, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenBANG))) (tree1)))
@[simp] theorem parseTreeProduction54_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction54 tree1) = semanticAction54 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction54 tree1) = semanticAction54 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenBANG))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)])) tree1) (()) := by
unfold parseTreeProduction54
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 55, in source RHS order. -/
noncomputable def parseTreeProduction55
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG] ++ [Tok.BANG] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨55, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree2))
+ (([Tok.BANG] ++ [Tok.BANG] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨55, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree2)))
@[simp] theorem parseTreeProduction55_sem
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction55 tree2) = semanticAction55 (Grammar.ptSem tree2) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction55 tree2) = semanticAction55 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)])) tree2) (()) (()) := by
unfold parseTreeProduction55
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 56, in source RHS order. -/
noncomputable def parseTreeProduction56
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨56, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree3))
+ (([Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨56, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree3)))
@[simp] theorem parseTreeProduction56_sem
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction56 tree3) = semanticAction56 (Grammar.ptSem tree3) (()) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction56 tree3) = semanticAction56 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)])) tree3) (()) (()) (()) := by
unfold parseTreeProduction56
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 57, in source RHS order. -/
noncomputable def parseTreeProduction57
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ word4) :=
- .nonTerminal (G := grammarInst) (⟨57, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree4))
+ (([Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ word4).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨57, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree4)))
@[simp] theorem parseTreeProduction57_sem
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction57 tree4) = semanticAction57 (Grammar.ptSem tree4) (()) (()) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction57 tree4) = semanticAction57 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree4))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)])) tree4) (()) (()) (()) (()) := by
unfold parseTreeProduction57
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 58, in source RHS order. -/
noncomputable def parseTreeProduction58
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ word4 ++ word5) :=
- .nonTerminal (G := grammarInst) (⟨58, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree4)) (tree5))
+ (([Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ [Tok.BANG] ++ word4 ++ word5).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨58, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree4)) (tree5)))
@[simp] theorem parseTreeProduction58_sem
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
- Grammar.ptSem (parseTreeProduction58 tree4 tree5) = semanticAction58 (Grammar.ptSem tree5) (Grammar.ptSem tree4) (()) (()) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction58 tree4 tree5) = semanticAction58 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) ((parseTreeTokenBANG))) (tree4)) (tree5))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ word4.map Runtime.Positioned.dummy)) tree5) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)] ++ [Runtime.Positioned.dummy (Tok.BANG)])) tree4) (()) (()) (()) (()) := by
unfold parseTreeProduction58
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 59, in source RHS order. -/
noncomputable def parseTreeProduction59
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨59, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenMINUS))) (tree1))
+ (([Tok.MINUS] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨59, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenMINUS))) (tree1)))
@[simp] theorem parseTreeProduction59_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction59 tree1) = semanticAction59 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction59 tree1) = semanticAction59 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenMINUS))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree1) (()) := by
unfold parseTreeProduction59
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 60, in source RHS order. -/
noncomputable def parseTreeProduction60
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS] ++ [Tok.MINUS] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨60, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree2))
+ (([Tok.MINUS] ++ [Tok.MINUS] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨60, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree2)))
@[simp] theorem parseTreeProduction60_sem
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction60 tree2) = semanticAction60 (Grammar.ptSem tree2) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction60 tree2) = semanticAction60 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree2) (()) (()) := by
unfold parseTreeProduction60
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 61, in source RHS order. -/
noncomputable def parseTreeProduction61
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨61, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree3))
+ (([Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨61, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree3)))
@[simp] theorem parseTreeProduction61_sem
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction61 tree3) = semanticAction61 (Grammar.ptSem tree3) (()) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction61 tree3) = semanticAction61 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree3) (()) (()) (()) := by
unfold parseTreeProduction61
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 62, in source RHS order. -/
noncomputable def parseTreeProduction62
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ word4) :=
- .nonTerminal (G := grammarInst) (⟨62, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree4))
+ (([Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ word4).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨62, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree4)))
@[simp] theorem parseTreeProduction62_sem
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction62 tree4) = semanticAction62 (Grammar.ptSem tree4) (()) (()) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction62 tree4) = semanticAction62 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree4))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree4) (()) (()) (()) (()) := by
unfold parseTreeProduction62
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 63, in source RHS order. -/
noncomputable def parseTreeProduction63
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ word4 ++ word5) :=
- .nonTerminal (G := grammarInst) (⟨63, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree4)) (tree5))
+ (([Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ [Tok.MINUS] ++ word4 ++ word5).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨63, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree4)) (tree5)))
@[simp] theorem parseTreeProduction63_sem
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
- Grammar.ptSem (parseTreeProduction63 tree4 tree5) = semanticAction63 (Grammar.ptSem tree5) (Grammar.ptSem tree4) (()) (()) (()) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction63 tree4 tree5) = semanticAction63 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) ((parseTreeTokenMINUS))) (tree4)) (tree5))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ word4.map Runtime.Positioned.dummy)) tree5) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)] ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree4) (()) (()) (()) (()) := by
unfold parseTreeProduction63
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 64, in source RHS order. -/
noncomputable def parseTreeProduction64 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG]) :=
- .nonTerminal (G := grammarInst) (⟨64, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenBANG)))
+ (([Tok.BANG]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨64, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenBANG))))
-@[simp] theorem parseTreeProduction64_sem :
- Grammar.ptSem (parseTreeProduction64) = semanticAction64 (()) := by
+@[simp] theorem parseTreeProduction64_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction64) = semanticAction64 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenBANG)))) (()) := by
unfold parseTreeProduction64
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 65, in source RHS order. -/
noncomputable def parseTreeProduction65
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BANG] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨65, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenBANG))) (tree1))
+ (([Tok.BANG] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨65, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenBANG))) (tree1)))
@[simp] theorem parseTreeProduction65_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction65 tree1) = semanticAction65 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction65 tree1) = semanticAction65 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenBANG))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.BANG)])) tree1) (()) := by
unfold parseTreeProduction65
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 66, in source RHS order. -/
noncomputable def parseTreeProduction66 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS]) :=
- .nonTerminal (G := grammarInst) (⟨66, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenMINUS)))
+ (([Tok.MINUS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨66, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenMINUS))))
-@[simp] theorem parseTreeProduction66_sem :
- Grammar.ptSem (parseTreeProduction66) = semanticAction66 (()) := by
+@[simp] theorem parseTreeProduction66_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction66) = semanticAction66 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenMINUS)))) (()) := by
unfold parseTreeProduction66
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 67, in source RHS order. -/
noncomputable def parseTreeProduction67
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.MINUS] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨67, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenMINUS))) (tree1))
+ (([Tok.MINUS] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨67, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenMINUS))) (tree1)))
@[simp] theorem parseTreeProduction67_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction67 tree1) = semanticAction67 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction67 tree1) = semanticAction67 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenMINUS))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree1) (()) := by
unfold parseTreeProduction67
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 68, in source RHS order. -/
noncomputable def parseTreeProduction68
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨68, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨68, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction68_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction68 tree0 tree1) = semanticAction68 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction68 tree0 tree1) = semanticAction68 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction68
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 69, in source RHS order. -/
noncomputable def parseTreeProduction69
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.DOT] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨69, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenDOT))) (tree1))
+ (([Tok.DOT] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨69, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenDOT))) (tree1)))
@[simp] theorem parseTreeProduction69_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction69 tree1) = semanticAction69 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction69 tree1) = semanticAction69 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenDOT))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.DOT)])) tree1) (()) := by
unfold parseTreeProduction69
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 70, in source RHS order. -/
noncomputable def parseTreeProduction70
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LPAREN] ++ word1 ++ [Tok.RPAREN]) :=
- .nonTerminal (G := grammarInst) (⟨70, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAREN))) (tree1)) ((parseTreeTokenRPAREN)))
+ (([Tok.LPAREN] ++ word1 ++ [Tok.RPAREN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨70, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAREN))) (tree1)) ((parseTreeTokenRPAREN))))
@[simp] theorem parseTreeProduction70_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction70 tree1) = semanticAction70 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction70 tree1) = semanticAction70 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAREN))) (tree1)) ((parseTreeTokenRPAREN)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LPAREN)])) tree1) (()) := by
unfold parseTreeProduction70
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 71, in source RHS order. -/
noncomputable def parseTreeProduction71
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]) :=
- .nonTerminal (G := grammarInst) (⟨71, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))
+ (([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨71, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET))))
@[simp] theorem parseTreeProduction71_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction71 tree1) = semanticAction71 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction71 tree1) = semanticAction71 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACKET)])) tree1) (()) := by
unfold parseTreeProduction71
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 72, in source RHS order. -/
noncomputable def parseTreeProduction72
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨72, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨72, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction72_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction72 tree0) = semanticAction72 (Grammar.ptSem tree0) := by
+ (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction72 tree0) = semanticAction72 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction72
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 73, in source RHS order. -/
noncomputable def parseTreeProduction73
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨73, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨73, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction73_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction73 tree0) = semanticAction73 (Grammar.ptSem tree0) := by
+ (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction73 tree0) = semanticAction73 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction73
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 74, in source RHS order. -/
noncomputable def parseTreeProduction74 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PRINCIPAL_SLOT]) :=
- .nonTerminal (G := grammarInst) (⟨74, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL_SLOT)))
+ (([Tok.PRINCIPAL_SLOT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨74, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL_SLOT))))
-@[simp] theorem parseTreeProduction74_sem :
- Grammar.ptSem (parseTreeProduction74) = semanticAction74 (()) := by
+@[simp] theorem parseTreeProduction74_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction74) = semanticAction74 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPRINCIPAL_SLOT)))) (()) := by
unfold parseTreeProduction74
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 75, in source RHS order. -/
noncomputable def parseTreeProduction75 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.RESOURCE_SLOT]) :=
- .nonTerminal (G := grammarInst) (⟨75, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE_SLOT)))
+ (([Tok.RESOURCE_SLOT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨75, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE_SLOT))))
-@[simp] theorem parseTreeProduction75_sem :
- Grammar.ptSem (parseTreeProduction75) = semanticAction75 (()) := by
+@[simp] theorem parseTreeProduction75_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction75) = semanticAction75 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenRESOURCE_SLOT)))) (()) := by
unfold parseTreeProduction75
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 76, in source RHS order. -/
@@ -3095,703 +3307,775 @@ noncomputable def parseTreeProduction76
(value0 : String) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.OTHER_SLOT value0]) :=
- .nonTerminal (G := grammarInst) (⟨76, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenOTHER_SLOT value0)))
+ (([Tok.OTHER_SLOT value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨76, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenOTHER_SLOT value0))))
@[simp] theorem parseTreeProduction76_sem
- (value0 : String) :
- Grammar.ptSem (parseTreeProduction76 value0) = semanticAction76 (value0) := by
+ (value0 : String)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction76 value0) = semanticAction76 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenOTHER_SLOT value0)))) (value0) := by
unfold parseTreeProduction76
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 77, in source RHS order. -/
noncomputable def parseTreeProduction77
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LPAREN] ++ word1 ++ [Tok.RPAREN]) :=
- .nonTerminal (G := grammarInst) (⟨77, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAREN))) (tree1)) ((parseTreeTokenRPAREN)))
+ (([Tok.LPAREN] ++ word1 ++ [Tok.RPAREN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨77, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAREN))) (tree1)) ((parseTreeTokenRPAREN))))
@[simp] theorem parseTreeProduction77_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction77 tree1) = semanticAction77 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction77 tree1) = semanticAction77 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAREN))) (tree1)) ((parseTreeTokenRPAREN)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LPAREN)])) tree1) (()) := by
unfold parseTreeProduction77
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 78, in source RHS order. -/
noncomputable def parseTreeProduction78
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]) :=
- .nonTerminal (G := grammarInst) (⟨78, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))
+ (([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨78, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET))))
@[simp] theorem parseTreeProduction78_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction78 tree1) = semanticAction78 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction78 tree1) = semanticAction78 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACKET)])) tree1) (()) := by
unfold parseTreeProduction78
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 79, in source RHS order. -/
noncomputable def parseTreeProduction79
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACE] ++ word1 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨79, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE)))
+ (([Tok.LBRACE] ++ word1 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨79, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction79_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction79 tree1) = semanticAction79 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction79 tree1) = semanticAction79 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree1) (()) := by
unfold parseTreeProduction79
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 80, in source RHS order. -/
noncomputable def parseTreeProduction80 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨80, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨80, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction80_sem :
- Grammar.ptSem (parseTreeProduction80) = semanticAction80 := by
+@[simp] theorem parseTreeProduction80_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction80) = semanticAction80 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction80
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 81, in source RHS order. -/
noncomputable def parseTreeProduction81
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨81, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨81, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction81_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction81 tree0 tree1) = semanticAction81 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction81 tree0 tree1) = semanticAction81 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction81
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 82, in source RHS order. -/
noncomputable def parseTreeProduction82 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨82, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨82, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction82_sem :
- Grammar.ptSem (parseTreeProduction82) = semanticAction82 := by
+@[simp] theorem parseTreeProduction82_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction82) = semanticAction82 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction82
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 83, in source RHS order. -/
noncomputable def parseTreeProduction83 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨83, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨83, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction83_sem :
- Grammar.ptSem (parseTreeProduction83) = semanticAction83 (()) := by
+@[simp] theorem parseTreeProduction83_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction83) = semanticAction83 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction83
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 84, in source RHS order. -/
noncomputable def parseTreeProduction84
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨84, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))
+ (([Tok.COMMA] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨84, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction84_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction84 tree1 tree2) = semanticAction84 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction84 tree1 tree2) = semanticAction84 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction84
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 85, in source RHS order. -/
noncomputable def parseTreeProduction85 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨85, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨85, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction85_sem :
- Grammar.ptSem (parseTreeProduction85) = semanticAction85 := by
+@[simp] theorem parseTreeProduction85_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction85) = semanticAction85 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction85
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 86, in source RHS order. -/
noncomputable def parseTreeProduction86
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨86, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨86, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction86_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction86 tree0 tree1) = semanticAction86 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction86 tree0 tree1) = semanticAction86 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction86
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 87, in source RHS order. -/
noncomputable def parseTreeProduction87 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨87, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨87, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction87_sem :
- Grammar.ptSem (parseTreeProduction87) = semanticAction87 := by
+@[simp] theorem parseTreeProduction87_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction87) = semanticAction87 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction87
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 88, in source RHS order. -/
noncomputable def parseTreeProduction88 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨88, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨88, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction88_sem :
- Grammar.ptSem (parseTreeProduction88) = semanticAction88 (()) := by
+@[simp] theorem parseTreeProduction88_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction88) = semanticAction88 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction88
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 89, in source RHS order. -/
noncomputable def parseTreeProduction89
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨89, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))
+ (([Tok.COMMA] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨89, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction89_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction89 tree1 tree2) = semanticAction89 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction89 tree1 tree2) = semanticAction89 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction89
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 90, in source RHS order. -/
noncomputable def parseTreeProduction90
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IF] ++ [Tok.COLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨90, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) ((parseTreeTokenCOLON))) (tree2))
+ (([Tok.IF] ++ [Tok.COLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨90, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) ((parseTreeTokenCOLON))) (tree2)))
@[simp] theorem parseTreeProduction90_sem
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction90 tree2) = semanticAction90 (Grammar.ptSem tree2) (()) (()) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction90 tree2) = semanticAction90 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) ((parseTreeTokenCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)] ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree2) (()) (()) := by
unfold parseTreeProduction90
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 91, in source RHS order. -/
noncomputable def parseTreeProduction91
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨91, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2))
+ ((word0 ++ [Tok.COLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨91, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2)))
@[simp] theorem parseTreeProduction91_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction91 tree0 tree2) = semanticAction91 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction91 tree0 tree2) = semanticAction91 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction91
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 92, in source RHS order. -/
noncomputable def parseTreeProduction92
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨92, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨92, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction92_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction92 tree0) = semanticAction92 (Grammar.ptSem tree0) := by
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction92 tree0) = semanticAction92 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction92
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 93, in source RHS order. -/
noncomputable def parseTreeProduction93
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLONCOLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨93, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))
+ ((word0 ++ [Tok.COLONCOLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨93, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)))
@[simp] theorem parseTreeProduction93_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction93 tree0 tree2) = semanticAction93 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction93 tree0 tree2) = semanticAction93 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction93
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 94, in source RHS order. -/
noncomputable def parseTreeProduction94
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLONCOLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨94, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))
+ ((word0 ++ [Tok.COLONCOLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨94, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)))
@[simp] theorem parseTreeProduction94_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction94 tree0 tree2) = semanticAction94 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction94 tree0 tree2) = semanticAction94 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction94
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 95, in source RHS order. -/
noncomputable def parseTreeProduction95
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLONCOLON] ++ word2 ++ [Tok.COLONCOLON] ++ word4) :=
- .nonTerminal (G := grammarInst) (⟨95, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)) ((parseTreeTokenCOLONCOLON))) (tree4))
+ ((word0 ++ [Tok.COLONCOLON] ++ word2 ++ [Tok.COLONCOLON] ++ word4).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨95, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)) ((parseTreeTokenCOLONCOLON))) (tree4)))
@[simp] theorem parseTreeProduction95_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction95 tree0 tree2 tree4) = semanticAction95 (Grammar.ptSem tree4) (()) (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction95 tree0 tree2 tree4) = semanticAction95 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)) ((parseTreeTokenCOLONCOLON))) (tree4))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)] ++ word2.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree4) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction95
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 96, in source RHS order. -/
noncomputable def parseTreeProduction96
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨96, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨96, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction96_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction96 tree0) = semanticAction96 (Grammar.ptSem tree0) := by
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction96 tree0) = semanticAction96 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction96
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 97, in source RHS order. -/
noncomputable def parseTreeProduction97
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨97, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨97, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction97_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction97 tree0) = semanticAction97 (Grammar.ptSem tree0) := by
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction97 tree0) = semanticAction97 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction97
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 98, in source RHS order. -/
noncomputable def parseTreeProduction98
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACE] ++ word1 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨98, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE)))
+ (([Tok.LBRACE] ++ word1 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨98, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction98_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction98 tree1) = semanticAction98 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction98 tree1) = semanticAction98 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree1) (()) := by
unfold parseTreeProduction98
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 99, in source RHS order. -/
noncomputable def parseTreeProduction99
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLONCOLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨99, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))
+ ((word0 ++ [Tok.COLONCOLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨99, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)))
@[simp] theorem parseTreeProduction99_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction99 tree0 tree2) = semanticAction99 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction99 tree0 tree2) = semanticAction99 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction99
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 100, in source RHS order. -/
noncomputable def parseTreeProduction100
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨100, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨100, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction100_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction100 tree0) = semanticAction100 (Grammar.ptSem tree0) := by
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction100 tree0) = semanticAction100 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction100
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 101, in source RHS order. -/
noncomputable def parseTreeProduction101
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLONCOLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨101, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))
+ ((word0 ++ [Tok.COLONCOLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨101, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)))
@[simp] theorem parseTreeProduction101_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction101 tree0 tree2) = semanticAction101 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction101 tree0 tree2) = semanticAction101 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction101
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 102, in source RHS order. -/
noncomputable def parseTreeProduction102
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨102, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨102, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction102_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction102 tree0) = semanticAction102 (Grammar.ptSem tree0) := by
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction102 tree0) = semanticAction102 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction102
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 103, in source RHS order. -/
noncomputable def parseTreeProduction103
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLONCOLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨103, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))
+ ((word0 ++ [Tok.COLONCOLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨103, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2)))
@[simp] theorem parseTreeProduction103_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction103 tree0 tree2) = semanticAction103 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction103 tree0 tree2) = semanticAction103 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLONCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction103
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 104, in source RHS order. -/
noncomputable def parseTreeProduction104 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨104, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨104, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction104_sem :
- Grammar.ptSem (parseTreeProduction104) = semanticAction104 := by
+@[simp] theorem parseTreeProduction104_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction104) = semanticAction104 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction104
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 105, in source RHS order. -/
noncomputable def parseTreeProduction105
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨105, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨105, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction105_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction105 tree0 tree1) = semanticAction105 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction105 tree0 tree1) = semanticAction105 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction105
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 106, in source RHS order. -/
noncomputable def parseTreeProduction106 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨106, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨106, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction106_sem :
- Grammar.ptSem (parseTreeProduction106) = semanticAction106 := by
+@[simp] theorem parseTreeProduction106_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction106) = semanticAction106 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction106
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 107, in source RHS order. -/
noncomputable def parseTreeProduction107 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨107, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨107, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction107_sem :
- Grammar.ptSem (parseTreeProduction107) = semanticAction107 (()) := by
+@[simp] theorem parseTreeProduction107_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction107) = semanticAction107 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction107
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 108, in source RHS order. -/
noncomputable def parseTreeProduction108
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨108, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))
+ (([Tok.COMMA] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨108, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction108_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction108 tree1 tree2) = semanticAction108 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction108 tree1 tree2) = semanticAction108 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction108
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 109, in source RHS order. -/
noncomputable def parseTreeProduction109
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLON] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨109, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2))
+ ((word0 ++ [Tok.COLON] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨109, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2)))
@[simp] theorem parseTreeProduction109_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction109 tree0 tree2) = semanticAction109 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction109 tree0 tree2) = semanticAction109 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction109
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 110, in source RHS order. -/
noncomputable def parseTreeProduction110 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TRUE]) :=
- .nonTerminal (G := grammarInst) (⟨110, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTRUE)))
+ (([Tok.TRUE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨110, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTRUE))))
-@[simp] theorem parseTreeProduction110_sem :
- Grammar.ptSem (parseTreeProduction110) = semanticAction110 (()) := by
+@[simp] theorem parseTreeProduction110_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction110) = semanticAction110 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenTRUE)))) (()) := by
unfold parseTreeProduction110
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 111, in source RHS order. -/
noncomputable def parseTreeProduction111 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.FALSE]) :=
- .nonTerminal (G := grammarInst) (⟨111, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFALSE)))
+ (([Tok.FALSE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨111, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFALSE))))
-@[simp] theorem parseTreeProduction111_sem :
- Grammar.ptSem (parseTreeProduction111) = semanticAction111 (()) := by
+@[simp] theorem parseTreeProduction111_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction111) = semanticAction111 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenFALSE)))) (()) := by
unfold parseTreeProduction111
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 112, in source RHS order. -/
@@ -3799,33 +4083,37 @@ noncomputable def parseTreeProduction112
(value0 : Nat) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NUMBER value0]) :=
- .nonTerminal (G := grammarInst) (⟨112, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNUMBER value0)))
+ (([Tok.NUMBER value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨112, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNUMBER value0))))
@[simp] theorem parseTreeProduction112_sem
- (value0 : Nat) :
- Grammar.ptSem (parseTreeProduction112 value0) = semanticAction112 (value0) := by
+ (value0 : Nat)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction112 value0) = semanticAction112 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenNUMBER value0)))) (value0) := by
unfold parseTreeProduction112
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 113, in source RHS order. -/
noncomputable def parseTreeProduction113
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨113, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨113, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction113_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction113 tree0) = semanticAction113 (Grammar.ptSem tree0) := by
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction113 tree0) = semanticAction113 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction113
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 114, in source RHS order. -/
@@ -3833,196 +4121,226 @@ noncomputable def parseTreeProduction114
(value0 : String) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.STRINGLIT value0]) :=
- .nonTerminal (G := grammarInst) (⟨114, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTRINGLIT value0)))
+ (([Tok.STRINGLIT value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨114, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTRINGLIT value0))))
@[simp] theorem parseTreeProduction114_sem
- (value0 : String) :
- Grammar.ptSem (parseTreeProduction114 value0) = semanticAction114 (value0) := by
+ (value0 : String)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction114 value0) = semanticAction114 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSTRINGLIT value0)))) (value0) := by
unfold parseTreeProduction114
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 115, in source RHS order. -/
noncomputable def parseTreeProduction115 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PRINCIPAL]) :=
- .nonTerminal (G := grammarInst) (⟨115, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL)))
+ (([Tok.PRINCIPAL]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨115, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL))))
-@[simp] theorem parseTreeProduction115_sem :
- Grammar.ptSem (parseTreeProduction115) = semanticAction115 (()) := by
+@[simp] theorem parseTreeProduction115_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction115) = semanticAction115 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPRINCIPAL)))) (()) := by
unfold parseTreeProduction115
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 116, in source RHS order. -/
noncomputable def parseTreeProduction116 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ACTION]) :=
- .nonTerminal (G := grammarInst) (⟨116, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenACTION)))
+ (([Tok.ACTION]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨116, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenACTION))))
-@[simp] theorem parseTreeProduction116_sem :
- Grammar.ptSem (parseTreeProduction116) = semanticAction116 (()) := by
+@[simp] theorem parseTreeProduction116_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction116) = semanticAction116 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenACTION)))) (()) := by
unfold parseTreeProduction116
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 117, in source RHS order. -/
noncomputable def parseTreeProduction117 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.RESOURCE]) :=
- .nonTerminal (G := grammarInst) (⟨117, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE)))
+ (([Tok.RESOURCE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨117, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE))))
-@[simp] theorem parseTreeProduction117_sem :
- Grammar.ptSem (parseTreeProduction117) = semanticAction117 (()) := by
+@[simp] theorem parseTreeProduction117_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction117) = semanticAction117 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenRESOURCE)))) (()) := by
unfold parseTreeProduction117
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 118, in source RHS order. -/
noncomputable def parseTreeProduction118 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.CONTEXT]) :=
- .nonTerminal (G := grammarInst) (⟨118, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCONTEXT)))
+ (([Tok.CONTEXT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨118, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCONTEXT))))
-@[simp] theorem parseTreeProduction118_sem :
- Grammar.ptSem (parseTreeProduction118) = semanticAction118 (()) := by
+@[simp] theorem parseTreeProduction118_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction118) = semanticAction118 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCONTEXT)))) (()) := by
unfold parseTreeProduction118
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 119, in source RHS order. -/
noncomputable def parseTreeProduction119 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PERMIT]) :=
- .nonTerminal (G := grammarInst) (⟨119, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPERMIT)))
+ (([Tok.PERMIT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨119, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPERMIT))))
-@[simp] theorem parseTreeProduction119_sem :
- Grammar.ptSem (parseTreeProduction119) = semanticAction119 (()) := by
+@[simp] theorem parseTreeProduction119_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction119) = semanticAction119 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPERMIT)))) (()) := by
unfold parseTreeProduction119
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 120, in source RHS order. -/
noncomputable def parseTreeProduction120 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.FORBID]) :=
- .nonTerminal (G := grammarInst) (⟨120, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFORBID)))
+ (([Tok.FORBID]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨120, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFORBID))))
-@[simp] theorem parseTreeProduction120_sem :
- Grammar.ptSem (parseTreeProduction120) = semanticAction120 (()) := by
+@[simp] theorem parseTreeProduction120_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction120) = semanticAction120 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenFORBID)))) (()) := by
unfold parseTreeProduction120
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 121, in source RHS order. -/
noncomputable def parseTreeProduction121 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.WHEN]) :=
- .nonTerminal (G := grammarInst) (⟨121, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenWHEN)))
+ (([Tok.WHEN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨121, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenWHEN))))
-@[simp] theorem parseTreeProduction121_sem :
- Grammar.ptSem (parseTreeProduction121) = semanticAction121 (()) := by
+@[simp] theorem parseTreeProduction121_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction121) = semanticAction121 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenWHEN)))) (()) := by
unfold parseTreeProduction121
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 122, in source RHS order. -/
noncomputable def parseTreeProduction122 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.UNLESS]) :=
- .nonTerminal (G := grammarInst) (⟨122, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenUNLESS)))
+ (([Tok.UNLESS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨122, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenUNLESS))))
-@[simp] theorem parseTreeProduction122_sem :
- Grammar.ptSem (parseTreeProduction122) = semanticAction122 (()) := by
+@[simp] theorem parseTreeProduction122_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction122) = semanticAction122 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenUNLESS)))) (()) := by
unfold parseTreeProduction122
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 123, in source RHS order. -/
noncomputable def parseTreeProduction123 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IN]) :=
- .nonTerminal (G := grammarInst) (⟨123, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIN)))
+ (([Tok.IN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨123, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIN))))
-@[simp] theorem parseTreeProduction123_sem :
- Grammar.ptSem (parseTreeProduction123) = semanticAction123 (()) := by
+@[simp] theorem parseTreeProduction123_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction123) = semanticAction123 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIN)))) (()) := by
unfold parseTreeProduction123
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 124, in source RHS order. -/
noncomputable def parseTreeProduction124 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.HAS]) :=
- .nonTerminal (G := grammarInst) (⟨124, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenHAS)))
+ (([Tok.HAS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨124, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenHAS))))
-@[simp] theorem parseTreeProduction124_sem :
- Grammar.ptSem (parseTreeProduction124) = semanticAction124 (()) := by
+@[simp] theorem parseTreeProduction124_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction124) = semanticAction124 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenHAS)))) (()) := by
unfold parseTreeProduction124
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 125, in source RHS order. -/
noncomputable def parseTreeProduction125 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LIKE]) :=
- .nonTerminal (G := grammarInst) (⟨125, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLIKE)))
+ (([Tok.LIKE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨125, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLIKE))))
-@[simp] theorem parseTreeProduction125_sem :
- Grammar.ptSem (parseTreeProduction125) = semanticAction125 (()) := by
+@[simp] theorem parseTreeProduction125_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction125) = semanticAction125 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenLIKE)))) (()) := by
unfold parseTreeProduction125
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 126, in source RHS order. -/
noncomputable def parseTreeProduction126 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IS]) :=
- .nonTerminal (G := grammarInst) (⟨126, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIS)))
+ (([Tok.IS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨126, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIS))))
-@[simp] theorem parseTreeProduction126_sem :
- Grammar.ptSem (parseTreeProduction126) = semanticAction126 (()) := by
+@[simp] theorem parseTreeProduction126_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction126) = semanticAction126 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIS)))) (()) := by
unfold parseTreeProduction126
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 127, in source RHS order. -/
noncomputable def parseTreeProduction127 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.THEN]) :=
- .nonTerminal (G := grammarInst) (⟨127, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTHEN)))
+ (([Tok.THEN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨127, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTHEN))))
-@[simp] theorem parseTreeProduction127_sem :
- Grammar.ptSem (parseTreeProduction127) = semanticAction127 (()) := by
+@[simp] theorem parseTreeProduction127_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction127) = semanticAction127 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenTHEN)))) (()) := by
unfold parseTreeProduction127
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 128, in source RHS order. -/
noncomputable def parseTreeProduction128 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ELSE]) :=
- .nonTerminal (G := grammarInst) (⟨128, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenELSE)))
+ (([Tok.ELSE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨128, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenELSE))))
-@[simp] theorem parseTreeProduction128_sem :
- Grammar.ptSem (parseTreeProduction128) = semanticAction128 (()) := by
+@[simp] theorem parseTreeProduction128_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction128) = semanticAction128 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenELSE)))) (()) := by
unfold parseTreeProduction128
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 129, in source RHS order. -/
@@ -4030,262 +4348,292 @@ noncomputable def parseTreeProduction129
(value0 : { s : String // s ∉ keywords }) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IDENTIFIER value0]) :=
- .nonTerminal (G := grammarInst) (⟨129, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIDENTIFIER value0)))
+ (([Tok.IDENTIFIER value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨129, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIDENTIFIER value0))))
@[simp] theorem parseTreeProduction129_sem
- (value0 : { s : String // s ∉ keywords }) :
- Grammar.ptSem (parseTreeProduction129 value0) = semanticAction129 (value0) := by
+ (value0 : { s : String // s ∉ keywords })
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction129 value0) = semanticAction129 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIDENTIFIER value0)))) (value0) := by
unfold parseTreeProduction129
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 130, in source RHS order. -/
noncomputable def parseTreeProduction130 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IF]) :=
- .nonTerminal (G := grammarInst) (⟨130, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIF)))
+ (([Tok.IF]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨130, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIF))))
-@[simp] theorem parseTreeProduction130_sem :
- Grammar.ptSem (parseTreeProduction130) = semanticAction130 (()) := by
+@[simp] theorem parseTreeProduction130_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction130) = semanticAction130 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIF)))) (()) := by
unfold parseTreeProduction130
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 131, in source RHS order. -/
noncomputable def parseTreeProduction131 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TRUE]) :=
- .nonTerminal (G := grammarInst) (⟨131, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTRUE)))
+ (([Tok.TRUE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨131, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTRUE))))
-@[simp] theorem parseTreeProduction131_sem :
- Grammar.ptSem (parseTreeProduction131) = semanticAction131 (()) := by
+@[simp] theorem parseTreeProduction131_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction131) = semanticAction131 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenTRUE)))) (()) := by
unfold parseTreeProduction131
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 132, in source RHS order. -/
noncomputable def parseTreeProduction132 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.FALSE]) :=
- .nonTerminal (G := grammarInst) (⟨132, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFALSE)))
+ (([Tok.FALSE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨132, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFALSE))))
-@[simp] theorem parseTreeProduction132_sem :
- Grammar.ptSem (parseTreeProduction132) = semanticAction132 (()) := by
+@[simp] theorem parseTreeProduction132_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction132) = semanticAction132 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenFALSE)))) (()) := by
unfold parseTreeProduction132
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 133, in source RHS order. -/
noncomputable def parseTreeProduction133
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨133, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨133, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction133_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction133 tree0) = semanticAction133 (Grammar.ptSem tree0) := by
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction133 tree0) = semanticAction133 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction133
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 134, in source RHS order. -/
noncomputable def parseTreeProduction134
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨47, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨134, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨134, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction134_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction134 tree0) = semanticAction134 (Grammar.ptSem tree0) := by
+ (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction134 tree0) = semanticAction134 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction134
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 135, in source RHS order. -/
noncomputable def parseTreeProduction135 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨135, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨135, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction135_sem :
- Grammar.ptSem (parseTreeProduction135) = semanticAction135 := by
+@[simp] theorem parseTreeProduction135_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction135) = semanticAction135 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction135
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 136, in source RHS order. -/
noncomputable def parseTreeProduction136
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨136, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨136, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction136_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨48, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction136 tree0 tree1) = semanticAction136 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction136 tree0 tree1) = semanticAction136 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction136
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 137, in source RHS order. -/
noncomputable def parseTreeProduction137 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨137, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨137, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction137_sem :
- Grammar.ptSem (parseTreeProduction137) = semanticAction137 := by
+@[simp] theorem parseTreeProduction137_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction137) = semanticAction137 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction137
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 138, in source RHS order. -/
noncomputable def parseTreeProduction138
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨138, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨138, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction138_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨49, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction138 tree0 tree1) = semanticAction138 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction138 tree0 tree1) = semanticAction138 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction138
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 139, in source RHS order. -/
noncomputable def parseTreeProduction139 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨139, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨139, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction139_sem :
- Grammar.ptSem (parseTreeProduction139) = semanticAction139 := by
+@[simp] theorem parseTreeProduction139_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction139) = semanticAction139 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction139
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 140, in source RHS order. -/
noncomputable def parseTreeProduction140
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨140, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨140, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction140_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨50, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction140 tree0 tree1) = semanticAction140 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction140 tree0 tree1) = semanticAction140 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction140
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 141, in source RHS order. -/
noncomputable def parseTreeProduction141 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨141, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨141, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction141_sem :
- Grammar.ptSem (parseTreeProduction141) = semanticAction141 := by
+@[simp] theorem parseTreeProduction141_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction141) = semanticAction141 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction141
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 142, in source RHS order. -/
noncomputable def parseTreeProduction142
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨142, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨142, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction142_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨51, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction142 tree0 tree1) = semanticAction142 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction142 tree0 tree1) = semanticAction142 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction142
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 143, in source RHS order. -/
noncomputable def parseTreeProduction143
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨52, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.EOF]) :=
- .nonTerminal (G := grammarInst) (⟨143, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))
+ ((word0 ++ [Tok.EOF]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨143, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF))))
@[simp] theorem parseTreeProduction143_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction143 tree0) = semanticAction143 (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction143 tree0) = semanticAction143 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction143
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
@@ -6110,1175 +6458,1175 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Policies :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Policies :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CedarParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CedarParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees28 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 28 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 28 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees29 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 29 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 29 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees30 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 30 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 30 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees31 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 31 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 31 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees32 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 32 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 32 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees33 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 33 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 33 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees34 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 34 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 34 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees35 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 35 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 35 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees36 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 36 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 36 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees37 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 37 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 37 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees38 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 38 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 38 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees39 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 39 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 39 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees40 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 40 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 40 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees41 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 41 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 41 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees42 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 42 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 42 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees43 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 43 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 43 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees44 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 44 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 44 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees45 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 45 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 45 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees46 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 46 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 46 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees47 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 47 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 47 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees48 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 48 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 48 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees49 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 49 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 49 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees50 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 50 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 50 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees51 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 51 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 51 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees52 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 52 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 52 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees53 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 53 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 53 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees54 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 54 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 54 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees55 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 55 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 55 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees56 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 56 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 56 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees57 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 57 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 57 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees58 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 58 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 58 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees59 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 59 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 59 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees60 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 60 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 60 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees61 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 61 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 61 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees62 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 62 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 62 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees63 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 63 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 63 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees64 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 64 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 64 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees65 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 65 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 65 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees66 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 66 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 66 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees67 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 67 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 67 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees68 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 68 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 68 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees69 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 69 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 69 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees70 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 70 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 70 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees71 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 71 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 71 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees72 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 72 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 72 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees73 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 73 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 73 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees74 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 74 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 74 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees75 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 75 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 75 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees76 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 76 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 76 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees77 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 77 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 77 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees78 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 78 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 78 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees79 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 79 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 79 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees80 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 80 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 80 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees81 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 81 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 81 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees82 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 82 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 82 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees83 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 83 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 83 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees84 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 84 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 84 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees85 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 85 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 85 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees86 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 86 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 86 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees87 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 87 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 87 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees88 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 88 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 88 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees89 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 89 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 89 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees90 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 90 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 90 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees91 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 91 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 91 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees92 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 92 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 92 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees93 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 93 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 93 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees94 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 94 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 94 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees95 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 95 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 95 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees96 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 96 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 96 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees97 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 97 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 97 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees98 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 98 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 98 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees99 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 99 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 99 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees100 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 100 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 100 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees101 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 101 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 101 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees102 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 102 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 102 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees103 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨103, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 103 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨103, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 103 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨103, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨103, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨103, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees104 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨104, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 104 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨104, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 104 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨104, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨104, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨104, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees105 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨105, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 105 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨105, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 105 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨105, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨105, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨105, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees106 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨106, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 106 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨106, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 106 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨106, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨106, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨106, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees107 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨107, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 107 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨107, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 107 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨107, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨107, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨107, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees108 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨108, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 108 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨108, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 108 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨108, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨108, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨108, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees109 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨109, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 109 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨109, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 109 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨109, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨109, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨109, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees110 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨110, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 110 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨110, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 110 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨110, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨110, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨110, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees111 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨111, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 111 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨111, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 111 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨111, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨111, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨111, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees112 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨112, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 112 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨112, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 112 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨112, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨112, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨112, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees113 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨113, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 113 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨113, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 113 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨113, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨113, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨113, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees114 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨114, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 114 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨114, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 114 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨114, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨114, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨114, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees115 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨115, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 115 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨115, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 115 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨115, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨115, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨115, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees116 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨116, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 116 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨116, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 116 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨116, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨116, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨116, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees117 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨117, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 117 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨117, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 117 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨117, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨117, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨117, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees118 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨118, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 118 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨118, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 118 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨118, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨118, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨118, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees119 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨119, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 119 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨119, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 119 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨119, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨119, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨119, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees120 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨120, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 120 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨120, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 120 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨120, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨120, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨120, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees121 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨121, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 121 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨121, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 121 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨121, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨121, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨121, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees122 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨122, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 122 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨122, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 122 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨122, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨122, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨122, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees123 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨123, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 123 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨123, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 123 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨123, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨123, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨123, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees124 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨124, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 124 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨124, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 124 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨124, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨124, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨124, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees125 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨125, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 125 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨125, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 125 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨125, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨125, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨125, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees126 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨126, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 126 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨126, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 126 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨126, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨126, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨126, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees127 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨127, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 127 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨127, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 127 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨127, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨127, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨127, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees128 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨128, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 128 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨128, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 128 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨128, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨128, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨128, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees129 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨129, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 129 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨129, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 129 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨129, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨129, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨129, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees130 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨130, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 130 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨130, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 130 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨130, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨130, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨130, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees131 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨131, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 131 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨131, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 131 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨131, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨131, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨131, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees132 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨132, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 132 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨132, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 132 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨132, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨132, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨132, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees133 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨133, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 133 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨133, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 133 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨133, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨133, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨133, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees134 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨134, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 134 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨134, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 134 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨134, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨134, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨134, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees135 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨135, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 135 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨135, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 135 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨135, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨135, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨135, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees136 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨136, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 136 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨136, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 136 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨136, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨136, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨136, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees137 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨137, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 137 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨137, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 137 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨137, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨137, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨137, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees138 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨138, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 138 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨138, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 138 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨138, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨138, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨138, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees139 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨139, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 139 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨139, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 139 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨139, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨139, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨139, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees140 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨140, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 140 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨140, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 140 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨140, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨140, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨140, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees141 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨141, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 141 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨141, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 141 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨141, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨141, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨141, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees142 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨142, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 142 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨142, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 142 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨142, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨142, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨142, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees143 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨143, of_decide_eq_true rfl⟩ : Production))),
- CedarParser.table.sem 143 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨143, of_decide_eq_true rfl⟩ : Production))),
+ CedarParser.semV 143 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨143, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨143, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨143, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- CedarParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ CedarParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨28, _⟩, values => refinementSemanticAgrees28 values
- | ⟨29, _⟩, values => refinementSemanticAgrees29 values
- | ⟨30, _⟩, values => refinementSemanticAgrees30 values
- | ⟨31, _⟩, values => refinementSemanticAgrees31 values
- | ⟨32, _⟩, values => refinementSemanticAgrees32 values
- | ⟨33, _⟩, values => refinementSemanticAgrees33 values
- | ⟨34, _⟩, values => refinementSemanticAgrees34 values
- | ⟨35, _⟩, values => refinementSemanticAgrees35 values
- | ⟨36, _⟩, values => refinementSemanticAgrees36 values
- | ⟨37, _⟩, values => refinementSemanticAgrees37 values
- | ⟨38, _⟩, values => refinementSemanticAgrees38 values
- | ⟨39, _⟩, values => refinementSemanticAgrees39 values
- | ⟨40, _⟩, values => refinementSemanticAgrees40 values
- | ⟨41, _⟩, values => refinementSemanticAgrees41 values
- | ⟨42, _⟩, values => refinementSemanticAgrees42 values
- | ⟨43, _⟩, values => refinementSemanticAgrees43 values
- | ⟨44, _⟩, values => refinementSemanticAgrees44 values
- | ⟨45, _⟩, values => refinementSemanticAgrees45 values
- | ⟨46, _⟩, values => refinementSemanticAgrees46 values
- | ⟨47, _⟩, values => refinementSemanticAgrees47 values
- | ⟨48, _⟩, values => refinementSemanticAgrees48 values
- | ⟨49, _⟩, values => refinementSemanticAgrees49 values
- | ⟨50, _⟩, values => refinementSemanticAgrees50 values
- | ⟨51, _⟩, values => refinementSemanticAgrees51 values
- | ⟨52, _⟩, values => refinementSemanticAgrees52 values
- | ⟨53, _⟩, values => refinementSemanticAgrees53 values
- | ⟨54, _⟩, values => refinementSemanticAgrees54 values
- | ⟨55, _⟩, values => refinementSemanticAgrees55 values
- | ⟨56, _⟩, values => refinementSemanticAgrees56 values
- | ⟨57, _⟩, values => refinementSemanticAgrees57 values
- | ⟨58, _⟩, values => refinementSemanticAgrees58 values
- | ⟨59, _⟩, values => refinementSemanticAgrees59 values
- | ⟨60, _⟩, values => refinementSemanticAgrees60 values
- | ⟨61, _⟩, values => refinementSemanticAgrees61 values
- | ⟨62, _⟩, values => refinementSemanticAgrees62 values
- | ⟨63, _⟩, values => refinementSemanticAgrees63 values
- | ⟨64, _⟩, values => refinementSemanticAgrees64 values
- | ⟨65, _⟩, values => refinementSemanticAgrees65 values
- | ⟨66, _⟩, values => refinementSemanticAgrees66 values
- | ⟨67, _⟩, values => refinementSemanticAgrees67 values
- | ⟨68, _⟩, values => refinementSemanticAgrees68 values
- | ⟨69, _⟩, values => refinementSemanticAgrees69 values
- | ⟨70, _⟩, values => refinementSemanticAgrees70 values
- | ⟨71, _⟩, values => refinementSemanticAgrees71 values
- | ⟨72, _⟩, values => refinementSemanticAgrees72 values
- | ⟨73, _⟩, values => refinementSemanticAgrees73 values
- | ⟨74, _⟩, values => refinementSemanticAgrees74 values
- | ⟨75, _⟩, values => refinementSemanticAgrees75 values
- | ⟨76, _⟩, values => refinementSemanticAgrees76 values
- | ⟨77, _⟩, values => refinementSemanticAgrees77 values
- | ⟨78, _⟩, values => refinementSemanticAgrees78 values
- | ⟨79, _⟩, values => refinementSemanticAgrees79 values
- | ⟨80, _⟩, values => refinementSemanticAgrees80 values
- | ⟨81, _⟩, values => refinementSemanticAgrees81 values
- | ⟨82, _⟩, values => refinementSemanticAgrees82 values
- | ⟨83, _⟩, values => refinementSemanticAgrees83 values
- | ⟨84, _⟩, values => refinementSemanticAgrees84 values
- | ⟨85, _⟩, values => refinementSemanticAgrees85 values
- | ⟨86, _⟩, values => refinementSemanticAgrees86 values
- | ⟨87, _⟩, values => refinementSemanticAgrees87 values
- | ⟨88, _⟩, values => refinementSemanticAgrees88 values
- | ⟨89, _⟩, values => refinementSemanticAgrees89 values
- | ⟨90, _⟩, values => refinementSemanticAgrees90 values
- | ⟨91, _⟩, values => refinementSemanticAgrees91 values
- | ⟨92, _⟩, values => refinementSemanticAgrees92 values
- | ⟨93, _⟩, values => refinementSemanticAgrees93 values
- | ⟨94, _⟩, values => refinementSemanticAgrees94 values
- | ⟨95, _⟩, values => refinementSemanticAgrees95 values
- | ⟨96, _⟩, values => refinementSemanticAgrees96 values
- | ⟨97, _⟩, values => refinementSemanticAgrees97 values
- | ⟨98, _⟩, values => refinementSemanticAgrees98 values
- | ⟨99, _⟩, values => refinementSemanticAgrees99 values
- | ⟨100, _⟩, values => refinementSemanticAgrees100 values
- | ⟨101, _⟩, values => refinementSemanticAgrees101 values
- | ⟨102, _⟩, values => refinementSemanticAgrees102 values
- | ⟨103, _⟩, values => refinementSemanticAgrees103 values
- | ⟨104, _⟩, values => refinementSemanticAgrees104 values
- | ⟨105, _⟩, values => refinementSemanticAgrees105 values
- | ⟨106, _⟩, values => refinementSemanticAgrees106 values
- | ⟨107, _⟩, values => refinementSemanticAgrees107 values
- | ⟨108, _⟩, values => refinementSemanticAgrees108 values
- | ⟨109, _⟩, values => refinementSemanticAgrees109 values
- | ⟨110, _⟩, values => refinementSemanticAgrees110 values
- | ⟨111, _⟩, values => refinementSemanticAgrees111 values
- | ⟨112, _⟩, values => refinementSemanticAgrees112 values
- | ⟨113, _⟩, values => refinementSemanticAgrees113 values
- | ⟨114, _⟩, values => refinementSemanticAgrees114 values
- | ⟨115, _⟩, values => refinementSemanticAgrees115 values
- | ⟨116, _⟩, values => refinementSemanticAgrees116 values
- | ⟨117, _⟩, values => refinementSemanticAgrees117 values
- | ⟨118, _⟩, values => refinementSemanticAgrees118 values
- | ⟨119, _⟩, values => refinementSemanticAgrees119 values
- | ⟨120, _⟩, values => refinementSemanticAgrees120 values
- | ⟨121, _⟩, values => refinementSemanticAgrees121 values
- | ⟨122, _⟩, values => refinementSemanticAgrees122 values
- | ⟨123, _⟩, values => refinementSemanticAgrees123 values
- | ⟨124, _⟩, values => refinementSemanticAgrees124 values
- | ⟨125, _⟩, values => refinementSemanticAgrees125 values
- | ⟨126, _⟩, values => refinementSemanticAgrees126 values
- | ⟨127, _⟩, values => refinementSemanticAgrees127 values
- | ⟨128, _⟩, values => refinementSemanticAgrees128 values
- | ⟨129, _⟩, values => refinementSemanticAgrees129 values
- | ⟨130, _⟩, values => refinementSemanticAgrees130 values
- | ⟨131, _⟩, values => refinementSemanticAgrees131 values
- | ⟨132, _⟩, values => refinementSemanticAgrees132 values
- | ⟨133, _⟩, values => refinementSemanticAgrees133 values
- | ⟨134, _⟩, values => refinementSemanticAgrees134 values
- | ⟨135, _⟩, values => refinementSemanticAgrees135 values
- | ⟨136, _⟩, values => refinementSemanticAgrees136 values
- | ⟨137, _⟩, values => refinementSemanticAgrees137 values
- | ⟨138, _⟩, values => refinementSemanticAgrees138 values
- | ⟨139, _⟩, values => refinementSemanticAgrees139 values
- | ⟨140, _⟩, values => refinementSemanticAgrees140 values
- | ⟨141, _⟩, values => refinementSemanticAgrees141 values
- | ⟨142, _⟩, values => refinementSemanticAgrees142 values
- | ⟨143, _⟩, values => refinementSemanticAgrees143 values
- | ⟨n + 144, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨28, _⟩, spans, values => refinementSemanticAgrees28 spans values
+ | ⟨29, _⟩, spans, values => refinementSemanticAgrees29 spans values
+ | ⟨30, _⟩, spans, values => refinementSemanticAgrees30 spans values
+ | ⟨31, _⟩, spans, values => refinementSemanticAgrees31 spans values
+ | ⟨32, _⟩, spans, values => refinementSemanticAgrees32 spans values
+ | ⟨33, _⟩, spans, values => refinementSemanticAgrees33 spans values
+ | ⟨34, _⟩, spans, values => refinementSemanticAgrees34 spans values
+ | ⟨35, _⟩, spans, values => refinementSemanticAgrees35 spans values
+ | ⟨36, _⟩, spans, values => refinementSemanticAgrees36 spans values
+ | ⟨37, _⟩, spans, values => refinementSemanticAgrees37 spans values
+ | ⟨38, _⟩, spans, values => refinementSemanticAgrees38 spans values
+ | ⟨39, _⟩, spans, values => refinementSemanticAgrees39 spans values
+ | ⟨40, _⟩, spans, values => refinementSemanticAgrees40 spans values
+ | ⟨41, _⟩, spans, values => refinementSemanticAgrees41 spans values
+ | ⟨42, _⟩, spans, values => refinementSemanticAgrees42 spans values
+ | ⟨43, _⟩, spans, values => refinementSemanticAgrees43 spans values
+ | ⟨44, _⟩, spans, values => refinementSemanticAgrees44 spans values
+ | ⟨45, _⟩, spans, values => refinementSemanticAgrees45 spans values
+ | ⟨46, _⟩, spans, values => refinementSemanticAgrees46 spans values
+ | ⟨47, _⟩, spans, values => refinementSemanticAgrees47 spans values
+ | ⟨48, _⟩, spans, values => refinementSemanticAgrees48 spans values
+ | ⟨49, _⟩, spans, values => refinementSemanticAgrees49 spans values
+ | ⟨50, _⟩, spans, values => refinementSemanticAgrees50 spans values
+ | ⟨51, _⟩, spans, values => refinementSemanticAgrees51 spans values
+ | ⟨52, _⟩, spans, values => refinementSemanticAgrees52 spans values
+ | ⟨53, _⟩, spans, values => refinementSemanticAgrees53 spans values
+ | ⟨54, _⟩, spans, values => refinementSemanticAgrees54 spans values
+ | ⟨55, _⟩, spans, values => refinementSemanticAgrees55 spans values
+ | ⟨56, _⟩, spans, values => refinementSemanticAgrees56 spans values
+ | ⟨57, _⟩, spans, values => refinementSemanticAgrees57 spans values
+ | ⟨58, _⟩, spans, values => refinementSemanticAgrees58 spans values
+ | ⟨59, _⟩, spans, values => refinementSemanticAgrees59 spans values
+ | ⟨60, _⟩, spans, values => refinementSemanticAgrees60 spans values
+ | ⟨61, _⟩, spans, values => refinementSemanticAgrees61 spans values
+ | ⟨62, _⟩, spans, values => refinementSemanticAgrees62 spans values
+ | ⟨63, _⟩, spans, values => refinementSemanticAgrees63 spans values
+ | ⟨64, _⟩, spans, values => refinementSemanticAgrees64 spans values
+ | ⟨65, _⟩, spans, values => refinementSemanticAgrees65 spans values
+ | ⟨66, _⟩, spans, values => refinementSemanticAgrees66 spans values
+ | ⟨67, _⟩, spans, values => refinementSemanticAgrees67 spans values
+ | ⟨68, _⟩, spans, values => refinementSemanticAgrees68 spans values
+ | ⟨69, _⟩, spans, values => refinementSemanticAgrees69 spans values
+ | ⟨70, _⟩, spans, values => refinementSemanticAgrees70 spans values
+ | ⟨71, _⟩, spans, values => refinementSemanticAgrees71 spans values
+ | ⟨72, _⟩, spans, values => refinementSemanticAgrees72 spans values
+ | ⟨73, _⟩, spans, values => refinementSemanticAgrees73 spans values
+ | ⟨74, _⟩, spans, values => refinementSemanticAgrees74 spans values
+ | ⟨75, _⟩, spans, values => refinementSemanticAgrees75 spans values
+ | ⟨76, _⟩, spans, values => refinementSemanticAgrees76 spans values
+ | ⟨77, _⟩, spans, values => refinementSemanticAgrees77 spans values
+ | ⟨78, _⟩, spans, values => refinementSemanticAgrees78 spans values
+ | ⟨79, _⟩, spans, values => refinementSemanticAgrees79 spans values
+ | ⟨80, _⟩, spans, values => refinementSemanticAgrees80 spans values
+ | ⟨81, _⟩, spans, values => refinementSemanticAgrees81 spans values
+ | ⟨82, _⟩, spans, values => refinementSemanticAgrees82 spans values
+ | ⟨83, _⟩, spans, values => refinementSemanticAgrees83 spans values
+ | ⟨84, _⟩, spans, values => refinementSemanticAgrees84 spans values
+ | ⟨85, _⟩, spans, values => refinementSemanticAgrees85 spans values
+ | ⟨86, _⟩, spans, values => refinementSemanticAgrees86 spans values
+ | ⟨87, _⟩, spans, values => refinementSemanticAgrees87 spans values
+ | ⟨88, _⟩, spans, values => refinementSemanticAgrees88 spans values
+ | ⟨89, _⟩, spans, values => refinementSemanticAgrees89 spans values
+ | ⟨90, _⟩, spans, values => refinementSemanticAgrees90 spans values
+ | ⟨91, _⟩, spans, values => refinementSemanticAgrees91 spans values
+ | ⟨92, _⟩, spans, values => refinementSemanticAgrees92 spans values
+ | ⟨93, _⟩, spans, values => refinementSemanticAgrees93 spans values
+ | ⟨94, _⟩, spans, values => refinementSemanticAgrees94 spans values
+ | ⟨95, _⟩, spans, values => refinementSemanticAgrees95 spans values
+ | ⟨96, _⟩, spans, values => refinementSemanticAgrees96 spans values
+ | ⟨97, _⟩, spans, values => refinementSemanticAgrees97 spans values
+ | ⟨98, _⟩, spans, values => refinementSemanticAgrees98 spans values
+ | ⟨99, _⟩, spans, values => refinementSemanticAgrees99 spans values
+ | ⟨100, _⟩, spans, values => refinementSemanticAgrees100 spans values
+ | ⟨101, _⟩, spans, values => refinementSemanticAgrees101 spans values
+ | ⟨102, _⟩, spans, values => refinementSemanticAgrees102 spans values
+ | ⟨103, _⟩, spans, values => refinementSemanticAgrees103 spans values
+ | ⟨104, _⟩, spans, values => refinementSemanticAgrees104 spans values
+ | ⟨105, _⟩, spans, values => refinementSemanticAgrees105 spans values
+ | ⟨106, _⟩, spans, values => refinementSemanticAgrees106 spans values
+ | ⟨107, _⟩, spans, values => refinementSemanticAgrees107 spans values
+ | ⟨108, _⟩, spans, values => refinementSemanticAgrees108 spans values
+ | ⟨109, _⟩, spans, values => refinementSemanticAgrees109 spans values
+ | ⟨110, _⟩, spans, values => refinementSemanticAgrees110 spans values
+ | ⟨111, _⟩, spans, values => refinementSemanticAgrees111 spans values
+ | ⟨112, _⟩, spans, values => refinementSemanticAgrees112 spans values
+ | ⟨113, _⟩, spans, values => refinementSemanticAgrees113 spans values
+ | ⟨114, _⟩, spans, values => refinementSemanticAgrees114 spans values
+ | ⟨115, _⟩, spans, values => refinementSemanticAgrees115 spans values
+ | ⟨116, _⟩, spans, values => refinementSemanticAgrees116 spans values
+ | ⟨117, _⟩, spans, values => refinementSemanticAgrees117 spans values
+ | ⟨118, _⟩, spans, values => refinementSemanticAgrees118 spans values
+ | ⟨119, _⟩, spans, values => refinementSemanticAgrees119 spans values
+ | ⟨120, _⟩, spans, values => refinementSemanticAgrees120 spans values
+ | ⟨121, _⟩, spans, values => refinementSemanticAgrees121 spans values
+ | ⟨122, _⟩, spans, values => refinementSemanticAgrees122 spans values
+ | ⟨123, _⟩, spans, values => refinementSemanticAgrees123 spans values
+ | ⟨124, _⟩, spans, values => refinementSemanticAgrees124 spans values
+ | ⟨125, _⟩, spans, values => refinementSemanticAgrees125 spans values
+ | ⟨126, _⟩, spans, values => refinementSemanticAgrees126 spans values
+ | ⟨127, _⟩, spans, values => refinementSemanticAgrees127 spans values
+ | ⟨128, _⟩, spans, values => refinementSemanticAgrees128 spans values
+ | ⟨129, _⟩, spans, values => refinementSemanticAgrees129 spans values
+ | ⟨130, _⟩, spans, values => refinementSemanticAgrees130 spans values
+ | ⟨131, _⟩, spans, values => refinementSemanticAgrees131 spans values
+ | ⟨132, _⟩, spans, values => refinementSemanticAgrees132 spans values
+ | ⟨133, _⟩, spans, values => refinementSemanticAgrees133 spans values
+ | ⟨134, _⟩, spans, values => refinementSemanticAgrees134 spans values
+ | ⟨135, _⟩, spans, values => refinementSemanticAgrees135 spans values
+ | ⟨136, _⟩, spans, values => refinementSemanticAgrees136 spans values
+ | ⟨137, _⟩, spans, values => refinementSemanticAgrees137 spans values
+ | ⟨138, _⟩, spans, values => refinementSemanticAgrees138 spans values
+ | ⟨139, _⟩, spans, values => refinementSemanticAgrees139 spans values
+ | ⟨140, _⟩, spans, values => refinementSemanticAgrees140 spans values
+ | ⟨141, _⟩, spans, values => refinementSemanticAgrees141 spans values
+ | ⟨142, _⟩, spans, values => refinementSemanticAgrees142 spans values
+ | ⟨143, _⟩, spans, values => refinementSemanticAgrees143 spans values
+ | ⟨n + 144, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -7385,17 +7733,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- CedarParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ CedarParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) CedarParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) CedarParser.V := {
table := CedarParser.table
- decode := fun t => CedarParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := CedarParser.semV
+ decode := CedarParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -7440,13 +7790,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change CedarParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change CedarParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -7454,21 +7805,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (CedarParser.run input logNSteps) := by
+ have hrun : CedarParser.run input logNSteps
= Runtime.Exec.run CedarParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [CedarParser.run]
rw [Runtime.Exec.runFast_eq_run CedarParser.stackOps CedarParser.flat CedarParser.fuse
CedarParser.termOf CedarParser.valOf CedarParser.stackLawful CedarParser.fuseOK]
- simp only [CedarParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- CedarParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ CedarParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold CedarParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -7476,49 +7827,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : CedarParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Policies)
- (accepted : CedarParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : CedarParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (CedarParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (CedarParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : CedarParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -7527,7 +7880,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- CedarParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ CedarParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -7543,13 +7896,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- CedarParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ CedarParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -7559,65 +7914,59 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
-
-/-- `lexPos` and `CedarLexer.tokenize` succeed on the same inputs with the same tokens. Stated, not proved. -/
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
+
+/-- `lexPos` and `CedarLexer.tokenize` succeed on the same inputs with the same tokens. Proved as
+ `posLexerAgrees`. -/
abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees CedarLexer.cbyte CedarLexer.tokenize
-/-- `CedarParser.parse` ignores token spans. Proved as `spanIndependent`. -/
-abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => CedarParser.parse ts k)
-
-theorem spanIndependent : SpanIndependent := CedarParser.parse_spanIndependent
+theorem posLexerAgrees : PosLexerAgrees := CedarLexer.posLexerAgrees
-theorem parse_eq_dependent_spans (input : List (Runtime.Positioned Tok)) (k : Nat) :
- CedarParser.parse input k = parse (input.map (·.val)) k := by
- have hs : CedarParser.parse input k = CedarParser.parse (input.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent input k
- rw [hs, ← parse_eq_dependent (input.map (·.val)) k, List.map_map]
- rfl
+theorem lexPos_eq_of_tokenize (s : String) (ts : List (Runtime.Positioned Tok)) (h : CedarLexer.tokenize s = .ok ts) :
+ Lexer.lexPos CedarLexer.cbyte s = .ok ts := by
+ have hagree := posLexerAgrees s
+ rw [h] at hagree
+ revert hagree
+ cases Lexer.lexPos CedarLexer.cbyte s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
-theorem parseStr_eq (hlex : PosLexerAgrees) (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+theorem parseStr_eq (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
(h : CedarLexer.tokenize s = .ok ts) : CedarParser.parseStr s k = CedarParser.parse ts k := by
- have hp : Lexer.lexPos CedarLexer.cbyte s = .ok ts := by
- have hagree := hlex s
- rw [h] at hagree
- revert hagree
- cases Lexer.lexPos CedarLexer.cbyte s with
- | error e => intro hc; simp [Except.toOption] at hc
- | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+ have hp : Lexer.lexPos CedarLexer.cbyte s = .ok ts := lexPos_eq_of_tokenize s ts h
exact CedarParser.parseStr_eq_lexPos s k ts hp
-theorem parseStr_eq_dependent (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_eq_dependent (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : CedarLexer.tokenize s = .ok ts) :
- CedarParser.parseStr s k = parse (ts.map (·.val)) k := by
- have hs : CedarParser.parse ts k = CedarParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs, ← parse_eq_dependent (ts.map (·.val)) k, List.map_map]
- rfl
+ CedarParser.parseStr s k = parse ts k := by
+ rw [parseStr_eq s k ts h, parse_eq_dependent]
-theorem parseStr_sound (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_sound (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : CedarLexer.tokenize s = .ok ts) (p : Policies)
(accepted : CedarParser.parseStr s k = some p) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
- toStream (ts.map (·.val)) = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = p := by
- have hs : CedarParser.parse ts k = CedarParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs] at accepted
- exact parser_sound (ts.map (·.val)) k p
- (by simpa [List.map_map, Function.comp_def] using accepted)
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ rw [parseStr_eq s k ts h] at accepted
+ exact parser_sound ts k p accepted
/-- When `tokenize` fails, the byte lexer delivers a prefix `ts` and fails, and `parseStr`
is `none` or `parse` of an extension of `ts`. -/
-theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat)
+theorem parseStr_of_tokenize_error (s : String) (k : Nat)
(e : Lexer.LexError) (h : CedarLexer.tokenize s = .error e) :
∃ ts e', Runtime.Exec.Fails (Lexer.pullSource (Lexer.pullAux CedarLexer.cbyte s.toUTF8))
⟨false, s.toUTF8.size + 1, 0, [CedarLexer.cbyte.flat.base.start]⟩ ts e' ∧
@@ -7626,10 +7975,281 @@ theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat
· exfalso
have hp : Lexer.lexPos CedarLexer.cbyte s = .ok ts :=
Lexer.lexPosAux_of_denotes CedarLexer.cbyte s.toUTF8 _ _ _ ts hD
- have hagree := hlex s
+ have hagree := posLexerAgrees s
rw [hp, h] at hagree
simp [Except.toOption] at hagree
· exact hF
+/-- Every production of the start symbol has the end marker `$` on its right-hand side. -/
+theorem startProds_end : ∀ p : Production,
+ prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ Symbol.T (⟨51, of_decide_eq_true rfl⟩ : Terminal) ∈ prodRhsRev' p := by
+ native_decide
+
+theorem tokenTerm_eq_end (t : Tok)
+ (h : tokenTerm' t = (⟨51, of_decide_eq_true rfl⟩ : Terminal)) : t = .EOF := by
+ cases t <;> first | rfl | exact absurd (congrArg Fin.val h) (Nat.ne_of_beq_eq_false rfl)
+
+/-- The dependent parser does not accept a token list with no `EOF` that is longer than
+ `2^k`: it has not reached the end marker. -/
+theorem dependent_ne_parsed_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length)
+ (r : SpanGrammar.semR (SG := spanGrammarInst) (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))))
+ (rest : Runtime.NatStream grammarInst.Token) :
+ Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k ≠ .Parsed r rest :=
+ Runtime.parse_ne_parsed_of_no_end (G := grammarInst) (A := automatonInst) _ _
+ startProds_end input ⟨.EOF, Runtime.Span.dummy⟩ rfl
+ (fun t ht he => hin t ht (tokenTerm_eq_end t.val he)) k hlen r rest
+
+theorem parse_eq_none_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length) : parse input k = none := by
+ unfold parse
+ cases hp : Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k with
+ | Parsed r rest => exact absurd hp (dependent_ne_parsed_of_no_eof input k hin hlen r rest)
+ | _ => rfl
+
+/-- A prefix of lexed tokens with no `EOF`, padded with copies of its first token. -/
+theorem no_eof_pad (t0 : Runtime.Positioned Tok) (ts : List (Runtime.Positioned Tok))
+ (hts : ∀ t ∈ t0 :: ts, t.val ≠ .EOF) (k : Nat) :
+ (∀ t ∈ t0 :: ts ++ List.replicate (2 ^ k + 1) t0, t.val ≠ .EOF) ∧
+ 2 ^ k < (t0 :: ts ++ List.replicate (2 ^ k + 1) t0).length := by
+ constructor
+ · intro x hx
+ rcases List.mem_append.mp hx with hx | hx
+ · exact hts x hx
+ · rw [List.eq_of_mem_replicate hx]; exact hts t0 (List.mem_cons_self ..)
+ · simp only [List.length_append, List.length_replicate, List.length_cons]
+ omega
+
+/-- **Lex failure.** When the positioned byte lexer fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_lexPos (s : String) (k : Nat)
+ (h : ∀ ts, Lexer.lexPos CedarLexer.cbyte s ≠ .ok ts) : CedarParser.parseStr s k = none := by
+ rcases CedarParser.parseStr_total s k with ⟨ts, hD, _⟩ | ⟨ts, e, hF, hr⟩
+ · exact absurd (Lexer.lexPosAux_of_denotes CedarLexer.cbyte s.toUTF8 _ _ _ ts hD) (h ts)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens CedarLexer.cbyte CedarLexer.fastActs CedarLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) CedarLexer.noEofEmit s.toUTF8 _ ts e hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ unfold CedarParser.parseStr
+ rw [CedarParser.runStream_eq_runSrc]
+ unfold Runtime.Exec.runSrc
+ rw [hn]
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · exact h1
+ · rw [h1, parse_eq_dependent]
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ exact parse_eq_none_of_no_eof _ k hin hlen
+
+/-- **Lex failure.** When `tokenize` fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_tokenize_error (s : String) (k : Nat)
+ (e : Lexer.LexError) (h : CedarLexer.tokenize s = .error e) : CedarParser.parseStr s k = none :=
+ parseStr_eq_none_of_lexPos s k (fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree)
+
+/-- **Lex failure, stream engine.** When `tokenize` fails, `runStream` does not accept. It may
+ reject or run out of steps before it reaches the lex error, so the result need not be
+ `.err`. -/
+theorem runStream_ne_ok_of_tokenize_error (s : String) (k : Nat) (e : Lexer.LexError)
+ (h : CedarLexer.tokenize s = .error e) : ∀ v, CedarParser.runStream s k ≠ .ok v := by
+ intro v hok
+ have hlex : ∀ ts, Lexer.lexPos CedarLexer.cbyte s ≠ .ok ts := fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree
+ unfold CedarParser.runStream at hok
+ rcases Lexer.runStreamFast_total (ops := CedarParser.stackOps) CedarParser.flat CedarParser.fuse CedarParser.termOf CedarLexer.cbyte
+ CedarLexer.fastActs CedarLexer.fastActs_agree_byte s (2 ^ k) with ⟨ts, hD, _⟩ | ⟨ts, e', hF, hr⟩
+ · exact hlex ts (Lexer.lexPosAux_of_denotes CedarLexer.cbyte s.toUTF8 _ _ _ ts hD)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens CedarLexer.cbyte CedarLexer.fastActs CedarLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) CedarLexer.noEofEmit s.toUTF8 _ ts e' hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ rw [Lexer.runStreamFast_eq_runSrc (ops := CedarParser.stackOps) CedarParser.flat CedarParser.fuse CedarParser.termOf
+ CedarLexer.cbyte CedarLexer.fastActs CedarLexer.fastActs_agree_byte] at hok
+ unfold Runtime.Exec.runSrc at hok
+ rw [hn] at hok
+ cases hok
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · rw [h1] at hok; cases hok
+ · rw [h1] at hok
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ have related := parserRunRefines (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k
+ have hw : CedarParser.run (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k = .ok v := hok
+ rw [hw] at related
+ generalize hdep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (Runtime.Refinement.listStream executableRefinement
+ (t0 :: rest ++ List.replicate (2 ^ k + 1) t0)) k = dep at related
+ cases related with
+ | parsed value stream =>
+ exact dependent_ne_parsed_of_no_eof _ k hin hlen value stream hdep
+
+/-- **End to end.** If `parseStr` accepts `s` with value `p`, then `tokenize` lexes `s` to
+ `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem parseStr_sound_tokenize (s : String) (k : Nat) (p : Policies)
+ (accepted : CedarParser.parseStr s k = some p) :
+ ∃ ts, CedarLexer.tokenize s = .ok ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ cases ht : CedarLexer.tokenize s with
+ | error e =>
+ rw [parseStr_eq_none_of_tokenize_error s k e ht] at accepted
+ cases accepted
+ | ok ts => exact ⟨ts, rfl, parseStr_sound s k ts ht p accepted⟩
+
+/-- **End to end, with the lexer specification.** If `parseStr` accepts `s` with value `p`,
+ then `s` has a maximal-munch tokenization (`Lexer.Tokenization`), the spec tokenizer
+ returns the token values of `ts = tokenize s`, and `ts` starts with the word of a parse
+ tree whose value is `p`. -/
+theorem parseStr_sound_tokenization (s : String) (k : Nat) (p : Policies)
+ (accepted : CedarParser.parseStr s k = some p) :
+ ∃ ts, CedarLexer.tokenize s = .ok ts ∧ Lexer.Tokenization CedarLexer.rules0 s.toList ∧
+ Lexer.tokenize CedarLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ obtain ⟨htok, hspec⟩ := CedarLexer.tokenize_sound ht
+ exact ⟨ts, ht, htok, hspec, hp⟩
+
+/-- **`tokenize` then `parse`.** If `tokenize` lexes `s` to `ts` and `parse` accepts `ts` with
+ value `p`, then `s` has a maximal-munch tokenization, the spec tokenizer returns the token
+ values of `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem tokenize_parse_sound (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok)) (p : Policies)
+ (h : CedarLexer.tokenize s = .ok ts) (accepted : CedarParser.parse ts k = some p) :
+ Lexer.Tokenization CedarLexer.rules0 s.toList ∧ Lexer.tokenize CedarLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨htok, hspec⟩ := CedarLexer.tokenize_sound h
+ exact ⟨htok, hspec, parser_sound ts k p accepted⟩
+
+/-- **Completeness.** If `tokenize` lexes `s` to `ts` and a parse tree of the start symbol
+ spans exactly `ts`, within the fuel, `parseStr` returns the tree's value. -/
+theorem parseStr_complete (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : CedarLexer.tokenize s = .ok ts) (tree : ParserStartTree ts)
+ (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ CedarParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ rw [parseStr_eq s k ts h]
+ exact parser_complete tree k fuel
+
+/-- **Completeness from a tokenization (value level).** A maximal-munch `Lexer.Lexing` of `s`
+ gives the tokens `ts` of `tokenize s`, whose values are the tokens of its steps, and
+ `parseStr` accepts every parse tree over `ts` within the fuel, with the tree's value. -/
+theorem parseStr_complete_lexing (s : String) (k : Nat) (steps : List (Nat × Nat))
+ (hsteps : Lexer.Lexing CedarLexer.rules0 s.toList steps) :
+ ∃ ts, CedarLexer.tokenize s = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CedarLexer.lexer CedarLexer.lexer.start s.toList steps ∧
+ ∀ tree : ParserStartTree ts, Grammar.ptSize tree ≤ 2 ^ k →
+ CedarParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ obtain ⟨ts, ht, hv⟩ := CedarLexer.tokenize_complete hsteps
+ exact ⟨ts, ht, hv, fun tree fuel => parseStr_complete s k ts ht tree fuel⟩
+
+/-- **Unambiguity (value level).** Two derivations of `s`, each the tokens `tokenize` returns
+ for `s` and a parse tree over them, have the same tokens and the same value. -/
+theorem parseStr_unambiguous (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarLexer.tokenize s = .ok ts₁) (h₂ : CedarLexer.tokenize s = .ok ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ rw [h₁] at h₂
+ cases h₂
+ exact ⟨rfl, (parser_unambiguous tree₁ tree₂).2⟩
+
+/-- **Completeness over positioned tokens.** If `ts` is the positioned tokenization of `s`
+ (`CedarLexer.Lexes`) and a parse tree of the start symbol spans exactly `ts`, within the fuel,
+ `parseStr` returns the tree's value. -/
+theorem parseStr_complete_lexes (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : CedarLexer.Lexes s ts) (tree : ParserStartTree ts) (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ CedarParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) :=
+ parseStr_complete s k ts ((CedarLexer.tokenize_iff_lexes s ts).mpr h) tree fuel
+
+/-- **Unambiguity over positioned tokens.** Two derivations of `s`, each a positioned
+ tokenization and a parse tree over it, have the same tokens, and their trees have the
+ same span and value. -/
+theorem parseStr_unambiguous_lexes (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarLexer.Lexes s ts₁) (h₂ : CedarLexer.Lexes s ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSpan ⟨0⟩ tree₁ = SpanGrammar.ptSpan ⟨0⟩ tree₂ ∧
+ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ have he := CedarLexer.lexes_unique h₁ h₂
+ subst he
+ exact ⟨rfl, parser_unambiguous tree₁ tree₂⟩
+
+/-- **Node spans as text of `s`.** In a parse tree over the positioned tokenization `ts` of
+ `s` (`CedarLexer.Lexes`), every leaf's span is `[a, b)` for positions `a ≤ b` of `s`, and a rule's
+ action emits the leaf's token from the lexeme `s.extract a b` (or the leaf is the
+ end-of-input token at the end of `s`). Every inner node's span is `[a, b)` for positions
+ `a ≤ b` of `s`; `b` is the end of the lexeme of the node's last token, and `a` is the start
+ of the lexeme of its first token or, when its word is empty or its leftmost children
+ derive the empty word, the end of the token before it (`Lexer.AllNodeText`). -/
+theorem parseStr_node_spans (s : String) (ts : List (Runtime.Positioned Tok)) (h : CedarLexer.Lexes s ts)
+ (tree : ParserStartTree ts) :
+ Lexer.AllNodeText (Lexer.modeAct CedarLexer.lexer CedarLexer.lexer.start) CedarLexer.lexer.eofToken s ⟨0⟩ tree :=
+ Lexer.PosLexing.allNodeText h tree
+
+/-- **End to end over positioned tokens.** If `parseStr` accepts `s` with value `p`, then
+ `s` has a positioned tokenization `ts` (`CedarLexer.Lexes`), and `ts` starts with the word of a
+ parse tree whose value is `p`. -/
+theorem parseStr_sound_lexes (s : String) (k : Nat) (p : Policies)
+ (accepted : CedarParser.parseStr s k = some p) :
+ ∃ ts, CedarLexer.Lexes s ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ exact ⟨ts, (CedarLexer.tokenize_iff_lexes s ts).mp ht, hp⟩
+
+/-- The end marker `$` is the last symbol of every production of the start symbol, and no
+ other position of a right-hand side holds `$` or the start symbol. -/
+theorem endMarker_last : ∀ p : Production,
+ (prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ (prodRhsRev' p).head? = some (Symbol.T (⟨51, of_decide_eq_true rfl⟩ : Terminal)) ∧
+ ∀ x ∈ (prodRhsRev' p).tail, x ≠ Symbol.T (⟨51, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) ∧
+ (prodLhs' p ≠ startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ ∀ x ∈ prodRhsRev' p, x ≠ Symbol.T (⟨51, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) := by
+ native_decide
+
+/-- **The tree covers the tokens.** If `ts` is the positioned tokenization of `s`
+ (`CedarLexer.Lexes`), the word of a start tree that begins the stream of `ts` is `ts`: the lexer
+ emits `EOF` only as its last token (`CedarLexer.lexes_eof_last`), and a start tree's word ends
+ with its only `$` token (`endMarker_last`). -/
+theorem word_eq_of_lexes (s : String) (ts : List (Runtime.Positioned Tok)) (h : CedarLexer.Lexes s ts)
+ {word : List grammarInst.Token} (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token)
+ (hs : toStream ts = Runtime.NatStream.appList word rest) : word = ts := by
+ obtain ⟨ts0, rfl, hno⟩ := CedarLexer.lexes_eof_last h
+ exact Runtime.start_word_eq (G := grammarInst) (A := automatonInst) _ _ endMarker_last _ ts0 _
+ rfl (fun t ht he => hno t ht (tokenTerm_eq_end t.val he)) tree rest hs
+
+/-- **End to end, over the whole input.** If `parseStr` accepts `s` with value `p`, then
+ `tokenize` lexes `s` to `ts`, `ts` is the positioned tokenization of `s` (`CedarLexer.Lexes`),
+ and a parse tree over exactly `ts` has the value `p`. -/
+theorem parseStr_sound_exact (s : String) (k : Nat) (p : Policies)
+ (accepted : CedarParser.parseStr s k = some p) :
+ ∃ ts, CedarLexer.tokenize s = .ok ts ∧ CedarLexer.Lexes s ts ∧
+ ∃ tree : ParserStartTree ts, SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, word, tree, rest, hs, hp⟩ := parseStr_sound_tokenize s k p accepted
+ have hl := (CedarLexer.tokenize_iff_lexes s ts).mp ht
+ obtain rfl := word_eq_of_lexes s ts hl tree rest hs
+ exact ⟨word, ht, hl, tree, hp⟩
+
end CedarVerified
diff --git a/test/cedarentities/CedarEntitiesLexer.lean b/test/cedarentities/CedarEntitiesLexer.lean
index d1a86f3..51338ae 100644
--- a/test/cedarentities/CedarEntitiesLexer.lean
+++ b/test/cedarentities/CedarEntitiesLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
public import cedarentities.CedarEntitiesAst
@@ -219,9 +223,93 @@ theorem CedarEntitiesLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees CedarEntitiesLexer.fastActs CedarEntitiesLexer.cbyte.flat.base.acts :=
CedarEntitiesLexer.fastActs_agree
-theorem CedarEntitiesLexer.byteValidated0 :
- Lexer.byteValidate (CedarEntitiesLexer.cbyte.bytes.getD 0 default)
- (CedarEntitiesLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def CedarEntitiesLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte CedarEntitiesLexer.cbyte input
+
+theorem CedarEntitiesLexer.byteUnicodeValidated : Lexer.byteValidAll CedarEntitiesLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem CedarEntitiesLexer.posLexerAgrees : Lexer.PosLexerAgrees CedarEntitiesLexer.cbyte CedarEntitiesLexer.tokenize := by
+ intro s
+ rw [CedarEntitiesLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll CedarEntitiesLexer.cbyte CedarEntitiesLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem CedarEntitiesLexer.tokenizeByte_toOption (s : String) :
+ (CedarEntitiesLexer.tokenizeByte s).toOption = (CedarEntitiesLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption CedarEntitiesLexer.cbyte CedarEntitiesLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem CedarEntitiesLexer.noEofEmit :
+ ∀ m r, (CedarEntitiesLexer.fastActs.get m r).emit = true → ∀ s, (CedarEntitiesLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL CedarEntitiesLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (fun _ _ h => by first | (dsimp only at h; unfold keywordOrIdentifier at h; (repeat' split at h) <;> contradiction) | (dsimp only at h; set_option linter.unusedSimpArgs false in simp [keywordOrIdentifier, stripStringQuotes] at h; (repeat' split at h) <;> simp_all)) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) Lexer.AllL.nil)))))))))))))))))
+ Lexer.AllL.nil)
+
+theorem CedarEntitiesLexer.stay0 : ∀ r, (CedarEntitiesLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL CedarEntitiesLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil))))))))))))))))) Lexer.AllL.nil) 0
+
+theorem CedarEntitiesLexer.textIndep0 : ∀ r, CedarEntitiesLexer.cflat.needsText 0 r = false →
+ ∀ s, (CedarEntitiesLexer.fastActs.get 0 r).toAct s = (CedarEntitiesLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ CedarEntitiesLexer.fastActs (CedarEntitiesLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) Lexer.Forall₂.nil)))))))))))))))))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem CedarEntitiesLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CedarEntitiesLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization CedarEntitiesLexer.rules0 input.toList ∧
+ Lexer.tokenize CedarEntitiesLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound CedarEntitiesLexer.cflat CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree
+ CedarEntitiesLexer.validated0 rfl CedarEntitiesLexer.flatValidated0 (by decide) CedarEntitiesLexer.stay0
+ CedarEntitiesLexer.textIndep0 (by rw [← CedarEntitiesLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem CedarEntitiesLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing CedarEntitiesLexer.rules0 input.toList steps) :
+ ∃ ts, CedarEntitiesLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CedarEntitiesLexer.lexer CedarEntitiesLexer.lexer.start input.toList steps := by
+ rw [CedarEntitiesLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete CedarEntitiesLexer.cflat CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree
+ CedarEntitiesLexer.validated0 rfl CedarEntitiesLexer.flatValidated0 (by decide) CedarEntitiesLexer.stay0
+ CedarEntitiesLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev CedarEntitiesLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing CedarEntitiesLexer.rules0 (Lexer.modeAct CedarEntitiesLexer.lexer CedarEntitiesLexer.lexer.start)
+ CedarEntitiesLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem CedarEntitiesLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ CedarEntitiesLexer.tokenize s = .ok ts ↔ CedarEntitiesLexer.Lexes s ts := by
+ rw [CedarEntitiesLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' CedarEntitiesLexer.cflat CedarEntitiesLexer.fastActs
+ CedarEntitiesLexer.fastActs_agree CedarEntitiesLexer.validated0 rfl CedarEntitiesLexer.flatValidated0 (by decide)
+ CedarEntitiesLexer.stay0 CedarEntitiesLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem CedarEntitiesLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos CedarEntitiesLexer.cbyte s = .ok ts ↔ CedarEntitiesLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff CedarEntitiesLexer.posLexerAgrees s ts).trans (CedarEntitiesLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem CedarEntitiesLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarEntitiesLexer.Lexes s ts₁) (h₂ : CedarEntitiesLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem CedarEntitiesLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CedarEntitiesLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees CedarEntitiesLexer.lexer CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree
+ _ CedarEntitiesLexer.noEofEmit _) h
diff --git a/test/cedarentities/CedarEntitiesParser.lean b/test/cedarentities/CedarEntitiesParser.lean
index 10fc73b..a5f9f52 100644
--- a/test/cedarentities/CedarEntitiesParser.lean
+++ b/test/cedarentities/CedarEntitiesParser.lean
@@ -104,122 +104,65 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def semS : Nat → List VP → Runtime.Span
- | 0, [(ds_span, .v13 ds)] => ds_span
- | 1, [(ns_span, .v2 ns)] => ns_span
- | 2, [(inst_span, .v3 inst)] => inst_span
- | 3, [(__s0, _), (p_span, .v8 p), (__s2, _), (insts_span, .v14 insts), (__s4, _)] => Runtime.Span.merge __s0 __s4
- | 4, [(__s0, _), (r_span, .v6 r), (parents_span, .v4 parents), (attrs_span, .v5 attrs), (tags_span, .v5 tags), (__s5, _)] => Runtime.Span.merge __s0 __s5
- | 5, [] => Runtime.Span.dummy
- | 6, [(__s0, _), (rs_span, .v4 rs)] => Runtime.Span.merge __s0 rs_span
- | 7, [(r_span, .v6 r)] => r_span
- | 8, [(__s0, _), (rs_span, .v4 rs), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 9, [] => Runtime.Span.dummy
- | 10, [(r_span, .v6 r), (rest_span, .v4 rest)] => Runtime.Span.merge r_span rest_span
- | 11, [] => Runtime.Span.dummy
- | 12, [(__s0, _)] => __s0
- | 13, [(__s0, _), (r_span, .v6 r), (rest_span, .v4 rest)] => Runtime.Span.merge __s0 rest_span
- | 14, [] => Runtime.Span.dummy
- | 15, [(__s0, _), (__s1, _), (kvs_span, .v5 kvs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 16, [] => Runtime.Span.dummy
- | 17, [(__s0, _)] => __s0
- | 18, [] => Runtime.Span.dummy
- | 19, [(__s0, _), (__s1, _), (kvs_span, .v5 kvs), (__s3, _)] => Runtime.Span.merge __s0 __s3
- | 20, [(first_span, .v15 first), (rest_span, .v7 rest)] => Runtime.Span.merge first_span rest_span
- | 21, [(__s0, _), (id_span, .v9 id)] => Runtime.Span.merge __s0 id_span
- | 22, [(__s0, _), (next_span, .v15 next), (rest_span, .v7 rest)] => Runtime.Span.merge __s0 rest_span
- | 23, [(first_span, .v15 first), (rest_span, .v8 rest)] => Runtime.Span.merge first_span rest_span
- | 24, [] => Runtime.Span.dummy
- | 25, [(__s0, _), (next_span, .v15 next), (rest_span, .v8 rest)] => Runtime.Span.merge __s0 rest_span
- | 26, [] => Runtime.Span.dummy
- | 27, [(k_span, .v9 k), (__s1, _), (v_span, .v10 v), (rest_span, .v5 rest)] => Runtime.Span.merge k_span rest_span
- | 28, [] => Runtime.Span.dummy
- | 29, [(__s0, _)] => __s0
- | 30, [(__s0, _), (k_span, .v9 k), (__s2, _), (v_span, .v10 v), (rest_span, .v5 rest)] => Runtime.Span.merge __s0 rest_span
- | 31, [(id_span, .v15 id)] => id_span
- | 32, [(s_span, .v9 s)] => s_span
- | 33, [(s_span, .v9 s)] => s_span
- | 34, [(n_span, .v16 n)] => n_span
- | 35, [(__s0, _), (n_span, .v16 n)] => Runtime.Span.merge __s0 n_span
- | 36, [(__s0, _)] => __s0
- | 37, [(__s0, _)] => __s0
- | 38, [(__s0, _), (vs_span, .v12 vs), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 39, [(__s0, _), (kvs_span, .v5 kvs), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 40, [(first_span, .v15 first), (rest_span, .v11 rest)] => Runtime.Span.merge first_span rest_span
- | 41, [(__s0, _), (id_span, .v9 id)] => Runtime.Span.merge __s0 id_span
- | 42, [(__s0, _), (next_span, .v15 next), (rest_span, .v11 rest)] => Runtime.Span.merge __s0 rest_span
- | 43, [(__s0, _), (args_span, .v12 args), (__s2, _)] => Runtime.Span.merge __s0 __s2
- | 44, [] => Runtime.Span.dummy
- | 45, [(v_span, .v10 v), (rest_span, .v12 rest)] => Runtime.Span.merge v_span rest_span
- | 46, [] => Runtime.Span.dummy
- | 47, [(__s0, _)] => __s0
- | 48, [(__s0, _), (v_span, .v10 v), (rest_span, .v12 rest)] => Runtime.Span.merge __s0 rest_span
- | 49, [] => Runtime.Span.dummy
- | 50, [(xs_span, .v13 xs), (x_span, .v1 x)] => Runtime.Span.merge xs_span x_span
- | 51, [] => Runtime.Span.dummy
- | 52, [(xs_span, .v14 xs), (x_span, .v3 x)] => Runtime.Span.merge xs_span x_span
- | 53, [x, _] => x.1
- | _, _ => Runtime.Span.dummy
-
-def semV : Nat → List V → V
- | 0, [.v13 ds] => .v0 (Entities.mk ds)
- | 1, [.v2 ns] => .v1 (EntitiesDecl.namespaceDecl ns)
- | 2, [.v3 inst] => .v1 (EntitiesDecl.instanceDecl inst)
- | 3, [_, .v8 p, _, .v14 insts, _] => .v2 (EntitiesNamespace.mk (some (pathToString p)) insts)
- | 4, [_, .v6 r, .v4 parents, .v5 attrs, .v5 tags, _] => .v3 (annotate (EntityInstance.mk r parents attrs tags))
- | 5, [] => .v4 ([])
- | 6, [_, .v4 rs] => .v4 (rs)
- | 7, [.v6 r] => .v4 ([r])
- | 8, [_, .v4 rs, _] => .v4 (rs)
- | 9, [] => .v4 ([])
- | 10, [.v6 r, .v4 rest] => .v4 (r :: rest)
- | 11, [] => .v4 ([])
- | 12, [_] => .v4 ([])
- | 13, [_, .v6 r, .v4 rest] => .v4 (r :: rest)
- | 14, [] => .v5 ([])
- | 15, [_, _, .v5 kvs, _] => .v5 (kvs)
- | 16, [] => .unit (())
- | 17, [_] => .unit (())
- | 18, [] => .v5 ([])
- | 19, [_, _, .v5 kvs, _] => .v5 (kvs)
- | 20, [.v15 first, .v7 rest] => .v6 (rest [first.val])
- | 21, [_, .v9 id] => .v7 (fun path => mkEntityRef path id)
- | 22, [_, .v15 next, .v7 rest] => .v7 (fun path => rest (path ++ [next.val]))
- | 23, [.v15 first, .v8 rest] => .v8 (first.val :: rest)
- | 24, [] => .v8 ([])
- | 25, [_, .v15 next, .v8 rest] => .v8 (next.val :: rest)
- | 26, [] => .v5 ([])
- | 27, [.v9 k, _, .v10 v, .v5 rest] => .v5 ((k, v) :: rest)
- | 28, [] => .v5 ([])
- | 29, [_] => .v5 ([])
- | 30, [_, .v9 k, _, .v10 v, .v5 rest] => .v5 ((k, v) :: rest)
- | 31, [.v15 id] => .v9 (id.val)
- | 32, [.v9 s] => .v9 (s)
- | 33, [.v9 s] => .v10 (EntityValue.evString s)
- | 34, [.v16 n] => .v10 (mkLong n)
- | 35, [_, .v16 n] => .v10 (mkNegLong n)
- | 36, [_] => .v10 (EntityValue.evBool true)
- | 37, [_] => .v10 (EntityValue.evBool false)
- | 38, [_, .v12 vs, _] => .v10 (EntityValue.evSet vs)
- | 39, [_, .v5 kvs, _] => .v10 (EntityValue.evRecord kvs)
- | 40, [.v15 first, .v11 rest] => .v10 (rest [first.val])
- | 41, [_, .v9 id] => .v11 (fun path => EntityValue.evEntityRef (mkEntityRef path id))
- | 42, [_, .v15 next, .v11 rest] => .v11 (fun path => rest (path ++ [next.val]))
- | 43, [_, .v12 args, _] => .v11 (fun path => EntityValue.evExtCall path args)
- | 44, [] => .v12 ([])
- | 45, [.v10 v, .v12 rest] => .v12 (v :: rest)
- | 46, [] => .v12 ([])
- | 47, [_] => .v12 ([])
- | 48, [_, .v10 v, .v12 rest] => .v12 (v :: rest)
- | 49, [] => .v13 (#[])
- | 50, [.v13 xs, .v1 x] => .v13 (xs.push x)
- | 51, [] => .v14 (#[])
- | 52, [.v14 xs, .v3 x] => .v14 (xs.push x)
- | 53, [x, _] => x
- | _, _ => .unit ()
-
-def sem (p : Nat) (args : List VP) : VP :=
- (semS p args, semV p (args.map Prod.snd))
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v13 ds] => .v0 (Entities.mk ds)
+ | 1, _, [.v2 ns] => .v1 (EntitiesDecl.namespaceDecl ns)
+ | 2, _, [.v3 inst] => .v1 (EntitiesDecl.instanceDecl inst)
+ | 3, _, [_, .v8 p, _, .v14 insts, _] => .v2 (EntitiesNamespace.mk (some (pathToString p)) insts)
+ | 4, _, [_, .v6 r, .v4 parents, .v5 attrs, .v5 tags, _] => .v3 (annotate (EntityInstance.mk r parents attrs tags))
+ | 5, _, [] => .v4 ([])
+ | 6, _, [_, .v4 rs] => .v4 (rs)
+ | 7, _, [.v6 r] => .v4 ([r])
+ | 8, _, [_, .v4 rs, _] => .v4 (rs)
+ | 9, _, [] => .v4 ([])
+ | 10, _, [.v6 r, .v4 rest] => .v4 (r :: rest)
+ | 11, _, [] => .v4 ([])
+ | 12, _, [_] => .v4 ([])
+ | 13, _, [_, .v6 r, .v4 rest] => .v4 (r :: rest)
+ | 14, _, [] => .v5 ([])
+ | 15, _, [_, _, .v5 kvs, _] => .v5 (kvs)
+ | 16, _, [] => .unit (())
+ | 17, _, [_] => .unit (())
+ | 18, _, [] => .v5 ([])
+ | 19, _, [_, _, .v5 kvs, _] => .v5 (kvs)
+ | 20, _, [.v15 first, .v7 rest] => .v6 (rest [first.val])
+ | 21, _, [_, .v9 id] => .v7 (fun path => mkEntityRef path id)
+ | 22, _, [_, .v15 next, .v7 rest] => .v7 (fun path => rest (path ++ [next.val]))
+ | 23, _, [.v15 first, .v8 rest] => .v8 (first.val :: rest)
+ | 24, _, [] => .v8 ([])
+ | 25, _, [_, .v15 next, .v8 rest] => .v8 (next.val :: rest)
+ | 26, _, [] => .v5 ([])
+ | 27, _, [.v9 k, _, .v10 v, .v5 rest] => .v5 ((k, v) :: rest)
+ | 28, _, [] => .v5 ([])
+ | 29, _, [_] => .v5 ([])
+ | 30, _, [_, .v9 k, _, .v10 v, .v5 rest] => .v5 ((k, v) :: rest)
+ | 31, _, [.v15 id] => .v9 (id.val)
+ | 32, _, [.v9 s] => .v9 (s)
+ | 33, _, [.v9 s] => .v10 (EntityValue.evString s)
+ | 34, _, [.v16 n] => .v10 (mkLong n)
+ | 35, _, [_, .v16 n] => .v10 (mkNegLong n)
+ | 36, _, [_] => .v10 (EntityValue.evBool true)
+ | 37, _, [_] => .v10 (EntityValue.evBool false)
+ | 38, _, [_, .v12 vs, _] => .v10 (EntityValue.evSet vs)
+ | 39, _, [_, .v5 kvs, _] => .v10 (EntityValue.evRecord kvs)
+ | 40, _, [.v15 first, .v11 rest] => .v10 (rest [first.val])
+ | 41, _, [_, .v9 id] => .v11 (fun path => EntityValue.evEntityRef (mkEntityRef path id))
+ | 42, _, [_, .v15 next, .v11 rest] => .v11 (fun path => rest (path ++ [next.val]))
+ | 43, _, [_, .v12 args, _] => .v11 (fun path => EntityValue.evExtCall path args)
+ | 44, _, [] => .v12 ([])
+ | 45, _, [.v10 v, .v12 rest] => .v12 (v :: rest)
+ | 46, _, [] => .v12 ([])
+ | 47, _, [_] => .v12 ([])
+ | 48, _, [_, .v10 v, .v12 rest] => .v12 (v :: rest)
+ | 49, _, [] => .v13 (#[])
+ | 50, _, [.v13 xs, .v1 x] => .v13 (xs.push x)
+ | 51, _, [] => .v14 (#[])
+ | 52, _, [.v14 xs, .v3 x] => .v14 (xs.push x)
+ | 53, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -318,6 +261,58 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c15 st _ _ _ _ => st
| .c16 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+ | .c7 _ _ e _ _ => e
+ | .c8 _ _ e _ _ => e
+ | .c9 _ _ e _ _ => e
+ | .c10 _ _ e _ _ => e
+ | .c11 _ _ e _ _ => e
+ | .c12 _ _ e _ _ => e
+ | .c13 _ _ e _ _ => e
+ | .c14 _ _ e _ _ => e
+ | .c15 _ _ e _ _ => e
+ | .c16 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+ | .c7 st _ e _ _ => k st e
+ | .c8 st _ e _ _ => k st e
+ | .c9 st _ e _ _ => k st e
+ | .c10 st _ e _ _ => k st e
+ | .c11 st _ e _ _ => k st e
+ | .c12 st _ e _ _ => k st e
+ | .c13 st _ e _ _ => k st e
+ | .c14 st _ e _ _ => k st e
+ | .c15 st _ e _ _ => k st e
+ | .c16 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -384,6 +379,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.reduce 49, .reduce 49, .error, .error, .error, .error, .error, .error, .error, .error, .error, .error, .error,
@@ -708,7 +704,7 @@ def fuse4 : Stk → Stk :=
| _ => .fail stk
def fuse5 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 4 (Stk.top 0 __tail) (fun __st => .c4 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 4 __top (fun __st => .c4 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse6 : Stk → Stk :=
fun stk => match stk with
@@ -726,7 +722,7 @@ def fuse8 : Stk → Stk :=
| _ => .fail stk
def fuse9 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 6 (Stk.top 0 __tail) (fun __st => .c4 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 6 __top (fun __st => .c4 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse10 : Stk → Stk :=
fun stk => match stk with
@@ -734,7 +730,7 @@ def fuse10 : Stk → Stk :=
| _ => .fail stk
def fuse11 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 7 (Stk.top 0 __tail) (fun __st => .c4 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 7 __top (fun __st => .c4 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse12 : Stk → Stk :=
fun stk => match stk with
@@ -747,7 +743,7 @@ def fuse13 : Stk → Stk :=
| _ => .fail stk
def fuse14 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 8 (Stk.top 0 __tail) (fun __st => .c5 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 8 __top (fun __st => .c5 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse15 : Stk → Stk :=
fun stk => match stk with
@@ -755,7 +751,7 @@ def fuse15 : Stk → Stk :=
| _ => .fail stk
def fuse16 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 9 (Stk.top 0 __tail) (fun __st => .cUnit __st ⟨0⟩ ⟨0⟩ __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 9 __top (fun __st => .cUnit __st __e __e __tail) (fun _ => .fail __tail))
def fuse17 : Stk → Stk :=
fun stk => match stk with
@@ -763,7 +759,7 @@ def fuse17 : Stk → Stk :=
| _ => .fail stk
def fuse18 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 10 (Stk.top 0 __tail) (fun __st => .c5 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 10 __top (fun __st => .c5 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse19 : Stk → Stk :=
fun stk => match stk with
@@ -791,7 +787,7 @@ def fuse23 : Stk → Stk :=
| _ => .fail stk
def fuse24 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 14 (Stk.top 0 __tail) (fun __st => .c8 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 14 __top (fun __st => .c8 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse25 : Stk → Stk :=
fun stk => match stk with
@@ -799,7 +795,7 @@ def fuse25 : Stk → Stk :=
| _ => .fail stk
def fuse26 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 15 (Stk.top 0 __tail) (fun __st => .c5 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 15 __top (fun __st => .c5 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse27 : Stk → Stk :=
fun stk => match stk with
@@ -807,7 +803,7 @@ def fuse27 : Stk → Stk :=
| _ => .fail stk
def fuse28 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 16 (Stk.top 0 __tail) (fun __st => .c5 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 16 __top (fun __st => .c5 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse29 : Stk → Stk :=
fun stk => match stk with
@@ -885,7 +881,7 @@ def fuse43 : Stk → Stk :=
| _ => .fail stk
def fuse44 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 20 (Stk.top 0 __tail) (fun __st => .c12 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 20 __top (fun __st => .c12 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse45 : Stk → Stk :=
fun stk => match stk with
@@ -893,7 +889,7 @@ def fuse45 : Stk → Stk :=
| _ => .fail stk
def fuse46 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 21 (Stk.top 0 __tail) (fun __st => .c12 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 21 __top (fun __st => .c12 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse47 : Stk → Stk :=
fun stk => match stk with
@@ -906,7 +902,7 @@ def fuse48 : Stk → Stk :=
| _ => .fail stk
def fuse49 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 22 (Stk.top 0 __tail) (fun __st => .c13 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 22 __top (fun __st => .c13 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse50 : Stk → Stk :=
fun stk => match stk with
@@ -914,7 +910,7 @@ def fuse50 : Stk → Stk :=
| _ => .fail stk
def fuse51 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 25 23 (Stk.top 0 __tail) (fun __st => .c14 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 25 23 __top (fun __st => .c14 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse52 : Stk → Stk :=
fun stk => match stk with
@@ -949,6 +945,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -997,9 +994,9 @@ theorem fuseOK4 : Runtime.Exec.FuseOKAt stackOps flat 4 fuse4 := by
theorem fuseOK5 : Runtime.Exec.FuseOKAt stackOps flat 5 fuse5 := by
intro stk
- unfold fuse5
+ simp only [fuse5, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 5
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 5
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK6 : Runtime.Exec.FuseOKAt stackOps flat 6 fuse6 := by
@@ -1031,9 +1028,9 @@ theorem fuseOK8 : Runtime.Exec.FuseOKAt stackOps flat 8 fuse8 := by
theorem fuseOK9 : Runtime.Exec.FuseOKAt stackOps flat 9 fuse9 := by
intro stk
- unfold fuse9
+ simp only [fuse9, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 9
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 9
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK10 : Runtime.Exec.FuseOKAt stackOps flat 10 fuse10 := by
@@ -1047,9 +1044,9 @@ theorem fuseOK10 : Runtime.Exec.FuseOKAt stackOps flat 10 fuse10 := by
theorem fuseOK11 : Runtime.Exec.FuseOKAt stackOps flat 11 fuse11 := by
intro stk
- unfold fuse11
+ simp only [fuse11, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 11
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 11
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK12 : Runtime.Exec.FuseOKAt stackOps flat 12 fuse12 := by
@@ -1072,9 +1069,9 @@ theorem fuseOK13 : Runtime.Exec.FuseOKAt stackOps flat 13 fuse13 := by
theorem fuseOK14 : Runtime.Exec.FuseOKAt stackOps flat 14 fuse14 := by
intro stk
- unfold fuse14
+ simp only [fuse14, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 14
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 14
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK15 : Runtime.Exec.FuseOKAt stackOps flat 15 fuse15 := by
@@ -1088,9 +1085,9 @@ theorem fuseOK15 : Runtime.Exec.FuseOKAt stackOps flat 15 fuse15 := by
theorem fuseOK16 : Runtime.Exec.FuseOKAt stackOps flat 16 fuse16 := by
intro stk
- unfold fuse16
+ simp only [fuse16, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 16
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 16
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK17 : Runtime.Exec.FuseOKAt stackOps flat 17 fuse17 := by
@@ -1104,9 +1101,9 @@ theorem fuseOK17 : Runtime.Exec.FuseOKAt stackOps flat 17 fuse17 := by
theorem fuseOK18 : Runtime.Exec.FuseOKAt stackOps flat 18 fuse18 := by
intro stk
- unfold fuse18
+ simp only [fuse18, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 18
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 18
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK19 : Runtime.Exec.FuseOKAt stackOps flat 19 fuse19 := by
@@ -1156,9 +1153,9 @@ theorem fuseOK23 : Runtime.Exec.FuseOKAt stackOps flat 23 fuse23 := by
theorem fuseOK24 : Runtime.Exec.FuseOKAt stackOps flat 24 fuse24 := by
intro stk
- unfold fuse24
+ simp only [fuse24, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 24
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 24
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK25 : Runtime.Exec.FuseOKAt stackOps flat 25 fuse25 := by
@@ -1172,9 +1169,9 @@ theorem fuseOK25 : Runtime.Exec.FuseOKAt stackOps flat 25 fuse25 := by
theorem fuseOK26 : Runtime.Exec.FuseOKAt stackOps flat 26 fuse26 := by
intro stk
- unfold fuse26
+ simp only [fuse26, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 26
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 26
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK27 : Runtime.Exec.FuseOKAt stackOps flat 27 fuse27 := by
@@ -1188,9 +1185,9 @@ theorem fuseOK27 : Runtime.Exec.FuseOKAt stackOps flat 27 fuse27 := by
theorem fuseOK28 : Runtime.Exec.FuseOKAt stackOps flat 28 fuse28 := by
intro stk
- unfold fuse28
+ simp only [fuse28, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 28
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 28
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK29 : Runtime.Exec.FuseOKAt stackOps flat 29 fuse29 := by
@@ -1330,9 +1327,9 @@ theorem fuseOK43 : Runtime.Exec.FuseOKAt stackOps flat 43 fuse43 := by
theorem fuseOK44 : Runtime.Exec.FuseOKAt stackOps flat 44 fuse44 := by
intro stk
- unfold fuse44
+ simp only [fuse44, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 44
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 44
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK45 : Runtime.Exec.FuseOKAt stackOps flat 45 fuse45 := by
@@ -1346,9 +1343,9 @@ theorem fuseOK45 : Runtime.Exec.FuseOKAt stackOps flat 45 fuse45 := by
theorem fuseOK46 : Runtime.Exec.FuseOKAt stackOps flat 46 fuse46 := by
intro stk
- unfold fuse46
+ simp only [fuse46, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 46
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 46
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK47 : Runtime.Exec.FuseOKAt stackOps flat 47 fuse47 := by
@@ -1371,9 +1368,9 @@ theorem fuseOK48 : Runtime.Exec.FuseOKAt stackOps flat 48 fuse48 := by
theorem fuseOK49 : Runtime.Exec.FuseOKAt stackOps flat 49 fuse49 := by
intro stk
- unfold fuse49
+ simp only [fuse49, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 49
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 49
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK50 : Runtime.Exec.FuseOKAt stackOps flat 50 fuse50 := by
@@ -1387,9 +1384,9 @@ theorem fuseOK50 : Runtime.Exec.FuseOKAt stackOps flat 50 fuse50 := by
theorem fuseOK51 : Runtime.Exec.FuseOKAt stackOps flat 51 fuse51 := by
intro stk
- unfold fuse51
+ simp only [fuse51, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 51
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 51
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK52 : Runtime.Exec.FuseOKAt stackOps flat 52 fuse52 := by
@@ -1464,19 +1461,6 @@ theorem parseStr_total (input : String) (k : Nat) :
· left; rw [h]
· right; rw [h]
-theorem semSpanFree : Runtime.Exec.SemSpanFree sem :=
- Runtime.Exec.SemSpanFree.of_split semS semV
-
-theorem parse_spanIndependent : Runtime.Exec.SpanIndependent (fun ts k => parse ts k) :=
- Runtime.Exec.SpanIndependent.of_run flat.toExecTable semSpanFree termOf valOf
- (fun r => match r with | .ok (.v0 x) => some x | _ => none) (by
- intro ts k
- unfold parse run
- rw [Runtime.Exec.runFast_eq_run stackOps flat fuse termOf valOf stackLawful fuseOK]
- cases Runtime.Exec.run flat.toExecTable (ts.map (Runtime.Exec.decodeWith termOf valOf)) k with
- | ok v => obtain ⟨_, v⟩ := v; cases v <;> rfl
- | _ => rfl)
-
/-- The readable name of a terminal index (EOF is "end of input"). -/
def terminalName : Nat → String
| 0 => "NAMESPACE"
diff --git a/test/cedarentities/CedarEntitiesVerified.lean b/test/cedarentities/CedarEntitiesVerified.lean
index ddc078e..6e34971 100644
--- a/test/cedarentities/CedarEntitiesVerified.lean
+++ b/test/cedarentities/CedarEntitiesVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -28,6 +30,9 @@ public import cedarentities.CedarEntitiesParser
import all cedarentities.CedarEntitiesParser
meta import cedarentities.CedarEntitiesParser
public import LeanParserGenerator.Lexer.StreamRun
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.SpanText
+public import LeanParserGenerator.Runtime.ParseEnd
public import cedarentities.CedarEntitiesLexer
@@ -44,6 +49,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace CedarEntitiesVerified
abbrev Terminal := Fin 23
@@ -199,57 +206,57 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 24
augmentedProduction := 53 }
-def semTbl : List (Σ T : Type, T → CedarEntitiesParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨({s : String // s ∉ keywords} : Type), fun v => (Runtime.Span.dummy, .v15 v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v16 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Entities : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(EntitiesDecl : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(EntitiesNamespace : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(Annotated EntityInstance : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(List EntityReference : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(List EntityReference : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(List EntityReference : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(List EntityReference : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(List (String × EntityValue) : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(List (String × EntityValue) : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(EntityReference : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨((List String → EntityReference) : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(List String : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(List String : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(List (String × EntityValue) : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(List (String × EntityValue) : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(EntityValue : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨((List String → EntityValue) : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(List EntityValue : Type), fun v => (Runtime.Span.dummy, .v12 v)⟩,
- ⟨(List EntityValue : Type), fun v => (Runtime.Span.dummy, .v12 v)⟩,
- ⟨(Array (EntitiesDecl) : Type), fun v => (Runtime.Span.dummy, .v13 v)⟩,
- ⟨(Array (Annotated EntityInstance) : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Entities : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → CedarEntitiesParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → CedarEntitiesParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨({s : String // s ∉ keywords} : Type), fun v => .v15 v⟩,
+ ⟨(Nat : Type), fun v => .v16 v⟩,
+ ⟨(String : Type), fun v => .v9 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Entities : Type), fun v => .v0 v⟩,
+ ⟨(EntitiesDecl : Type), fun v => .v1 v⟩,
+ ⟨(EntitiesNamespace : Type), fun v => .v2 v⟩,
+ ⟨(Annotated EntityInstance : Type), fun v => .v3 v⟩,
+ ⟨(List EntityReference : Type), fun v => .v4 v⟩,
+ ⟨(List EntityReference : Type), fun v => .v4 v⟩,
+ ⟨(List EntityReference : Type), fun v => .v4 v⟩,
+ ⟨(List EntityReference : Type), fun v => .v4 v⟩,
+ ⟨(List (String × EntityValue) : Type), fun v => .v5 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(List (String × EntityValue) : Type), fun v => .v5 v⟩,
+ ⟨(EntityReference : Type), fun v => .v6 v⟩,
+ ⟨((List String → EntityReference) : Type), fun v => .v7 v⟩,
+ ⟨(List String : Type), fun v => .v8 v⟩,
+ ⟨(List String : Type), fun v => .v8 v⟩,
+ ⟨(List (String × EntityValue) : Type), fun v => .v5 v⟩,
+ ⟨(List (String × EntityValue) : Type), fun v => .v5 v⟩,
+ ⟨(String : Type), fun v => .v9 v⟩,
+ ⟨(EntityValue : Type), fun v => .v10 v⟩,
+ ⟨((List String → EntityValue) : Type), fun v => .v11 v⟩,
+ ⟨(List EntityValue : Type), fun v => .v12 v⟩,
+ ⟨(List EntityValue : Type), fun v => .v12 v⟩,
+ ⟨(Array (EntitiesDecl) : Type), fun v => .v13 v⟩,
+ ⟨(Array (Annotated EntityInstance) : Type), fun v => .v14 v⟩,
+ ⟨(Entities : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → CedarEntitiesParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -258,172 +265,172 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (ds : Array (EntitiesDecl)) => (Entities.mk ds)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ds : Array (EntitiesDecl)) => (Entities.mk ds)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (ns : EntitiesNamespace) => (EntitiesDecl.namespaceDecl ns)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ns : EntitiesNamespace) => (EntitiesDecl.namespaceDecl ns)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (inst : Annotated EntityInstance) => (EntitiesDecl.instanceDecl inst)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (inst : Annotated EntityInstance) => (EntitiesDecl.instanceDecl inst)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (insts : Array (Annotated EntityInstance)) (_ : Unit) (p : List String) (_ : Unit) => (EntitiesNamespace.mk (some (pathToString p)) insts)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (insts : Array (Annotated EntityInstance)) (_ : Unit) (p : List String) (_ : Unit) => (EntitiesNamespace.mk (some (pathToString p)) insts)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (tags : List (String × EntityValue)) (attrs : List (String × EntityValue)) (parents : List EntityReference) (r : EntityReference) (_ : Unit) => (annotate (EntityInstance.mk r parents attrs tags))
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (tags : List (String × EntityValue)) (attrs : List (String × EntityValue)) (parents : List EntityReference) (r : EntityReference) (_ : Unit) => (annotate (EntityInstance.mk r parents attrs tags))
-def semanticAction5 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List EntityReference)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List EntityReference)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (rs : List EntityReference) (_ : Unit) => (rs)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rs : List EntityReference) (_ : Unit) => (rs)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (r : EntityReference) => ([r])
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (r : EntityReference) => ([r])
-def semanticAction8 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (rs : List EntityReference) (_ : Unit) => (rs)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (rs : List EntityReference) (_ : Unit) => (rs)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List EntityReference)
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List EntityReference)
-def semanticAction10 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List EntityReference) (r : EntityReference) => (r :: rest)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List EntityReference) (r : EntityReference) => (r :: rest)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List EntityReference)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List EntityReference)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction13 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List EntityReference) (r : EntityReference) (_ : Unit) => (r :: rest)
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List EntityReference) (r : EntityReference) (_ : Unit) => (r :: rest)
-def semanticAction14 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (String × EntityValue))
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (String × EntityValue))
-def semanticAction15 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (kvs : List (String × EntityValue)) (_ : Unit) (_ : Unit) => (kvs)
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (kvs : List (String × EntityValue)) (_ : Unit) (_ : Unit) => (kvs)
-def semanticAction16 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((()) : Unit)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((()) : Unit)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction18 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (String × EntityValue))
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (String × EntityValue))
-def semanticAction19 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (kvs : List (String × EntityValue)) (_ : Unit) (_ : Unit) => (kvs)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (kvs : List (String × EntityValue)) (_ : Unit) (_ : Unit) => (kvs)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List String → EntityReference)) (first : {s : String // s ∉ keywords}) => (rest [first.val])
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List String → EntityReference)) (first : {s : String // s ∉ keywords}) => (rest [first.val])
-def semanticAction21 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (id : String) (_ : Unit) => (fun path => mkEntityRef path id)
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (id : String) (_ : Unit) => (fun path => mkEntityRef path id)
-def semanticAction22 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List String → EntityReference)) (next : {s : String // s ∉ keywords}) (_ : Unit) => (fun path => rest (path ++ [next.val]))
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List String → EntityReference)) (next : {s : String // s ∉ keywords}) (_ : Unit) => (fun path => rest (path ++ [next.val]))
-def semanticAction23 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List String) (first : {s : String // s ∉ keywords}) => (first.val :: rest)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List String) (first : {s : String // s ∉ keywords}) => (first.val :: rest)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List String)
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List String)
-def semanticAction25 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List String) (next : {s : String // s ∉ keywords}) (_ : Unit) => (next.val :: rest)
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List String) (next : {s : String // s ∉ keywords}) (_ : Unit) => (next.val :: rest)
-def semanticAction26 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (String × EntityValue))
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (String × EntityValue))
-def semanticAction27 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (String × EntityValue)) (v : EntityValue) (_ : Unit) (k : String) => ((k, v) :: rest)
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (String × EntityValue)) (v : EntityValue) (_ : Unit) (k : String) => ((k, v) :: rest)
-def semanticAction28 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (String × EntityValue))
+def semanticAction28 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (String × EntityValue))
-def semanticAction29 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction29 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction30 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (String × EntityValue)) (v : EntityValue) (_ : Unit) (k : String) (_ : Unit) => ((k, v) :: rest)
+def semanticAction30 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (String × EntityValue)) (v : EntityValue) (_ : Unit) (k : String) (_ : Unit) => ((k, v) :: rest)
-def semanticAction31 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (id : {s : String // s ∉ keywords}) => (id.val)
+def semanticAction31 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (id : {s : String // s ∉ keywords}) => (id.val)
-def semanticAction32 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : String) => (s)
+def semanticAction32 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : String) => (s)
-def semanticAction33 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : String) => (EntityValue.evString s)
+def semanticAction33 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : String) => (EntityValue.evString s)
-def semanticAction34 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) => (mkLong n)
+def semanticAction34 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) => (mkLong n)
-def semanticAction35 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Nat) (_ : Unit) => (mkNegLong n)
+def semanticAction35 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Nat) (_ : Unit) => (mkNegLong n)
-def semanticAction36 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (EntityValue.evBool true)
+def semanticAction36 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (EntityValue.evBool true)
-def semanticAction37 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (EntityValue.evBool false)
+def semanticAction37 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (EntityValue.evBool false)
-def semanticAction38 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (vs : List EntityValue) (_ : Unit) => (EntityValue.evSet vs)
+def semanticAction38 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (vs : List EntityValue) (_ : Unit) => (EntityValue.evSet vs)
-def semanticAction39 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (kvs : List (String × EntityValue)) (_ : Unit) => (EntityValue.evRecord kvs)
+def semanticAction39 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨15, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (kvs : List (String × EntityValue)) (_ : Unit) => (EntityValue.evRecord kvs)
-def semanticAction40 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List String → EntityValue)) (first : {s : String // s ∉ keywords}) => (rest [first.val])
+def semanticAction40 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List String → EntityValue)) (first : {s : String // s ∉ keywords}) => (rest [first.val])
-def semanticAction41 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (id : String) (_ : Unit) => (fun path => EntityValue.evEntityRef (mkEntityRef path id))
+def semanticAction41 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (id : String) (_ : Unit) => (fun path => EntityValue.evEntityRef (mkEntityRef path id))
-def semanticAction42 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List String → EntityValue)) (next : {s : String // s ∉ keywords}) (_ : Unit) => (fun path => rest (path ++ [next.val]))
+def semanticAction42 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List String → EntityValue)) (next : {s : String // s ∉ keywords}) (_ : Unit) => (fun path => rest (path ++ [next.val]))
-def semanticAction43 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (args : List EntityValue) (_ : Unit) => (fun path => EntityValue.evExtCall path args)
+def semanticAction43 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (args : List EntityValue) (_ : Unit) => (fun path => EntityValue.evExtCall path args)
-def semanticAction44 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List EntityValue)
+def semanticAction44 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List EntityValue)
-def semanticAction45 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List EntityValue) (v : EntityValue) => (v :: rest)
+def semanticAction45 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List EntityValue) (v : EntityValue) => (v :: rest)
-def semanticAction46 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List EntityValue)
+def semanticAction46 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List EntityValue)
-def semanticAction47 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction47 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction48 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List EntityValue) (v : EntityValue) (_ : Unit) => (v :: rest)
+def semanticAction48 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List EntityValue) (v : EntityValue) (_ : Unit) => (v :: rest)
-def semanticAction49 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (EntitiesDecl))
+def semanticAction49 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (EntitiesDecl))
-def semanticAction50 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : EntitiesDecl) (xs : Array (EntitiesDecl)) => (xs.push x)
+def semanticAction50 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : EntitiesDecl) (xs : Array (EntitiesDecl)) => (xs.push x)
-def semanticAction51 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Annotated EntityInstance))
+def semanticAction51 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Annotated EntityInstance))
-def semanticAction52 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Annotated EntityInstance) (xs : Array (Annotated EntityInstance)) => (xs.push x)
+def semanticAction52 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Annotated EntityInstance) (xs : Array (Annotated EntityInstance)) => (xs.push x)
-def semanticAction53 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction53 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨22, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨2, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨3, of_decide_eq_true rfl⟩]) semanticAction2
@@ -486,7 +493,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -568,13 +575,15 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
abbrev lastSymb' : NonInitState → Symbol Terminal NonTerminal
| s => match s with
| ⟨0, _⟩ => Symbol.NT ⟨22, of_decide_eq_true rfl⟩
@@ -1398,455 +1407,455 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Entities :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Entities :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CedarEntitiesParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CedarEntitiesParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees28 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 28 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 28 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees29 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 29 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 29 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees30 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 30 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 30 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees31 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 31 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 31 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees32 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 32 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 32 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees33 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 33 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 33 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees34 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 34 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 34 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees35 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 35 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 35 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees36 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 36 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 36 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees37 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 37 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 37 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees38 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 38 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 38 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees39 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 39 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 39 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees40 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 40 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 40 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees41 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 41 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 41 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees42 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 42 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 42 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees43 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 43 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 43 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees44 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 44 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 44 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees45 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 45 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 45 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees46 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 46 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 46 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees47 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 47 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 47 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees48 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 48 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 48 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees49 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 49 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 49 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees50 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 50 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 50 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees51 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 51 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 51 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees52 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 52 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 52 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees53 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
- CedarEntitiesParser.table.sem 53 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
+ CedarEntitiesParser.semV 53 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- CedarEntitiesParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ CedarEntitiesParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨28, _⟩, values => refinementSemanticAgrees28 values
- | ⟨29, _⟩, values => refinementSemanticAgrees29 values
- | ⟨30, _⟩, values => refinementSemanticAgrees30 values
- | ⟨31, _⟩, values => refinementSemanticAgrees31 values
- | ⟨32, _⟩, values => refinementSemanticAgrees32 values
- | ⟨33, _⟩, values => refinementSemanticAgrees33 values
- | ⟨34, _⟩, values => refinementSemanticAgrees34 values
- | ⟨35, _⟩, values => refinementSemanticAgrees35 values
- | ⟨36, _⟩, values => refinementSemanticAgrees36 values
- | ⟨37, _⟩, values => refinementSemanticAgrees37 values
- | ⟨38, _⟩, values => refinementSemanticAgrees38 values
- | ⟨39, _⟩, values => refinementSemanticAgrees39 values
- | ⟨40, _⟩, values => refinementSemanticAgrees40 values
- | ⟨41, _⟩, values => refinementSemanticAgrees41 values
- | ⟨42, _⟩, values => refinementSemanticAgrees42 values
- | ⟨43, _⟩, values => refinementSemanticAgrees43 values
- | ⟨44, _⟩, values => refinementSemanticAgrees44 values
- | ⟨45, _⟩, values => refinementSemanticAgrees45 values
- | ⟨46, _⟩, values => refinementSemanticAgrees46 values
- | ⟨47, _⟩, values => refinementSemanticAgrees47 values
- | ⟨48, _⟩, values => refinementSemanticAgrees48 values
- | ⟨49, _⟩, values => refinementSemanticAgrees49 values
- | ⟨50, _⟩, values => refinementSemanticAgrees50 values
- | ⟨51, _⟩, values => refinementSemanticAgrees51 values
- | ⟨52, _⟩, values => refinementSemanticAgrees52 values
- | ⟨53, _⟩, values => refinementSemanticAgrees53 values
- | ⟨n + 54, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨28, _⟩, spans, values => refinementSemanticAgrees28 spans values
+ | ⟨29, _⟩, spans, values => refinementSemanticAgrees29 spans values
+ | ⟨30, _⟩, spans, values => refinementSemanticAgrees30 spans values
+ | ⟨31, _⟩, spans, values => refinementSemanticAgrees31 spans values
+ | ⟨32, _⟩, spans, values => refinementSemanticAgrees32 spans values
+ | ⟨33, _⟩, spans, values => refinementSemanticAgrees33 spans values
+ | ⟨34, _⟩, spans, values => refinementSemanticAgrees34 spans values
+ | ⟨35, _⟩, spans, values => refinementSemanticAgrees35 spans values
+ | ⟨36, _⟩, spans, values => refinementSemanticAgrees36 spans values
+ | ⟨37, _⟩, spans, values => refinementSemanticAgrees37 spans values
+ | ⟨38, _⟩, spans, values => refinementSemanticAgrees38 spans values
+ | ⟨39, _⟩, spans, values => refinementSemanticAgrees39 spans values
+ | ⟨40, _⟩, spans, values => refinementSemanticAgrees40 spans values
+ | ⟨41, _⟩, spans, values => refinementSemanticAgrees41 spans values
+ | ⟨42, _⟩, spans, values => refinementSemanticAgrees42 spans values
+ | ⟨43, _⟩, spans, values => refinementSemanticAgrees43 spans values
+ | ⟨44, _⟩, spans, values => refinementSemanticAgrees44 spans values
+ | ⟨45, _⟩, spans, values => refinementSemanticAgrees45 spans values
+ | ⟨46, _⟩, spans, values => refinementSemanticAgrees46 spans values
+ | ⟨47, _⟩, spans, values => refinementSemanticAgrees47 spans values
+ | ⟨48, _⟩, spans, values => refinementSemanticAgrees48 spans values
+ | ⟨49, _⟩, spans, values => refinementSemanticAgrees49 spans values
+ | ⟨50, _⟩, spans, values => refinementSemanticAgrees50 spans values
+ | ⟨51, _⟩, spans, values => refinementSemanticAgrees51 spans values
+ | ⟨52, _⟩, spans, values => refinementSemanticAgrees52 spans values
+ | ⟨53, _⟩, spans, values => refinementSemanticAgrees53 spans values
+ | ⟨n + 54, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -1953,17 +1962,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- CedarEntitiesParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ CedarEntitiesParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) CedarEntitiesParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) CedarEntitiesParser.V := {
table := CedarEntitiesParser.table
- decode := fun t => CedarEntitiesParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := CedarEntitiesParser.semV
+ decode := CedarEntitiesParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -2008,13 +2019,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change CedarEntitiesParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change CedarEntitiesParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -2022,21 +2034,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (CedarEntitiesParser.run input logNSteps) := by
+ have hrun : CedarEntitiesParser.run input logNSteps
= Runtime.Exec.run CedarEntitiesParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [CedarEntitiesParser.run]
rw [Runtime.Exec.runFast_eq_run CedarEntitiesParser.stackOps CedarEntitiesParser.flat CedarEntitiesParser.fuse
CedarEntitiesParser.termOf CedarEntitiesParser.valOf CedarEntitiesParser.stackLawful CedarEntitiesParser.fuseOK]
- simp only [CedarEntitiesParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- CedarEntitiesParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ CedarEntitiesParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold CedarEntitiesParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -2044,49 +2056,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : CedarEntitiesParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Entities)
- (accepted : CedarEntitiesParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : CedarEntitiesParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (CedarEntitiesParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (CedarEntitiesParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : CedarEntitiesParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -2095,7 +2109,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- CedarEntitiesParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ CedarEntitiesParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -2111,13 +2125,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- CedarEntitiesParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ CedarEntitiesParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -2127,65 +2143,59 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
-
-/-- `lexPos` and `CedarEntitiesLexer.tokenize` succeed on the same inputs with the same tokens. Stated, not proved. -/
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
+
+/-- `lexPos` and `CedarEntitiesLexer.tokenize` succeed on the same inputs with the same tokens. Proved as
+ `posLexerAgrees`. -/
abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees CedarEntitiesLexer.cbyte CedarEntitiesLexer.tokenize
-/-- `CedarEntitiesParser.parse` ignores token spans. Proved as `spanIndependent`. -/
-abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => CedarEntitiesParser.parse ts k)
-
-theorem spanIndependent : SpanIndependent := CedarEntitiesParser.parse_spanIndependent
+theorem posLexerAgrees : PosLexerAgrees := CedarEntitiesLexer.posLexerAgrees
-theorem parse_eq_dependent_spans (input : List (Runtime.Positioned Tok)) (k : Nat) :
- CedarEntitiesParser.parse input k = parse (input.map (·.val)) k := by
- have hs : CedarEntitiesParser.parse input k = CedarEntitiesParser.parse (input.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent input k
- rw [hs, ← parse_eq_dependent (input.map (·.val)) k, List.map_map]
- rfl
+theorem lexPos_eq_of_tokenize (s : String) (ts : List (Runtime.Positioned Tok)) (h : CedarEntitiesLexer.tokenize s = .ok ts) :
+ Lexer.lexPos CedarEntitiesLexer.cbyte s = .ok ts := by
+ have hagree := posLexerAgrees s
+ rw [h] at hagree
+ revert hagree
+ cases Lexer.lexPos CedarEntitiesLexer.cbyte s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
-theorem parseStr_eq (hlex : PosLexerAgrees) (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+theorem parseStr_eq (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
(h : CedarEntitiesLexer.tokenize s = .ok ts) : CedarEntitiesParser.parseStr s k = CedarEntitiesParser.parse ts k := by
- have hp : Lexer.lexPos CedarEntitiesLexer.cbyte s = .ok ts := by
- have hagree := hlex s
- rw [h] at hagree
- revert hagree
- cases Lexer.lexPos CedarEntitiesLexer.cbyte s with
- | error e => intro hc; simp [Except.toOption] at hc
- | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+ have hp : Lexer.lexPos CedarEntitiesLexer.cbyte s = .ok ts := lexPos_eq_of_tokenize s ts h
exact CedarEntitiesParser.parseStr_eq_lexPos s k ts hp
-theorem parseStr_eq_dependent (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_eq_dependent (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : CedarEntitiesLexer.tokenize s = .ok ts) :
- CedarEntitiesParser.parseStr s k = parse (ts.map (·.val)) k := by
- have hs : CedarEntitiesParser.parse ts k = CedarEntitiesParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs, ← parse_eq_dependent (ts.map (·.val)) k, List.map_map]
- rfl
+ CedarEntitiesParser.parseStr s k = parse ts k := by
+ rw [parseStr_eq s k ts h, parse_eq_dependent]
-theorem parseStr_sound (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_sound (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : CedarEntitiesLexer.tokenize s = .ok ts) (p : Entities)
(accepted : CedarEntitiesParser.parseStr s k = some p) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
- toStream (ts.map (·.val)) = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = p := by
- have hs : CedarEntitiesParser.parse ts k = CedarEntitiesParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- spanIndependent ts k
- rw [parseStr_eq hlex s k ts h, hs] at accepted
- exact parser_sound (ts.map (·.val)) k p
- (by simpa [List.map_map, Function.comp_def] using accepted)
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ rw [parseStr_eq s k ts h] at accepted
+ exact parser_sound ts k p accepted
/-- When `tokenize` fails, the byte lexer delivers a prefix `ts` and fails, and `parseStr`
is `none` or `parse` of an extension of `ts`. -/
-theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat)
+theorem parseStr_of_tokenize_error (s : String) (k : Nat)
(e : Lexer.LexError) (h : CedarEntitiesLexer.tokenize s = .error e) :
∃ ts e', Runtime.Exec.Fails (Lexer.pullSource (Lexer.pullAux CedarEntitiesLexer.cbyte s.toUTF8))
⟨false, s.toUTF8.size + 1, 0, [CedarEntitiesLexer.cbyte.flat.base.start]⟩ ts e' ∧
@@ -2194,10 +2204,281 @@ theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat
· exfalso
have hp : Lexer.lexPos CedarEntitiesLexer.cbyte s = .ok ts :=
Lexer.lexPosAux_of_denotes CedarEntitiesLexer.cbyte s.toUTF8 _ _ _ ts hD
- have hagree := hlex s
+ have hagree := posLexerAgrees s
rw [hp, h] at hagree
simp [Except.toOption] at hagree
· exact hF
+/-- Every production of the start symbol has the end marker `$` on its right-hand side. -/
+theorem startProds_end : ∀ p : Production,
+ prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ Symbol.T (⟨22, of_decide_eq_true rfl⟩ : Terminal) ∈ prodRhsRev' p := by
+ native_decide
+
+theorem tokenTerm_eq_end (t : Tok)
+ (h : tokenTerm' t = (⟨22, of_decide_eq_true rfl⟩ : Terminal)) : t = .EOF := by
+ cases t <;> first | rfl | exact absurd (congrArg Fin.val h) (Nat.ne_of_beq_eq_false rfl)
+
+/-- The dependent parser does not accept a token list with no `EOF` that is longer than
+ `2^k`: it has not reached the end marker. -/
+theorem dependent_ne_parsed_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length)
+ (r : SpanGrammar.semR (SG := spanGrammarInst) (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))))
+ (rest : Runtime.NatStream grammarInst.Token) :
+ Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k ≠ .Parsed r rest :=
+ Runtime.parse_ne_parsed_of_no_end (G := grammarInst) (A := automatonInst) _ _
+ startProds_end input ⟨.EOF, Runtime.Span.dummy⟩ rfl
+ (fun t ht he => hin t ht (tokenTerm_eq_end t.val he)) k hlen r rest
+
+theorem parse_eq_none_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length) : parse input k = none := by
+ unfold parse
+ cases hp : Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k with
+ | Parsed r rest => exact absurd hp (dependent_ne_parsed_of_no_eof input k hin hlen r rest)
+ | _ => rfl
+
+/-- A prefix of lexed tokens with no `EOF`, padded with copies of its first token. -/
+theorem no_eof_pad (t0 : Runtime.Positioned Tok) (ts : List (Runtime.Positioned Tok))
+ (hts : ∀ t ∈ t0 :: ts, t.val ≠ .EOF) (k : Nat) :
+ (∀ t ∈ t0 :: ts ++ List.replicate (2 ^ k + 1) t0, t.val ≠ .EOF) ∧
+ 2 ^ k < (t0 :: ts ++ List.replicate (2 ^ k + 1) t0).length := by
+ constructor
+ · intro x hx
+ rcases List.mem_append.mp hx with hx | hx
+ · exact hts x hx
+ · rw [List.eq_of_mem_replicate hx]; exact hts t0 (List.mem_cons_self ..)
+ · simp only [List.length_append, List.length_replicate, List.length_cons]
+ omega
+
+/-- **Lex failure.** When the positioned byte lexer fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_lexPos (s : String) (k : Nat)
+ (h : ∀ ts, Lexer.lexPos CedarEntitiesLexer.cbyte s ≠ .ok ts) : CedarEntitiesParser.parseStr s k = none := by
+ rcases CedarEntitiesParser.parseStr_total s k with ⟨ts, hD, _⟩ | ⟨ts, e, hF, hr⟩
+ · exact absurd (Lexer.lexPosAux_of_denotes CedarEntitiesLexer.cbyte s.toUTF8 _ _ _ ts hD) (h ts)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens CedarEntitiesLexer.cbyte CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) CedarEntitiesLexer.noEofEmit s.toUTF8 _ ts e hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ unfold CedarEntitiesParser.parseStr
+ rw [CedarEntitiesParser.runStream_eq_runSrc]
+ unfold Runtime.Exec.runSrc
+ rw [hn]
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · exact h1
+ · rw [h1, parse_eq_dependent]
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ exact parse_eq_none_of_no_eof _ k hin hlen
+
+/-- **Lex failure.** When `tokenize` fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_tokenize_error (s : String) (k : Nat)
+ (e : Lexer.LexError) (h : CedarEntitiesLexer.tokenize s = .error e) : CedarEntitiesParser.parseStr s k = none :=
+ parseStr_eq_none_of_lexPos s k (fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree)
+
+/-- **Lex failure, stream engine.** When `tokenize` fails, `runStream` does not accept. It may
+ reject or run out of steps before it reaches the lex error, so the result need not be
+ `.err`. -/
+theorem runStream_ne_ok_of_tokenize_error (s : String) (k : Nat) (e : Lexer.LexError)
+ (h : CedarEntitiesLexer.tokenize s = .error e) : ∀ v, CedarEntitiesParser.runStream s k ≠ .ok v := by
+ intro v hok
+ have hlex : ∀ ts, Lexer.lexPos CedarEntitiesLexer.cbyte s ≠ .ok ts := fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree
+ unfold CedarEntitiesParser.runStream at hok
+ rcases Lexer.runStreamFast_total (ops := CedarEntitiesParser.stackOps) CedarEntitiesParser.flat CedarEntitiesParser.fuse CedarEntitiesParser.termOf CedarEntitiesLexer.cbyte
+ CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree_byte s (2 ^ k) with ⟨ts, hD, _⟩ | ⟨ts, e', hF, hr⟩
+ · exact hlex ts (Lexer.lexPosAux_of_denotes CedarEntitiesLexer.cbyte s.toUTF8 _ _ _ ts hD)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens CedarEntitiesLexer.cbyte CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) CedarEntitiesLexer.noEofEmit s.toUTF8 _ ts e' hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ rw [Lexer.runStreamFast_eq_runSrc (ops := CedarEntitiesParser.stackOps) CedarEntitiesParser.flat CedarEntitiesParser.fuse CedarEntitiesParser.termOf
+ CedarEntitiesLexer.cbyte CedarEntitiesLexer.fastActs CedarEntitiesLexer.fastActs_agree_byte] at hok
+ unfold Runtime.Exec.runSrc at hok
+ rw [hn] at hok
+ cases hok
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · rw [h1] at hok; cases hok
+ · rw [h1] at hok
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ have related := parserRunRefines (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k
+ have hw : CedarEntitiesParser.run (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k = .ok v := hok
+ rw [hw] at related
+ generalize hdep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (Runtime.Refinement.listStream executableRefinement
+ (t0 :: rest ++ List.replicate (2 ^ k + 1) t0)) k = dep at related
+ cases related with
+ | parsed value stream =>
+ exact dependent_ne_parsed_of_no_eof _ k hin hlen value stream hdep
+
+/-- **End to end.** If `parseStr` accepts `s` with value `p`, then `tokenize` lexes `s` to
+ `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem parseStr_sound_tokenize (s : String) (k : Nat) (p : Entities)
+ (accepted : CedarEntitiesParser.parseStr s k = some p) :
+ ∃ ts, CedarEntitiesLexer.tokenize s = .ok ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ cases ht : CedarEntitiesLexer.tokenize s with
+ | error e =>
+ rw [parseStr_eq_none_of_tokenize_error s k e ht] at accepted
+ cases accepted
+ | ok ts => exact ⟨ts, rfl, parseStr_sound s k ts ht p accepted⟩
+
+/-- **End to end, with the lexer specification.** If `parseStr` accepts `s` with value `p`,
+ then `s` has a maximal-munch tokenization (`Lexer.Tokenization`), the spec tokenizer
+ returns the token values of `ts = tokenize s`, and `ts` starts with the word of a parse
+ tree whose value is `p`. -/
+theorem parseStr_sound_tokenization (s : String) (k : Nat) (p : Entities)
+ (accepted : CedarEntitiesParser.parseStr s k = some p) :
+ ∃ ts, CedarEntitiesLexer.tokenize s = .ok ts ∧ Lexer.Tokenization CedarEntitiesLexer.rules0 s.toList ∧
+ Lexer.tokenize CedarEntitiesLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ obtain ⟨htok, hspec⟩ := CedarEntitiesLexer.tokenize_sound ht
+ exact ⟨ts, ht, htok, hspec, hp⟩
+
+/-- **`tokenize` then `parse`.** If `tokenize` lexes `s` to `ts` and `parse` accepts `ts` with
+ value `p`, then `s` has a maximal-munch tokenization, the spec tokenizer returns the token
+ values of `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem tokenize_parse_sound (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok)) (p : Entities)
+ (h : CedarEntitiesLexer.tokenize s = .ok ts) (accepted : CedarEntitiesParser.parse ts k = some p) :
+ Lexer.Tokenization CedarEntitiesLexer.rules0 s.toList ∧ Lexer.tokenize CedarEntitiesLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨htok, hspec⟩ := CedarEntitiesLexer.tokenize_sound h
+ exact ⟨htok, hspec, parser_sound ts k p accepted⟩
+
+/-- **Completeness.** If `tokenize` lexes `s` to `ts` and a parse tree of the start symbol
+ spans exactly `ts`, within the fuel, `parseStr` returns the tree's value. -/
+theorem parseStr_complete (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : CedarEntitiesLexer.tokenize s = .ok ts) (tree : ParserStartTree ts)
+ (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ CedarEntitiesParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ rw [parseStr_eq s k ts h]
+ exact parser_complete tree k fuel
+
+/-- **Completeness from a tokenization (value level).** A maximal-munch `Lexer.Lexing` of `s`
+ gives the tokens `ts` of `tokenize s`, whose values are the tokens of its steps, and
+ `parseStr` accepts every parse tree over `ts` within the fuel, with the tree's value. -/
+theorem parseStr_complete_lexing (s : String) (k : Nat) (steps : List (Nat × Nat))
+ (hsteps : Lexer.Lexing CedarEntitiesLexer.rules0 s.toList steps) :
+ ∃ ts, CedarEntitiesLexer.tokenize s = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CedarEntitiesLexer.lexer CedarEntitiesLexer.lexer.start s.toList steps ∧
+ ∀ tree : ParserStartTree ts, Grammar.ptSize tree ≤ 2 ^ k →
+ CedarEntitiesParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ obtain ⟨ts, ht, hv⟩ := CedarEntitiesLexer.tokenize_complete hsteps
+ exact ⟨ts, ht, hv, fun tree fuel => parseStr_complete s k ts ht tree fuel⟩
+
+/-- **Unambiguity (value level).** Two derivations of `s`, each the tokens `tokenize` returns
+ for `s` and a parse tree over them, have the same tokens and the same value. -/
+theorem parseStr_unambiguous (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarEntitiesLexer.tokenize s = .ok ts₁) (h₂ : CedarEntitiesLexer.tokenize s = .ok ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ rw [h₁] at h₂
+ cases h₂
+ exact ⟨rfl, (parser_unambiguous tree₁ tree₂).2⟩
+
+/-- **Completeness over positioned tokens.** If `ts` is the positioned tokenization of `s`
+ (`CedarEntitiesLexer.Lexes`) and a parse tree of the start symbol spans exactly `ts`, within the fuel,
+ `parseStr` returns the tree's value. -/
+theorem parseStr_complete_lexes (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : CedarEntitiesLexer.Lexes s ts) (tree : ParserStartTree ts) (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ CedarEntitiesParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) :=
+ parseStr_complete s k ts ((CedarEntitiesLexer.tokenize_iff_lexes s ts).mpr h) tree fuel
+
+/-- **Unambiguity over positioned tokens.** Two derivations of `s`, each a positioned
+ tokenization and a parse tree over it, have the same tokens, and their trees have the
+ same span and value. -/
+theorem parseStr_unambiguous_lexes (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarEntitiesLexer.Lexes s ts₁) (h₂ : CedarEntitiesLexer.Lexes s ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSpan ⟨0⟩ tree₁ = SpanGrammar.ptSpan ⟨0⟩ tree₂ ∧
+ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ have he := CedarEntitiesLexer.lexes_unique h₁ h₂
+ subst he
+ exact ⟨rfl, parser_unambiguous tree₁ tree₂⟩
+
+/-- **Node spans as text of `s`.** In a parse tree over the positioned tokenization `ts` of
+ `s` (`CedarEntitiesLexer.Lexes`), every leaf's span is `[a, b)` for positions `a ≤ b` of `s`, and a rule's
+ action emits the leaf's token from the lexeme `s.extract a b` (or the leaf is the
+ end-of-input token at the end of `s`). Every inner node's span is `[a, b)` for positions
+ `a ≤ b` of `s`; `b` is the end of the lexeme of the node's last token, and `a` is the start
+ of the lexeme of its first token or, when its word is empty or its leftmost children
+ derive the empty word, the end of the token before it (`Lexer.AllNodeText`). -/
+theorem parseStr_node_spans (s : String) (ts : List (Runtime.Positioned Tok)) (h : CedarEntitiesLexer.Lexes s ts)
+ (tree : ParserStartTree ts) :
+ Lexer.AllNodeText (Lexer.modeAct CedarEntitiesLexer.lexer CedarEntitiesLexer.lexer.start) CedarEntitiesLexer.lexer.eofToken s ⟨0⟩ tree :=
+ Lexer.PosLexing.allNodeText h tree
+
+/-- **End to end over positioned tokens.** If `parseStr` accepts `s` with value `p`, then
+ `s` has a positioned tokenization `ts` (`CedarEntitiesLexer.Lexes`), and `ts` starts with the word of a
+ parse tree whose value is `p`. -/
+theorem parseStr_sound_lexes (s : String) (k : Nat) (p : Entities)
+ (accepted : CedarEntitiesParser.parseStr s k = some p) :
+ ∃ ts, CedarEntitiesLexer.Lexes s ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ exact ⟨ts, (CedarEntitiesLexer.tokenize_iff_lexes s ts).mp ht, hp⟩
+
+/-- The end marker `$` is the last symbol of every production of the start symbol, and no
+ other position of a right-hand side holds `$` or the start symbol. -/
+theorem endMarker_last : ∀ p : Production,
+ (prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ (prodRhsRev' p).head? = some (Symbol.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) ∧
+ ∀ x ∈ (prodRhsRev' p).tail, x ≠ Symbol.T (⟨22, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) ∧
+ (prodLhs' p ≠ startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ ∀ x ∈ prodRhsRev' p, x ≠ Symbol.T (⟨22, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) := by
+ native_decide
+
+/-- **The tree covers the tokens.** If `ts` is the positioned tokenization of `s`
+ (`CedarEntitiesLexer.Lexes`), the word of a start tree that begins the stream of `ts` is `ts`: the lexer
+ emits `EOF` only as its last token (`CedarEntitiesLexer.lexes_eof_last`), and a start tree's word ends
+ with its only `$` token (`endMarker_last`). -/
+theorem word_eq_of_lexes (s : String) (ts : List (Runtime.Positioned Tok)) (h : CedarEntitiesLexer.Lexes s ts)
+ {word : List grammarInst.Token} (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token)
+ (hs : toStream ts = Runtime.NatStream.appList word rest) : word = ts := by
+ obtain ⟨ts0, rfl, hno⟩ := CedarEntitiesLexer.lexes_eof_last h
+ exact Runtime.start_word_eq (G := grammarInst) (A := automatonInst) _ _ endMarker_last _ ts0 _
+ rfl (fun t ht he => hno t ht (tokenTerm_eq_end t.val he)) tree rest hs
+
+/-- **End to end, over the whole input.** If `parseStr` accepts `s` with value `p`, then
+ `tokenize` lexes `s` to `ts`, `ts` is the positioned tokenization of `s` (`CedarEntitiesLexer.Lexes`),
+ and a parse tree over exactly `ts` has the value `p`. -/
+theorem parseStr_sound_exact (s : String) (k : Nat) (p : Entities)
+ (accepted : CedarEntitiesParser.parseStr s k = some p) :
+ ∃ ts, CedarEntitiesLexer.tokenize s = .ok ts ∧ CedarEntitiesLexer.Lexes s ts ∧
+ ∃ tree : ParserStartTree ts, SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, word, tree, rest, hs, hp⟩ := parseStr_sound_tokenize s k p accepted
+ have hl := (CedarEntitiesLexer.tokenize_iff_lexes s ts).mp ht
+ obtain rfl := word_eq_of_lexes s ts hl tree rest hs
+ exact ⟨word, ht, hl, tree, hp⟩
+
end CedarEntitiesVerified
diff --git a/test/cedarschema/CedarSchemaLexer.lean b/test/cedarschema/CedarSchemaLexer.lean
index 0356212..4e76cab 100644
--- a/test/cedarschema/CedarSchemaLexer.lean
+++ b/test/cedarschema/CedarSchemaLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
public import cedarschema.CedarSchemaAst
@@ -247,9 +251,93 @@ theorem CedarSchemaLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees CedarSchemaLexer.fastActs CedarSchemaLexer.cbyte.flat.base.acts :=
CedarSchemaLexer.fastActs_agree
-theorem CedarSchemaLexer.byteValidated0 :
- Lexer.byteValidate (CedarSchemaLexer.cbyte.bytes.getD 0 default)
- (CedarSchemaLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def CedarSchemaLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte CedarSchemaLexer.cbyte input
+
+theorem CedarSchemaLexer.byteUnicodeValidated : Lexer.byteValidAll CedarSchemaLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem CedarSchemaLexer.posLexerAgrees : Lexer.PosLexerAgrees CedarSchemaLexer.cbyte CedarSchemaLexer.tokenize := by
+ intro s
+ rw [CedarSchemaLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll CedarSchemaLexer.cbyte CedarSchemaLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem CedarSchemaLexer.tokenizeByte_toOption (s : String) :
+ (CedarSchemaLexer.tokenizeByte s).toOption = (CedarSchemaLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption CedarSchemaLexer.cbyte CedarSchemaLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem CedarSchemaLexer.noEofEmit :
+ ∀ m r, (CedarSchemaLexer.fastActs.get m r).emit = true → ∀ s, (CedarSchemaLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL CedarSchemaLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (fun _ _ h => by first | (dsimp only at h; unfold keywordOrIdentifier at h; (repeat' split at h) <;> contradiction) | (dsimp only at h; set_option linter.unusedSimpArgs false in simp [keywordOrIdentifier, stripStringQuotes] at h; (repeat' split at h) <;> simp_all)) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) Lexer.AllL.nil))))))))))))))))))))
+ Lexer.AllL.nil)
+
+theorem CedarSchemaLexer.stay0 : ∀ r, (CedarSchemaLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL CedarSchemaLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil)))))))))))))))))))) Lexer.AllL.nil) 0
+
+theorem CedarSchemaLexer.textIndep0 : ∀ r, CedarSchemaLexer.cflat.needsText 0 r = false →
+ ∀ s, (CedarSchemaLexer.fastActs.get 0 r).toAct s = (CedarSchemaLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ CedarSchemaLexer.fastActs (CedarSchemaLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) Lexer.Forall₂.nil))))))))))))))))))))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem CedarSchemaLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CedarSchemaLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization CedarSchemaLexer.rules0 input.toList ∧
+ Lexer.tokenize CedarSchemaLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound CedarSchemaLexer.cflat CedarSchemaLexer.fastActs CedarSchemaLexer.fastActs_agree
+ CedarSchemaLexer.validated0 rfl CedarSchemaLexer.flatValidated0 (by decide) CedarSchemaLexer.stay0
+ CedarSchemaLexer.textIndep0 (by rw [← CedarSchemaLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem CedarSchemaLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing CedarSchemaLexer.rules0 input.toList steps) :
+ ∃ ts, CedarSchemaLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens CedarSchemaLexer.lexer CedarSchemaLexer.lexer.start input.toList steps := by
+ rw [CedarSchemaLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete CedarSchemaLexer.cflat CedarSchemaLexer.fastActs CedarSchemaLexer.fastActs_agree
+ CedarSchemaLexer.validated0 rfl CedarSchemaLexer.flatValidated0 (by decide) CedarSchemaLexer.stay0
+ CedarSchemaLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev CedarSchemaLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing CedarSchemaLexer.rules0 (Lexer.modeAct CedarSchemaLexer.lexer CedarSchemaLexer.lexer.start)
+ CedarSchemaLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem CedarSchemaLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ CedarSchemaLexer.tokenize s = .ok ts ↔ CedarSchemaLexer.Lexes s ts := by
+ rw [CedarSchemaLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' CedarSchemaLexer.cflat CedarSchemaLexer.fastActs
+ CedarSchemaLexer.fastActs_agree CedarSchemaLexer.validated0 rfl CedarSchemaLexer.flatValidated0 (by decide)
+ CedarSchemaLexer.stay0 CedarSchemaLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem CedarSchemaLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos CedarSchemaLexer.cbyte s = .ok ts ↔ CedarSchemaLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff CedarSchemaLexer.posLexerAgrees s ts).trans (CedarSchemaLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem CedarSchemaLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : CedarSchemaLexer.Lexes s ts₁) (h₂ : CedarSchemaLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem CedarSchemaLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : CedarSchemaLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees CedarSchemaLexer.lexer CedarSchemaLexer.fastActs CedarSchemaLexer.fastActs_agree
+ _ CedarSchemaLexer.noEofEmit _) h
diff --git a/test/cedarschema/CedarSchemaParser.lean b/test/cedarschema/CedarSchemaParser.lean
index 19cf84f..c4a959a 100644
--- a/test/cedarschema/CedarSchemaParser.lean
+++ b/test/cedarschema/CedarSchemaParser.lean
@@ -145,111 +145,114 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def sem : Nat → List VP → VP
- | 0, [(ns_span, .v1 ns)] => (ns_span, .v0 (Schema.mk ns))
- | 1, [] => (Runtime.Span.dummy, .v1 ([]))
- | 2, [(n_span, .v4 n), (rest_span, .v1 rest)] => (Runtime.Span.merge n_span rest_span, .v1 (n :: rest))
- | 3, [(__s0, _), (key_span, .v20 key)] => (Runtime.Span.merge __s0 key_span, .v2 (Annotation.mk key none))
- | 4, [(__s0, _), (key_span, .v20 key), (__s2, _), (value_span, .v21 value), (__s4, _)] => (Runtime.Span.merge __s0 __s4, .v2 (Annotation.mk key (some value)))
- | 5, [] => (Runtime.Span.dummy, .v3 ([]))
- | 6, [(a_span, .v2 a), (rest_span, .v3 rest)] => (Runtime.Span.merge a_span rest_span, .v3 (a :: rest))
- | 7, [(annotations_span, .v3 annotations), (body_span, .v5 body)] => (Runtime.Span.merge annotations_span body_span, .v4 (Annotated.mk body annotations))
- | 8, [(__s0, _), (p_span, .v25 p), (__s2, _), (decls_span, .v6 decls), (__s4, _)] => (Runtime.Span.merge __s0 __s4, .v5 (Namespace.mk (some p) decls))
- | 9, [(d_span, .v7 d)] => (d_span, .v5 (Namespace.mk none [d]))
- | 10, [] => (Runtime.Span.dummy, .v6 ([]))
- | 11, [(d_span, .v7 d), (rest_span, .v6 rest)] => (Runtime.Span.merge d_span rest_span, .v6 (d :: rest))
- | 12, [(annotations_span, .v3 annotations), (d_span, .v8 d)] => (Runtime.Span.merge annotations_span d_span, .v7 (Annotated.mk d annotations))
- | 13, [(d_span, .v8 d)] => (d_span, .v7 (Annotated.mk d []))
- | 14, [(e_span, .v9 e)] => (e_span, .v8 (Declaration.entity e))
- | 15, [(a_span, .v13 a)] => (a_span, .v8 (Declaration.action a))
- | 16, [(t_span, .v16 t)] => (t_span, .v8 (Declaration.type t))
- | 17, [(__s0, _), (names_span, .v27 names), (members_span, .v10 members), (body_span, .v11 body), (tags_span, .v12 tags), (__s5, _)] => (Runtime.Span.merge __s0 __s5, .v9 (EntityDecl.standard (StandardEntityDecl.mk names members body tags)))
- | 18, [(__s0, _), (names_span, .v27 names), (__s2, _), (__s3, _), (choices_span, .v30 choices), (__s5, _), (__s6, _)] => (Runtime.Span.merge __s0 __s6, .v9 (EntityDecl.enum (EnumEntityDecl.mk names choices)))
- | 19, [] => (Runtime.Span.dummy, .v10 ([]))
- | 20, [(__s0, _), (ets_span, .v10 ets)] => (Runtime.Span.merge __s0 ets_span, .v10 (ets))
- | 21, [] => (Runtime.Span.dummy, .v11 ([]))
- | 22, [(__s0, _), (__s1, _), (attrs_span, .v11 attrs), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v11 (attrs))
- | 23, [] => (Runtime.Span.dummy, .unit (()))
- | 24, [(__s0, _)] => (__s0, .unit (()))
- | 25, [] => (Runtime.Span.dummy, .v12 (none))
- | 26, [(__s0, _), (t_span, .v18 t)] => (Runtime.Span.merge __s0 t_span, .v12 (some t))
- | 27, [(__s0, _), (names_span, .v28 names), (parents_span, .v14 parents), (apps_span, .v15 apps), (__s4, _), (__s5, _)] => (Runtime.Span.merge __s0 __s5, .v13 (ActionDecl.mk names parents apps))
- | 28, [] => (Runtime.Span.dummy, .v14 (none))
- | 29, [(__s0, _), (qns_span, .v29 qns)] => (Runtime.Span.merge __s0 qns_span, .v14 (some qns))
- | 30, [] => (Runtime.Span.dummy, .v15 (none))
- | 31, [(__s0, _), (__s1, _), (ds_span, .v17 ds), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v15 (some ds))
- | 32, [] => (Runtime.Span.dummy, .unit (()))
- | 33, [(__s0, _), (__s1, _), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .unit (()))
- | 34, [(__s0, _), (i_span, .v20 i), (__s2, _), (t_span, .v18 t), (__s4, _)] => (Runtime.Span.merge __s0 __s4, .v16 (TypeDecl.mk i t))
- | 35, [(pr_span, .v31 pr), (__s1, _), (ets_span, .v10 ets), (rest_span, .v17 rest)] => (Runtime.Span.merge pr_span rest_span, .v17 (AppDecl.pr pr (someIfNonEmpty ets) :: rest))
- | 36, [(__s0, _), (__s1, _), (p_span, .v25 p), (rest_span, .v17 rest)] => (Runtime.Span.merge __s0 rest_span, .v17 (AppDecl.contextPath p :: rest))
- | 37, [(__s0, _), (__s1, _), (__s2, _), (attrs_span, .v11 attrs), (__s4, _), (rest_span, .v17 rest)] => (Runtime.Span.merge __s0 rest_span, .v17 (AppDecl.contextRecord attrs :: rest))
- | 38, [] => (Runtime.Span.dummy, .v17 ([]))
- | 39, [(__s0, _)] => (__s0, .v17 ([]))
- | 40, [(__s0, _), (ds_span, .v17 ds)] => (Runtime.Span.merge __s0 ds_span, .v17 (ds))
- | 41, [(p_span, .v25 p)] => (p_span, .v18 (SType.ident p))
- | 42, [(__s0, _), (__s1, _), (t_span, .v18 t), (__s3, _)] => (Runtime.Span.merge __s0 __s3, .v18 (SType.set t))
- | 43, [(__s0, _), (attrs_span, .v11 attrs), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v18 (SType.record attrs))
- | 44, [] => (Runtime.Span.dummy, .v11 ([]))
- | 45, [(ds_span, .v11 ds)] => (ds_span, .v11 (ds))
- | 46, [(annotations_span, .v3 annotations), (name_span, .v21 name), (req_span, .v19 req), (__s3, _), (ty_span, .v18 ty), (rest_span, .v11 rest)] => (Runtime.Span.merge annotations_span rest_span, .v11 (Annotated.mk (AttrDecl.mk name req ty) annotations :: rest))
- | 47, [] => (Runtime.Span.dummy, .v11 ([]))
- | 48, [(__s0, _)] => (__s0, .v11 ([]))
- | 49, [(__s0, _), (ds_span, .v11 ds)] => (Runtime.Span.merge __s0 ds_span, .v11 (ds))
- | 50, [] => (Runtime.Span.dummy, .v19 (true))
- | 51, [(__s0, _)] => (__s0, .v19 (false))
- | 52, [(value_span, .v20 value)] => (value_span, .v20 (value))
- | 53, [(__s0, _)] => (__s0, .v20 (.namespaceKw))
- | 54, [(__s0, _)] => (__s0, .v20 (.entityKw))
- | 55, [(__s0, _)] => (__s0, .v20 (.setKw))
- | 56, [(__s0, _)] => (__s0, .v20 (.appliesToKw))
- | 57, [(__s0, _)] => (__s0, .v20 (.principalKw))
- | 58, [(__s0, _)] => (__s0, .v20 (.actionKw))
- | 59, [(__s0, _)] => (__s0, .v20 (.resourceKw))
- | 60, [(__s0, _)] => (__s0, .v20 (.contextKw))
- | 61, [(__s0, _)] => (__s0, .v20 (.attributesKw))
- | 62, [(__s0, _)] => (__s0, .v20 (.tagsKw))
- | 63, [(__s0, _)] => (__s0, .v20 (.boolKw))
- | 64, [(__s0, _)] => (__s0, .v20 (.longKw))
- | 65, [(__s0, _)] => (__s0, .v20 (.stringKw))
- | 66, [(__s0, _)] => (__s0, .v20 (.typeKw))
- | 67, [(__s0, _)] => (__s0, .v20 (.inKw))
- | 68, [(__s0, _)] => (__s0, .v20 (.enumKw))
- | 69, [(value_span, .v21 value)] => (value_span, .v20 (.ident value))
- | 70, [(value_span, .v21 value)] => (value_span, .v21 (value))
- | 71, [(value_span, .v21 value)] => (value_span, .v22 (Eid.mk value))
- | 72, [(id_span, .v20 id)] => (id_span, .v21 (identToString id))
- | 73, [(value_span, .v21 value)] => (value_span, .v21 (value))
- | 74, [(value_span, .v21 value)] => (value_span, .v23 (QualName.unqualified value))
- | 75, [(first_span, .v20 first), (rest_span, .v24 rest)] => (Runtime.Span.merge first_span rest_span, .v23 (rest [first]))
- | 76, [] => (Runtime.Span.dummy, .v24 (fun path => QualName.unqualified (identToString (pathBasename path))))
- | 77, [(__s0, _), (value_span, .v21 value)] => (Runtime.Span.merge __s0 value_span, .v24 (fun path => QualName.qualified (pathFromComponents path) value))
- | 78, [(__s0, _), (next_span, .v20 next), (rest_span, .v24 rest)] => (Runtime.Span.merge __s0 rest_span, .v24 (fun path => rest (path ++ [next])))
- | 79, [(first_span, .v20 first), (rest_span, .v26 rest)] => (Runtime.Span.merge first_span rest_span, .v25 (rest [first]))
- | 80, [] => (Runtime.Span.dummy, .v26 (fun components => pathFromComponents components))
- | 81, [(__s0, _), (next_span, .v20 next), (rest_span, .v26 rest)] => (Runtime.Span.merge __s0 rest_span, .v26 (fun components => rest (components ++ [next])))
- | 82, [(p_span, .v25 p)] => (p_span, .v25 (p))
- | 83, [(i_span, .v20 i)] => (i_span, .v27 ([i]))
- | 84, [(i_span, .v20 i), (__s1, _), (rest_span, .v27 rest)] => (Runtime.Span.merge i_span rest_span, .v27 (i :: rest))
- | 85, [(n_span, .v21 n)] => (n_span, .v28 ([n]))
- | 86, [(n_span, .v21 n), (__s1, _), (rest_span, .v28 rest)] => (Runtime.Span.merge n_span rest_span, .v28 (n :: rest))
- | 87, [(q_span, .v23 q)] => (q_span, .v29 ([q]))
- | 88, [(q_span, .v23 q), (__s1, _), (rest_span, .v29 rest)] => (Runtime.Span.merge q_span rest_span, .v29 (q :: rest))
- | 89, [(e_span, .v22 e)] => (e_span, .v30 ([e]))
- | 90, [(e_span, .v22 e), (__s1, _), (rest_span, .v30 rest)] => (Runtime.Span.merge e_span rest_span, .v30 (e :: rest))
- | 91, [(__s0, _)] => (__s0, .v31 (.principal))
- | 92, [(__s0, _)] => (__s0, .v31 (.resource))
- | 93, [(et_span, .v25 et)] => (et_span, .v10 ([et]))
- | 94, [(__s0, _), (ets_span, .v10 ets), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v10 (ets))
- | 95, [] => (Runtime.Span.dummy, .v10 ([]))
- | 96, [(p_span, .v25 p), (rest_span, .v10 rest)] => (Runtime.Span.merge p_span rest_span, .v10 (p :: rest))
- | 97, [] => (Runtime.Span.dummy, .v10 ([]))
- | 98, [(__s0, _)] => (__s0, .v10 ([]))
- | 99, [(__s0, _), (p_span, .v25 p), (rest_span, .v10 rest)] => (Runtime.Span.merge __s0 rest_span, .v10 (p :: rest))
- | 100, [(qn_span, .v23 qn)] => (qn_span, .v29 ([qn]))
- | 101, [(__s0, _), (ns_span, .v29 ns), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v29 (ns))
- | 102, [x, _] => x
- | _, _ => (Runtime.Span.dummy, .unit ())
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v1 ns] => .v0 (Schema.mk ns)
+ | 1, _, [] => .v1 ([])
+ | 2, _, [.v4 n, .v1 rest] => .v1 (n :: rest)
+ | 3, _, [_, .v20 key] => .v2 (Annotation.mk key none)
+ | 4, _, [_, .v20 key, _, .v21 value, _] => .v2 (Annotation.mk key (some value))
+ | 5, _, [] => .v3 ([])
+ | 6, _, [.v2 a, .v3 rest] => .v3 (a :: rest)
+ | 7, _, [.v3 annotations, .v5 body] => .v4 (Annotated.mk body annotations)
+ | 8, _, [_, .v25 p, _, .v6 decls, _] => .v5 (Namespace.mk (some p) decls)
+ | 9, _, [.v7 d] => .v5 (Namespace.mk none [d])
+ | 10, _, [] => .v6 ([])
+ | 11, _, [.v7 d, .v6 rest] => .v6 (d :: rest)
+ | 12, _, [.v3 annotations, .v8 d] => .v7 (Annotated.mk d annotations)
+ | 13, _, [.v8 d] => .v7 (Annotated.mk d [])
+ | 14, _, [.v9 e] => .v8 (Declaration.entity e)
+ | 15, _, [.v13 a] => .v8 (Declaration.action a)
+ | 16, _, [.v16 t] => .v8 (Declaration.type t)
+ | 17, _, [_, .v27 names, .v10 members, .v11 body, .v12 tags, _] => .v9 (EntityDecl.standard (StandardEntityDecl.mk names members body tags))
+ | 18, _, [_, .v27 names, _, _, .v30 choices, _, _] => .v9 (EntityDecl.enum (EnumEntityDecl.mk names choices))
+ | 19, _, [] => .v10 ([])
+ | 20, _, [_, .v10 ets] => .v10 (ets)
+ | 21, _, [] => .v11 ([])
+ | 22, _, [_, _, .v11 attrs, _] => .v11 (attrs)
+ | 23, _, [] => .unit (())
+ | 24, _, [_] => .unit (())
+ | 25, _, [] => .v12 (none)
+ | 26, _, [_, .v18 t] => .v12 (some t)
+ | 27, _, [_, .v28 names, .v14 parents, .v15 apps, _, _] => .v13 (ActionDecl.mk names parents apps)
+ | 28, _, [] => .v14 (none)
+ | 29, _, [_, .v29 qns] => .v14 (some qns)
+ | 30, _, [] => .v15 (none)
+ | 31, _, [_, _, .v17 ds, _] => .v15 (some ds)
+ | 32, _, [] => .unit (())
+ | 33, _, [_, _, _] => .unit (())
+ | 34, _, [_, .v20 i, _, .v18 t, _] => .v16 (TypeDecl.mk i t)
+ | 35, _, [.v31 pr, _, .v10 ets, .v17 rest] => .v17 (AppDecl.pr pr (someIfNonEmpty ets) :: rest)
+ | 36, _, [_, _, .v25 p, .v17 rest] => .v17 (AppDecl.contextPath p :: rest)
+ | 37, _, [_, _, _, .v11 attrs, _, .v17 rest] => .v17 (AppDecl.contextRecord attrs :: rest)
+ | 38, _, [] => .v17 ([])
+ | 39, _, [_] => .v17 ([])
+ | 40, _, [_, .v17 ds] => .v17 (ds)
+ | 41, _, [.v25 p] => .v18 (SType.ident p)
+ | 42, _, [_, _, .v18 t, _] => .v18 (SType.set t)
+ | 43, _, [_, .v11 attrs, _] => .v18 (SType.record attrs)
+ | 44, _, [] => .v11 ([])
+ | 45, _, [.v11 ds] => .v11 (ds)
+ | 46, _, [.v3 annotations, .v21 name, .v19 req, _, .v18 ty, .v11 rest] => .v11 (Annotated.mk (AttrDecl.mk name req ty) annotations :: rest)
+ | 47, _, [] => .v11 ([])
+ | 48, _, [_] => .v11 ([])
+ | 49, _, [_, .v11 ds] => .v11 (ds)
+ | 50, _, [] => .v19 (true)
+ | 51, _, [_] => .v19 (false)
+ | 52, _, [.v20 value] => .v20 (value)
+ | 53, _, [_] => .v20 (.namespaceKw)
+ | 54, _, [_] => .v20 (.entityKw)
+ | 55, _, [_] => .v20 (.setKw)
+ | 56, _, [_] => .v20 (.appliesToKw)
+ | 57, _, [_] => .v20 (.principalKw)
+ | 58, _, [_] => .v20 (.actionKw)
+ | 59, _, [_] => .v20 (.resourceKw)
+ | 60, _, [_] => .v20 (.contextKw)
+ | 61, _, [_] => .v20 (.attributesKw)
+ | 62, _, [_] => .v20 (.tagsKw)
+ | 63, _, [_] => .v20 (.boolKw)
+ | 64, _, [_] => .v20 (.longKw)
+ | 65, _, [_] => .v20 (.stringKw)
+ | 66, _, [_] => .v20 (.typeKw)
+ | 67, _, [_] => .v20 (.inKw)
+ | 68, _, [_] => .v20 (.enumKw)
+ | 69, _, [.v21 value] => .v20 (.ident value)
+ | 70, _, [.v21 value] => .v21 (value)
+ | 71, _, [.v21 value] => .v22 (Eid.mk value)
+ | 72, _, [.v20 id] => .v21 (identToString id)
+ | 73, _, [.v21 value] => .v21 (value)
+ | 74, _, [.v21 value] => .v23 (QualName.unqualified value)
+ | 75, _, [.v20 first, .v24 rest] => .v23 (rest [first])
+ | 76, _, [] => .v24 (fun path => QualName.unqualified (identToString (pathBasename path)))
+ | 77, _, [_, .v21 value] => .v24 (fun path => QualName.qualified (pathFromComponents path) value)
+ | 78, _, [_, .v20 next, .v24 rest] => .v24 (fun path => rest (path ++ [next]))
+ | 79, _, [.v20 first, .v26 rest] => .v25 (rest [first])
+ | 80, _, [] => .v26 (fun components => pathFromComponents components)
+ | 81, _, [_, .v20 next, .v26 rest] => .v26 (fun components => rest (components ++ [next]))
+ | 82, _, [.v25 p] => .v25 (p)
+ | 83, _, [.v20 i] => .v27 ([i])
+ | 84, _, [.v20 i, _, .v27 rest] => .v27 (i :: rest)
+ | 85, _, [.v21 n] => .v28 ([n])
+ | 86, _, [.v21 n, _, .v28 rest] => .v28 (n :: rest)
+ | 87, _, [.v23 q] => .v29 ([q])
+ | 88, _, [.v23 q, _, .v29 rest] => .v29 (q :: rest)
+ | 89, _, [.v22 e] => .v30 ([e])
+ | 90, _, [.v22 e, _, .v30 rest] => .v30 (e :: rest)
+ | 91, _, [_] => .v31 (.principal)
+ | 92, _, [_] => .v31 (.resource)
+ | 93, _, [.v25 et] => .v10 ([et])
+ | 94, _, [_, .v10 ets, _] => .v10 (ets)
+ | 95, _, [] => .v10 ([])
+ | 96, _, [.v25 p, .v10 rest] => .v10 (p :: rest)
+ | 97, _, [] => .v10 ([])
+ | 98, _, [_] => .v10 ([])
+ | 99, _, [_, .v25 p, .v10 rest] => .v10 (p :: rest)
+ | 100, _, [.v23 qn] => .v29 ([qn])
+ | 101, _, [_, .v29 ns, _] => .v29 (ns)
+ | 102, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -412,6 +415,90 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c31 st _ _ _ _ => st
| .c32 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+ | .c7 _ _ e _ _ => e
+ | .c8 _ _ e _ _ => e
+ | .c9 _ _ e _ _ => e
+ | .c10 _ _ e _ _ => e
+ | .c11 _ _ e _ _ => e
+ | .c12 _ _ e _ _ => e
+ | .c13 _ _ e _ _ => e
+ | .c14 _ _ e _ _ => e
+ | .c15 _ _ e _ _ => e
+ | .c16 _ _ e _ _ => e
+ | .c17 _ _ e _ _ => e
+ | .c18 _ _ e _ _ => e
+ | .c19 _ _ e _ _ => e
+ | .c20 _ _ e _ _ => e
+ | .c21 _ _ e _ _ => e
+ | .c22 _ _ e _ _ => e
+ | .c23 _ _ e _ _ => e
+ | .c24 _ _ e _ _ => e
+ | .c25 _ _ e _ _ => e
+ | .c26 _ _ e _ _ => e
+ | .c27 _ _ e _ _ => e
+ | .c28 _ _ e _ _ => e
+ | .c29 _ _ e _ _ => e
+ | .c30 _ _ e _ _ => e
+ | .c31 _ _ e _ _ => e
+ | .c32 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+ | .c7 st _ e _ _ => k st e
+ | .c8 st _ e _ _ => k st e
+ | .c9 st _ e _ _ => k st e
+ | .c10 st _ e _ _ => k st e
+ | .c11 st _ e _ _ => k st e
+ | .c12 st _ e _ _ => k st e
+ | .c13 st _ e _ _ => k st e
+ | .c14 st _ e _ _ => k st e
+ | .c15 st _ e _ _ => k st e
+ | .c16 st _ e _ _ => k st e
+ | .c17 st _ e _ _ => k st e
+ | .c18 st _ e _ _ => k st e
+ | .c19 st _ e _ _ => k st e
+ | .c20 st _ e _ _ => k st e
+ | .c21 st _ e _ _ => k st e
+ | .c22 st _ e _ _ => k st e
+ | .c23 st _ e _ _ => k st e
+ | .c24 st _ e _ _ => k st e
+ | .c25 st _ e _ _ => k st e
+ | .c26 st _ e _ _ => k st e
+ | .c27 st _ e _ _ => k st e
+ | .c28 st _ e _ _ => k st e
+ | .c29 st _ e _ _ => k st e
+ | .c30 st _ e _ _ => k st e
+ | .c31 st _ e _ _ => k st e
+ | .c32 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -507,6 +594,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.reduce 5, .reduce 5, .error, .reduce 5, .error, .error, .error, .reduce 5, .error, .error, .error, .error,
@@ -1444,7 +1532,7 @@ def fuse0 : Stk → Stk :=
| _ => .fail stk
def fuse1 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 1 (Stk.top 0 __tail) (fun __st => .c1 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 1 __top (fun __st => .c1 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse2 : Stk → Stk :=
fun stk => match stk with
@@ -1462,7 +1550,7 @@ def fuse4 : Stk → Stk :=
| _ => .fail stk
def fuse5 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 3 (Stk.top 0 __tail) (fun __st => .c3 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 3 __top (fun __st => .c3 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse6 : Stk → Stk :=
fun stk => match stk with
@@ -1485,7 +1573,7 @@ def fuse9 : Stk → Stk :=
| _ => .fail stk
def fuse10 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 6 (Stk.top 0 __tail) (fun __st => .c6 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 6 __top (fun __st => .c6 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse11 : Stk → Stk :=
fun stk => match stk with
@@ -1528,7 +1616,7 @@ def fuse18 : Stk → Stk :=
| _ => .fail stk
def fuse19 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 11 (Stk.top 0 __tail) (fun __st => .c10 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 11 __top (fun __st => .c10 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse20 : Stk → Stk :=
fun stk => match stk with
@@ -1536,7 +1624,7 @@ def fuse20 : Stk → Stk :=
| _ => .fail stk
def fuse21 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 12 (Stk.top 0 __tail) (fun __st => .c11 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 12 __top (fun __st => .c11 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse22 : Stk → Stk :=
fun stk => match stk with
@@ -1544,7 +1632,7 @@ def fuse22 : Stk → Stk :=
| _ => .fail stk
def fuse23 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 13 (Stk.top 0 __tail) (fun __st => .cUnit __st ⟨0⟩ ⟨0⟩ __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 13 __top (fun __st => .cUnit __st __e __e __tail) (fun _ => .fail __tail))
def fuse24 : Stk → Stk :=
fun stk => match stk with
@@ -1552,7 +1640,7 @@ def fuse24 : Stk → Stk :=
| _ => .fail stk
def fuse25 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 14 (Stk.top 0 __tail) (fun __st => .c12 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 14 __top (fun __st => .c12 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse26 : Stk → Stk :=
fun stk => match stk with
@@ -1565,7 +1653,7 @@ def fuse27 : Stk → Stk :=
| _ => .fail stk
def fuse28 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 16 (Stk.top 0 __tail) (fun __st => .c14 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 16 __top (fun __st => .c14 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse29 : Stk → Stk :=
fun stk => match stk with
@@ -1573,7 +1661,7 @@ def fuse29 : Stk → Stk :=
| _ => .fail stk
def fuse30 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 17 (Stk.top 0 __tail) (fun __st => .c15 __st ⟨0⟩ ⟨0⟩ (none) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 17 __top (fun __st => .c15 __st __e __e (none) __tail) (fun _ => .fail __tail))
def fuse31 : Stk → Stk :=
fun stk => match stk with
@@ -1581,7 +1669,7 @@ def fuse31 : Stk → Stk :=
| _ => .fail stk
def fuse32 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 18 (Stk.top 0 __tail) (fun __st => .cUnit __st ⟨0⟩ ⟨0⟩ __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 18 __top (fun __st => .cUnit __st __e __e __tail) (fun _ => .fail __tail))
def fuse33 : Stk → Stk :=
fun stk => match stk with
@@ -1609,7 +1697,7 @@ def fuse37 : Stk → Stk :=
| _ => .fail stk
def fuse38 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 21 (Stk.top 0 __tail) (fun __st => .c17 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 21 __top (fun __st => .c17 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse39 : Stk → Stk :=
fun stk => match stk with
@@ -1637,7 +1725,7 @@ def fuse43 : Stk → Stk :=
| _ => .fail stk
def fuse44 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 23 (Stk.top 0 __tail) (fun __st => .c11 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 23 __top (fun __st => .c11 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse45 : Stk → Stk :=
fun stk => match stk with
@@ -1650,7 +1738,7 @@ def fuse46 : Stk → Stk :=
| _ => .fail stk
def fuse47 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 25 (Stk.top 0 __tail) (fun __st => .c11 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 25 __top (fun __st => .c11 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse48 : Stk → Stk :=
fun stk => match stk with
@@ -1663,7 +1751,7 @@ def fuse49 : Stk → Stk :=
| _ => .fail stk
def fuse50 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 26 (Stk.top 0 __tail) (fun __st => .c19 __st ⟨0⟩ ⟨0⟩ (true) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 26 __top (fun __st => .c19 __st __e __e (true) __tail) (fun _ => .fail __tail))
def fuse51 : Stk → Stk :=
fun stk => match stk with
@@ -1791,7 +1879,7 @@ def fuse75 : Stk → Stk :=
| _ => .fail stk
def fuse76 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 33 (Stk.top 0 __tail) (fun __st => .c24 __st ⟨0⟩ ⟨0⟩ (fun path => QualName.unqualified (identToString (pathBasename path))) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 33 __top (fun __st => .c24 __st __e __e (fun path => QualName.unqualified (identToString (pathBasename path))) __tail) (fun _ => .fail __tail))
def fuse77 : Stk → Stk :=
fun stk => match stk with
@@ -1809,7 +1897,7 @@ def fuse79 : Stk → Stk :=
| _ => .fail stk
def fuse80 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 35 (Stk.top 0 __tail) (fun __st => .c26 __st ⟨0⟩ ⟨0⟩ (fun components => pathFromComponents components) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 35 __top (fun __st => .c26 __st __e __e (fun components => pathFromComponents components) __tail) (fun _ => .fail __tail))
def fuse81 : Stk → Stk :=
fun stk => match stk with
@@ -1882,7 +1970,7 @@ def fuse94 : Stk → Stk :=
| _ => .fail stk
def fuse95 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 43 (Stk.top 0 __tail) (fun __st => .c10 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 43 __top (fun __st => .c10 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse96 : Stk → Stk :=
fun stk => match stk with
@@ -1890,7 +1978,7 @@ def fuse96 : Stk → Stk :=
| _ => .fail stk
def fuse97 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 47 44 (Stk.top 0 __tail) (fun __st => .c10 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 47 44 __top (fun __st => .c10 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse98 : Stk → Stk :=
fun stk => match stk with
@@ -1940,6 +2028,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -1952,9 +2041,9 @@ theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
theorem fuseOK1 : Runtime.Exec.FuseOKAt stackOps flat 1 fuse1 := by
intro stk
- unfold fuse1
+ simp only [fuse1, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 1
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 1
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK2 : Runtime.Exec.FuseOKAt stackOps flat 2 fuse2 := by
@@ -1986,9 +2075,9 @@ theorem fuseOK4 : Runtime.Exec.FuseOKAt stackOps flat 4 fuse4 := by
theorem fuseOK5 : Runtime.Exec.FuseOKAt stackOps flat 5 fuse5 := by
intro stk
- unfold fuse5
+ simp only [fuse5, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 5
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 5
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK6 : Runtime.Exec.FuseOKAt stackOps flat 6 fuse6 := by
@@ -2029,9 +2118,9 @@ theorem fuseOK9 : Runtime.Exec.FuseOKAt stackOps flat 9 fuse9 := by
theorem fuseOK10 : Runtime.Exec.FuseOKAt stackOps flat 10 fuse10 := by
intro stk
- unfold fuse10
+ simp only [fuse10, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 10
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 10
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK11 : Runtime.Exec.FuseOKAt stackOps flat 11 fuse11 := by
@@ -2108,9 +2197,9 @@ theorem fuseOK18 : Runtime.Exec.FuseOKAt stackOps flat 18 fuse18 := by
theorem fuseOK19 : Runtime.Exec.FuseOKAt stackOps flat 19 fuse19 := by
intro stk
- unfold fuse19
+ simp only [fuse19, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 19
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 19
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK20 : Runtime.Exec.FuseOKAt stackOps flat 20 fuse20 := by
@@ -2124,9 +2213,9 @@ theorem fuseOK20 : Runtime.Exec.FuseOKAt stackOps flat 20 fuse20 := by
theorem fuseOK21 : Runtime.Exec.FuseOKAt stackOps flat 21 fuse21 := by
intro stk
- unfold fuse21
+ simp only [fuse21, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 21
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 21
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK22 : Runtime.Exec.FuseOKAt stackOps flat 22 fuse22 := by
@@ -2140,9 +2229,9 @@ theorem fuseOK22 : Runtime.Exec.FuseOKAt stackOps flat 22 fuse22 := by
theorem fuseOK23 : Runtime.Exec.FuseOKAt stackOps flat 23 fuse23 := by
intro stk
- unfold fuse23
+ simp only [fuse23, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 23
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 23
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK24 : Runtime.Exec.FuseOKAt stackOps flat 24 fuse24 := by
@@ -2156,9 +2245,9 @@ theorem fuseOK24 : Runtime.Exec.FuseOKAt stackOps flat 24 fuse24 := by
theorem fuseOK25 : Runtime.Exec.FuseOKAt stackOps flat 25 fuse25 := by
intro stk
- unfold fuse25
+ simp only [fuse25, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 25
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 25
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK26 : Runtime.Exec.FuseOKAt stackOps flat 26 fuse26 := by
@@ -2181,9 +2270,9 @@ theorem fuseOK27 : Runtime.Exec.FuseOKAt stackOps flat 27 fuse27 := by
theorem fuseOK28 : Runtime.Exec.FuseOKAt stackOps flat 28 fuse28 := by
intro stk
- unfold fuse28
+ simp only [fuse28, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 28
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 28
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK29 : Runtime.Exec.FuseOKAt stackOps flat 29 fuse29 := by
@@ -2197,9 +2286,9 @@ theorem fuseOK29 : Runtime.Exec.FuseOKAt stackOps flat 29 fuse29 := by
theorem fuseOK30 : Runtime.Exec.FuseOKAt stackOps flat 30 fuse30 := by
intro stk
- unfold fuse30
+ simp only [fuse30, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 30
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 30
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK31 : Runtime.Exec.FuseOKAt stackOps flat 31 fuse31 := by
@@ -2213,9 +2302,9 @@ theorem fuseOK31 : Runtime.Exec.FuseOKAt stackOps flat 31 fuse31 := by
theorem fuseOK32 : Runtime.Exec.FuseOKAt stackOps flat 32 fuse32 := by
intro stk
- unfold fuse32
+ simp only [fuse32, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 32
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 32
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK33 : Runtime.Exec.FuseOKAt stackOps flat 33 fuse33 := by
@@ -2265,9 +2354,9 @@ theorem fuseOK37 : Runtime.Exec.FuseOKAt stackOps flat 37 fuse37 := by
theorem fuseOK38 : Runtime.Exec.FuseOKAt stackOps flat 38 fuse38 := by
intro stk
- unfold fuse38
+ simp only [fuse38, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 38
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 38
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK39 : Runtime.Exec.FuseOKAt stackOps flat 39 fuse39 := by
@@ -2317,9 +2406,9 @@ theorem fuseOK43 : Runtime.Exec.FuseOKAt stackOps flat 43 fuse43 := by
theorem fuseOK44 : Runtime.Exec.FuseOKAt stackOps flat 44 fuse44 := by
intro stk
- unfold fuse44
+ simp only [fuse44, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 44
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 44
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK45 : Runtime.Exec.FuseOKAt stackOps flat 45 fuse45 := by
@@ -2342,9 +2431,9 @@ theorem fuseOK46 : Runtime.Exec.FuseOKAt stackOps flat 46 fuse46 := by
theorem fuseOK47 : Runtime.Exec.FuseOKAt stackOps flat 47 fuse47 := by
intro stk
- unfold fuse47
+ simp only [fuse47, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 47
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 47
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK48 : Runtime.Exec.FuseOKAt stackOps flat 48 fuse48 := by
@@ -2367,9 +2456,9 @@ theorem fuseOK49 : Runtime.Exec.FuseOKAt stackOps flat 49 fuse49 := by
theorem fuseOK50 : Runtime.Exec.FuseOKAt stackOps flat 50 fuse50 := by
intro stk
- unfold fuse50
+ simp only [fuse50, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 50
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 50
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK51 : Runtime.Exec.FuseOKAt stackOps flat 51 fuse51 := by
@@ -2599,9 +2688,9 @@ theorem fuseOK75 : Runtime.Exec.FuseOKAt stackOps flat 75 fuse75 := by
theorem fuseOK76 : Runtime.Exec.FuseOKAt stackOps flat 76 fuse76 := by
intro stk
- unfold fuse76
+ simp only [fuse76, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 76
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 76
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK77 : Runtime.Exec.FuseOKAt stackOps flat 77 fuse77 := by
@@ -2633,9 +2722,9 @@ theorem fuseOK79 : Runtime.Exec.FuseOKAt stackOps flat 79 fuse79 := by
theorem fuseOK80 : Runtime.Exec.FuseOKAt stackOps flat 80 fuse80 := by
intro stk
- unfold fuse80
+ simp only [fuse80, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 80
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 80
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK81 : Runtime.Exec.FuseOKAt stackOps flat 81 fuse81 := by
@@ -2766,9 +2855,9 @@ theorem fuseOK94 : Runtime.Exec.FuseOKAt stackOps flat 94 fuse94 := by
theorem fuseOK95 : Runtime.Exec.FuseOKAt stackOps flat 95 fuse95 := by
intro stk
- unfold fuse95
+ simp only [fuse95, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 95
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 95
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK96 : Runtime.Exec.FuseOKAt stackOps flat 96 fuse96 := by
@@ -2782,9 +2871,9 @@ theorem fuseOK96 : Runtime.Exec.FuseOKAt stackOps flat 96 fuse96 := by
theorem fuseOK97 : Runtime.Exec.FuseOKAt stackOps flat 97 fuse97 := by
intro stk
- unfold fuse97
+ simp only [fuse97, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 97
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 97
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK98 : Runtime.Exec.FuseOKAt stackOps flat 98 fuse98 := by
diff --git a/test/cedarschema/CedarSchemaParserRoundtrip.lean b/test/cedarschema/CedarSchemaParserRoundtrip.lean
index 8b414d8..e913d5c 100644
--- a/test/cedarschema/CedarSchemaParserRoundtrip.lean
+++ b/test/cedarschema/CedarSchemaParserRoundtrip.lean
@@ -26,10 +26,11 @@ namespace CedarSchemaParserRoundtrip
open Lexer Runtime CedarSchemaUnparse
/-- A parse tree certifying that `tokens` parse to `value`. The start tree
- includes the explicit EOF required by the augmented grammar. -/
+ includes the explicit EOF required by the augmented grammar. Its tokens carry
+ the dummy span, as the token generator produces no positions. -/
structure Certificate (tokens : List Tok) (value : Schema) where
- tree : CedarSchemaVerified.ParserStartTree (tokens ++ [Tok.EOF])
- semantics : Runtime.Grammar.ptSem tree = value
+ tree : CedarSchemaVerified.ParserStartTree ((tokens ++ [Tok.EOF]).map Positioned.dummy)
+ semantics : Runtime.SpanGrammar.ptSem ⟨0⟩ tree = value
/-- Sufficient logarithmic fuel computed from the certified tree. -/
def Certificate.logFuel {tokens : List Tok} {value : Schema}
diff --git a/test/cedarschema/CedarSchemaVerified.lean b/test/cedarschema/CedarSchemaVerified.lean
index bc3e65a..45d2920 100644
--- a/test/cedarschema/CedarSchemaVerified.lean
+++ b/test/cedarschema/CedarSchemaVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -43,6 +45,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace CedarSchemaVerified
abbrev Terminal := Fin 36
@@ -295,92 +299,92 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 46
augmentedProduction := 102 }
-def semTbl : List (Σ T : Type, T → CedarSchemaParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v32 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Schema : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(List (Annotated Namespace) : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(Annotation : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(List Annotation : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Annotated Namespace : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Namespace : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(List (Annotated Declaration) : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Annotated Declaration : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(Annotated Declaration : Type), fun v => (Runtime.Span.dummy, .v7 v)⟩,
- ⟨(Declaration : Type), fun v => (Runtime.Span.dummy, .v8 v)⟩,
- ⟨(EntityDecl : Type), fun v => (Runtime.Span.dummy, .v9 v)⟩,
- ⟨(List Path : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(List (Annotated AttrDecl) : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Option SType : Type), fun v => (Runtime.Span.dummy, .v12 v)⟩,
- ⟨(ActionDecl : Type), fun v => (Runtime.Span.dummy, .v13 v)⟩,
- ⟨(Option (List QualName) : Type), fun v => (Runtime.Span.dummy, .v14 v)⟩,
- ⟨(Option (List AppDecl) : Type), fun v => (Runtime.Span.dummy, .v15 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(TypeDecl : Type), fun v => (Runtime.Span.dummy, .v16 v)⟩,
- ⟨(List AppDecl : Type), fun v => (Runtime.Span.dummy, .v17 v)⟩,
- ⟨(List AppDecl : Type), fun v => (Runtime.Span.dummy, .v17 v)⟩,
- ⟨(SType : Type), fun v => (Runtime.Span.dummy, .v18 v)⟩,
- ⟨(List (Annotated AttrDecl) : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(List (Annotated AttrDecl) : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(List (Annotated AttrDecl) : Type), fun v => (Runtime.Span.dummy, .v11 v)⟩,
- ⟨(Bool : Type), fun v => (Runtime.Span.dummy, .v19 v)⟩,
- ⟨(Ident : Type), fun v => (Runtime.Span.dummy, .v20 v)⟩,
- ⟨(Ident : Type), fun v => (Runtime.Span.dummy, .v20 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(Eid : Type), fun v => (Runtime.Span.dummy, .v22 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v21 v)⟩,
- ⟨(QualName : Type), fun v => (Runtime.Span.dummy, .v23 v)⟩,
- ⟨((List Ident → QualName) : Type), fun v => (Runtime.Span.dummy, .v24 v)⟩,
- ⟨(Path : Type), fun v => (Runtime.Span.dummy, .v25 v)⟩,
- ⟨((List Ident → Path) : Type), fun v => (Runtime.Span.dummy, .v26 v)⟩,
- ⟨(Path : Type), fun v => (Runtime.Span.dummy, .v25 v)⟩,
- ⟨(List Ident : Type), fun v => (Runtime.Span.dummy, .v27 v)⟩,
- ⟨(List String : Type), fun v => (Runtime.Span.dummy, .v28 v)⟩,
- ⟨(List QualName : Type), fun v => (Runtime.Span.dummy, .v29 v)⟩,
- ⟨(List Eid : Type), fun v => (Runtime.Span.dummy, .v30 v)⟩,
- ⟨(PR : Type), fun v => (Runtime.Span.dummy, .v31 v)⟩,
- ⟨(List Path : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(List Path : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(List Path : Type), fun v => (Runtime.Span.dummy, .v10 v)⟩,
- ⟨(List QualName : Type), fun v => (Runtime.Span.dummy, .v29 v)⟩,
- ⟨(Schema : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → CedarSchemaParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → CedarSchemaParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(String : Type), fun v => .v21 v⟩,
+ ⟨(Nat : Type), fun v => .v32 v⟩,
+ ⟨(String : Type), fun v => .v21 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Schema : Type), fun v => .v0 v⟩,
+ ⟨(List (Annotated Namespace) : Type), fun v => .v1 v⟩,
+ ⟨(Annotation : Type), fun v => .v2 v⟩,
+ ⟨(List Annotation : Type), fun v => .v3 v⟩,
+ ⟨(Annotated Namespace : Type), fun v => .v4 v⟩,
+ ⟨(Namespace : Type), fun v => .v5 v⟩,
+ ⟨(List (Annotated Declaration) : Type), fun v => .v6 v⟩,
+ ⟨(Annotated Declaration : Type), fun v => .v7 v⟩,
+ ⟨(Annotated Declaration : Type), fun v => .v7 v⟩,
+ ⟨(Declaration : Type), fun v => .v8 v⟩,
+ ⟨(EntityDecl : Type), fun v => .v9 v⟩,
+ ⟨(List Path : Type), fun v => .v10 v⟩,
+ ⟨(List (Annotated AttrDecl) : Type), fun v => .v11 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Option SType : Type), fun v => .v12 v⟩,
+ ⟨(ActionDecl : Type), fun v => .v13 v⟩,
+ ⟨(Option (List QualName) : Type), fun v => .v14 v⟩,
+ ⟨(Option (List AppDecl) : Type), fun v => .v15 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(TypeDecl : Type), fun v => .v16 v⟩,
+ ⟨(List AppDecl : Type), fun v => .v17 v⟩,
+ ⟨(List AppDecl : Type), fun v => .v17 v⟩,
+ ⟨(SType : Type), fun v => .v18 v⟩,
+ ⟨(List (Annotated AttrDecl) : Type), fun v => .v11 v⟩,
+ ⟨(List (Annotated AttrDecl) : Type), fun v => .v11 v⟩,
+ ⟨(List (Annotated AttrDecl) : Type), fun v => .v11 v⟩,
+ ⟨(Bool : Type), fun v => .v19 v⟩,
+ ⟨(Ident : Type), fun v => .v20 v⟩,
+ ⟨(Ident : Type), fun v => .v20 v⟩,
+ ⟨(String : Type), fun v => .v21 v⟩,
+ ⟨(Eid : Type), fun v => .v22 v⟩,
+ ⟨(String : Type), fun v => .v21 v⟩,
+ ⟨(QualName : Type), fun v => .v23 v⟩,
+ ⟨((List Ident → QualName) : Type), fun v => .v24 v⟩,
+ ⟨(Path : Type), fun v => .v25 v⟩,
+ ⟨((List Ident → Path) : Type), fun v => .v26 v⟩,
+ ⟨(Path : Type), fun v => .v25 v⟩,
+ ⟨(List Ident : Type), fun v => .v27 v⟩,
+ ⟨(List String : Type), fun v => .v28 v⟩,
+ ⟨(List QualName : Type), fun v => .v29 v⟩,
+ ⟨(List Eid : Type), fun v => .v30 v⟩,
+ ⟨(PR : Type), fun v => .v31 v⟩,
+ ⟨(List Path : Type), fun v => .v10 v⟩,
+ ⟨(List Path : Type), fun v => .v10 v⟩,
+ ⟨(List Path : Type), fun v => .v10 v⟩,
+ ⟨(List QualName : Type), fun v => .v29 v⟩,
+ ⟨(Schema : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → CedarSchemaParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -389,319 +393,319 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (ns : List (Annotated Namespace)) => (Schema.mk ns)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ns : List (Annotated Namespace)) => (Schema.mk ns)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (Annotated Namespace))
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (Annotated Namespace))
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (Annotated Namespace)) (n : Annotated Namespace) => (n :: rest)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (Annotated Namespace)) (n : Annotated Namespace) => (n :: rest)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (key : Ident) (_ : Unit) => (Annotation.mk key none)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (key : Ident) (_ : Unit) => (Annotation.mk key none)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨33, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (value : String) (_ : Unit) (key : Ident) (_ : Unit) => (Annotation.mk key (some value))
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨33, of_decide_eq_true rfl⟩, Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨32, of_decide_eq_true rfl⟩, Symbol.NT ⟨28, of_decide_eq_true rfl⟩, Symbol.T ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (value : String) (_ : Unit) (key : Ident) (_ : Unit) => (Annotation.mk key (some value))
-def semanticAction5 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Annotation)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Annotation)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Annotation) (a : Annotation) => (a :: rest)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Annotation) (a : Annotation) => (a :: rest)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (body : Namespace) (annotations : List Annotation) => (Annotated.mk body annotations)
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (body : Namespace) (annotations : List Annotation) => (Annotated.mk body annotations)
-def semanticAction8 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (decls : List (Annotated Declaration)) (_ : Unit) (p : Path) (_ : Unit) => (Namespace.mk (some p) decls)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (decls : List (Annotated Declaration)) (_ : Unit) (p : Path) (_ : Unit) => (Namespace.mk (some p) decls)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Annotated Declaration) => (Namespace.mk none [d])
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Annotated Declaration) => (Namespace.mk none [d])
-def semanticAction10 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (Annotated Declaration))
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (Annotated Declaration))
-def semanticAction11 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (Annotated Declaration)) (d : Annotated Declaration) => (d :: rest)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (Annotated Declaration)) (d : Annotated Declaration) => (d :: rest)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declaration) (annotations : List Annotation) => (Annotated.mk d annotations)
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declaration) (annotations : List Annotation) => (Annotated.mk d annotations)
-def semanticAction13 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (d : Declaration) => (Annotated.mk d [])
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (d : Declaration) => (Annotated.mk d [])
-def semanticAction14 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : EntityDecl) => (Declaration.entity e)
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : EntityDecl) => (Declaration.entity e)
-def semanticAction15 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : ActionDecl) => (Declaration.action a)
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : ActionDecl) => (Declaration.action a)
-def semanticAction16 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : TypeDecl) => (Declaration.type t)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : TypeDecl) => (Declaration.type t)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (tags : Option SType) (body : List (Annotated AttrDecl)) (members : List Path) (names : List Ident) (_ : Unit) => (EntityDecl.standard (StandardEntityDecl.mk names members body tags))
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.NT ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨12, of_decide_eq_true rfl⟩, Symbol.NT ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (tags : Option SType) (body : List (Annotated AttrDecl)) (members : List Path) (names : List Ident) (_ : Unit) => (EntityDecl.standard (StandardEntityDecl.mk names members body tags))
-def semanticAction18 : arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (choices : List Eid) (_ : Unit) (_ : Unit) (names : List Ident) (_ : Unit) => (EntityDecl.enum (EnumEntityDecl.mk names choices))
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨40, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (choices : List Eid) (_ : Unit) (_ : Unit) (names : List Ident) (_ : Unit) => (EntityDecl.enum (EnumEntityDecl.mk names choices))
-def semanticAction19 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Path)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Path)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (ets : List Path) (_ : Unit) => (ets)
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ets : List Path) (_ : Unit) => (ets)
-def semanticAction21 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (Annotated AttrDecl))
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (Annotated AttrDecl))
-def semanticAction22 : arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (attrs : List (Annotated AttrDecl)) (_ : Unit) (_ : Unit) => (attrs)
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.NT ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (attrs : List (Annotated AttrDecl)) (_ : Unit) (_ : Unit) => (attrs)
-def semanticAction23 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((()) : Unit)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((()) : Unit)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (())
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (())
-def semanticAction25 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option SType)
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option SType)
-def semanticAction26 : arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : SType) (_ : Unit) => (some t)
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : SType) (_ : Unit) => (some t)
-def semanticAction27 : arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (apps : Option (List AppDecl)) (parents : Option (List QualName)) (names : List String) (_ : Unit) => (ActionDecl.mk names parents apps)
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.NT ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (apps : Option (List AppDecl)) (parents : Option (List QualName)) (names : List String) (_ : Unit) => (ActionDecl.mk names parents apps)
-def semanticAction28 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option (List QualName))
+def semanticAction28 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option (List QualName))
-def semanticAction29 : arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (qns : List QualName) (_ : Unit) => (some qns)
+def semanticAction29 : List Runtime.Span → arrowsRight (semT' (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨45, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (qns : List QualName) (_ : Unit) => (some qns)
-def semanticAction30 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((none) : Option (List AppDecl))
+def semanticAction30 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((none) : Option (List AppDecl))
-def semanticAction31 : arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ds : List AppDecl) (_ : Unit) (_ : Unit) => (some ds)
+def semanticAction31 : List Runtime.Span → arrowsRight (semT' (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ds : List AppDecl) (_ : Unit) (_ : Unit) => (some ds)
-def semanticAction32 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((()) : Unit)
+def semanticAction32 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((()) : Unit)
-def semanticAction33 : arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (_ : Unit) (_ : Unit) => (())
+def semanticAction33 : List Runtime.Span → arrowsRight (semT' (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (_ : Unit) (_ : Unit) => (())
-def semanticAction34 : arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (t : SType) (_ : Unit) (i : Ident) (_ : Unit) => (TypeDecl.mk i t)
+def semanticAction34 : List Runtime.Span → arrowsRight (semT' (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨29, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (t : SType) (_ : Unit) (i : Ident) (_ : Unit) => (TypeDecl.mk i t)
-def semanticAction35 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨41, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List AppDecl) (ets : List Path) (_ : Unit) (pr : PR) => (AppDecl.pr pr (someIfNonEmpty ets) :: rest)
+def semanticAction35 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨42, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨41, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List AppDecl) (ets : List Path) (_ : Unit) (pr : PR) => (AppDecl.pr pr (someIfNonEmpty ets) :: rest)
-def semanticAction36 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List AppDecl) (p : Path) (_ : Unit) (_ : Unit) => (AppDecl.contextPath p :: rest)
+def semanticAction36 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List AppDecl) (p : Path) (_ : Unit) (_ : Unit) => (AppDecl.contextPath p :: rest)
-def semanticAction37 : arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List AppDecl) (_ : Unit) (attrs : List (Annotated AttrDecl)) (_ : Unit) (_ : Unit) (_ : Unit) => (AppDecl.contextRecord attrs :: rest)
+def semanticAction37 : List Runtime.Span → arrowsRight (semT' (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List AppDecl) (_ : Unit) (attrs : List (Annotated AttrDecl)) (_ : Unit) (_ : Unit) (_ : Unit) => (AppDecl.contextRecord attrs :: rest)
-def semanticAction38 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List AppDecl)
+def semanticAction38 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List AppDecl)
-def semanticAction39 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction39 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction40 : arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (ds : List AppDecl) (_ : Unit) => (ds)
+def semanticAction40 : List Runtime.Span → arrowsRight (semT' (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨20, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ds : List AppDecl) (_ : Unit) => (ds)
-def semanticAction41 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (p : Path) => (SType.ident p)
+def semanticAction41 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (p : Path) => (SType.ident p)
-def semanticAction42 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (t : SType) (_ : Unit) (_ : Unit) => (SType.set t)
+def semanticAction42 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨28, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (t : SType) (_ : Unit) (_ : Unit) => (SType.set t)
-def semanticAction43 : arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (attrs : List (Annotated AttrDecl)) (_ : Unit) => (SType.record attrs)
+def semanticAction43 : List Runtime.Span → arrowsRight (semT' (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨24, of_decide_eq_true rfl⟩, Symbol.NT ⟨23, of_decide_eq_true rfl⟩, Symbol.T ⟨23, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (attrs : List (Annotated AttrDecl)) (_ : Unit) => (SType.record attrs)
-def semanticAction44 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (Annotated AttrDecl))
+def semanticAction44 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (Annotated AttrDecl))
-def semanticAction45 : arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩].map semT') :=
- fun (ds : List (Annotated AttrDecl)) => (ds)
+def semanticAction45 : List Runtime.Span → arrowsRight (semT' (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ds : List (Annotated AttrDecl)) => (ds)
-def semanticAction46 : arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨25, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List (Annotated AttrDecl)) (ty : SType) (_ : Unit) (req : Bool) (name : String) (annotations : List Annotation) => (Annotated.mk (AttrDecl.mk name req ty) annotations :: rest)
+def semanticAction46 : List Runtime.Span → arrowsRight (semT' (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨25, of_decide_eq_true rfl⟩, Symbol.NT ⟨22, of_decide_eq_true rfl⟩, Symbol.T ⟨21, of_decide_eq_true rfl⟩, Symbol.NT ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List (Annotated AttrDecl)) (ty : SType) (_ : Unit) (req : Bool) (name : String) (annotations : List Annotation) => (Annotated.mk (AttrDecl.mk name req ty) annotations :: rest)
-def semanticAction47 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List (Annotated AttrDecl))
+def semanticAction47 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List (Annotated AttrDecl))
-def semanticAction48 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction48 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction49 : arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (ds : List (Annotated AttrDecl)) (_ : Unit) => (ds)
+def semanticAction49 : List Runtime.Span → arrowsRight (semT' (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨24, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ds : List (Annotated AttrDecl)) (_ : Unit) => (ds)
-def semanticAction50 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((true) : Bool)
+def semanticAction50 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((true) : Bool)
-def semanticAction51 : arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (false)
+def semanticAction51 : List Runtime.Span → arrowsRight (semT' (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (false)
-def semanticAction52 : arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : Ident) => (value)
+def semanticAction52 : List Runtime.Span → arrowsRight (semT' (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨28, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : Ident) => (value)
-def semanticAction53 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.namespaceKw)
+def semanticAction53 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.namespaceKw)
-def semanticAction54 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.entityKw)
+def semanticAction54 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.entityKw)
-def semanticAction55 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.setKw)
+def semanticAction55 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.setKw)
-def semanticAction56 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.appliesToKw)
+def semanticAction56 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.appliesToKw)
-def semanticAction57 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.principalKw)
+def semanticAction57 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.principalKw)
-def semanticAction58 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.actionKw)
+def semanticAction58 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.actionKw)
-def semanticAction59 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.resourceKw)
+def semanticAction59 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.resourceKw)
-def semanticAction60 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.contextKw)
+def semanticAction60 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.contextKw)
-def semanticAction61 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.attributesKw)
+def semanticAction61 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.attributesKw)
-def semanticAction62 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.tagsKw)
+def semanticAction62 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨11, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.tagsKw)
-def semanticAction63 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.boolKw)
+def semanticAction63 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.boolKw)
-def semanticAction64 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.longKw)
+def semanticAction64 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.longKw)
-def semanticAction65 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.stringKw)
+def semanticAction65 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.stringKw)
-def semanticAction66 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.typeKw)
+def semanticAction66 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.typeKw)
-def semanticAction67 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.inKw)
+def semanticAction67 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.inKw)
-def semanticAction68 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.enumKw)
+def semanticAction68 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.enumKw)
-def semanticAction69 : arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (.ident value)
+def semanticAction69 : List Runtime.Span → arrowsRight (semT' (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (.ident value)
-def semanticAction70 : arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (value)
+def semanticAction70 : List Runtime.Span → arrowsRight (semT' (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (value)
-def semanticAction71 : arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (Eid.mk value)
+def semanticAction71 : List Runtime.Span → arrowsRight (semT' (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (Eid.mk value)
-def semanticAction72 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (id : Ident) => (identToString id)
+def semanticAction72 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (id : Ident) => (identToString id)
-def semanticAction73 : arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (value)
+def semanticAction73 : List Runtime.Span → arrowsRight (semT' (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (value)
-def semanticAction74 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) => (QualName.unqualified value)
+def semanticAction74 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) => (QualName.unqualified value)
-def semanticAction75 : arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List Ident → QualName)) (first : Ident) => (rest [first])
+def semanticAction75 : List Runtime.Span → arrowsRight (semT' (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List Ident → QualName)) (first : Ident) => (rest [first])
-def semanticAction76 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((fun path => QualName.unqualified (identToString (pathBasename path))) : (List Ident → QualName))
+def semanticAction76 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((fun path => QualName.unqualified (identToString (pathBasename path))) : (List Ident → QualName))
-def semanticAction77 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (value : String) (_ : Unit) => (fun path => QualName.qualified (pathFromComponents path) value)
+def semanticAction77 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨29, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (value : String) (_ : Unit) => (fun path => QualName.qualified (pathFromComponents path) value)
-def semanticAction78 : arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List Ident → QualName)) (next : Ident) (_ : Unit) => (fun path => rest (path ++ [next]))
+def semanticAction78 : List Runtime.Span → arrowsRight (semT' (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨33, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List Ident → QualName)) (next : Ident) (_ : Unit) => (fun path => rest (path ++ [next]))
-def semanticAction79 : arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List Ident → Path)) (first : Ident) => (rest [first])
+def semanticAction79 : List Runtime.Span → arrowsRight (semT' (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List Ident → Path)) (first : Ident) => (rest [first])
-def semanticAction80 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((fun components => pathFromComponents components) : (List Ident → Path))
+def semanticAction80 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((fun components => pathFromComponents components) : (List Ident → Path))
-def semanticAction81 : arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : (List Ident → Path)) (next : Ident) (_ : Unit) => (fun components => rest (components ++ [next]))
+def semanticAction81 : List Runtime.Span → arrowsRight (semT' (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨35, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩, Symbol.T ⟨22, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : (List Ident → Path)) (next : Ident) (_ : Unit) => (fun components => rest (components ++ [next]))
-def semanticAction82 : arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (p : Path) => (p)
+def semanticAction82 : List Runtime.Span → arrowsRight (semT' (.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (p : Path) => (p)
-def semanticAction83 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (i : Ident) => ([i])
+def semanticAction83 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (i : Ident) => ([i])
-def semanticAction84 : arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Ident) (_ : Unit) (i : Ident) => (i :: rest)
+def semanticAction84 : List Runtime.Span → arrowsRight (semT' (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨37, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨27, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Ident) (_ : Unit) (i : Ident) => (i :: rest)
-def semanticAction85 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : String) => ([n])
+def semanticAction85 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : String) => ([n])
-def semanticAction86 : arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List String) (_ : Unit) (n : String) => (n :: rest)
+def semanticAction86 : List Runtime.Span → arrowsRight (semT' (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨38, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨31, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List String) (_ : Unit) (n : String) => (n :: rest)
-def semanticAction87 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (q : QualName) => ([q])
+def semanticAction87 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (q : QualName) => ([q])
-def semanticAction88 : arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List QualName) (_ : Unit) (q : QualName) => (q :: rest)
+def semanticAction88 : List Runtime.Span → arrowsRight (semT' (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List QualName) (_ : Unit) (q : QualName) => (q :: rest)
-def semanticAction89 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Eid) => ([e])
+def semanticAction89 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Eid) => ([e])
-def semanticAction90 : arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨40, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Eid) (_ : Unit) (e : Eid) => (e :: rest)
+def semanticAction90 : List Runtime.Span → arrowsRight (semT' (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨40, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩, Symbol.NT ⟨30, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Eid) (_ : Unit) (e : Eid) => (e :: rest)
-def semanticAction91 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.principal)
+def semanticAction91 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.principal)
-def semanticAction92 : arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (.resource)
+def semanticAction92 : List Runtime.Span → arrowsRight (semT' (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (.resource)
-def semanticAction93 : arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (et : Path) => ([et])
+def semanticAction93 : List Runtime.Span → arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (et : Path) => ([et])
-def semanticAction94 : arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ets : List Path) (_ : Unit) => (ets)
+def semanticAction94 : List Runtime.Span → arrowsRight (semT' (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨43, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ets : List Path) (_ : Unit) => (ets)
-def semanticAction95 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Path)
+def semanticAction95 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Path)
-def semanticAction96 : arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Path) (p : Path) => (p :: rest)
+def semanticAction96 : List Runtime.Span → arrowsRight (semT' (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Path) (p : Path) => (p :: rest)
-def semanticAction97 : arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : List Path)
+def semanticAction97 : List Runtime.Span → arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : List Path)
-def semanticAction98 : arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => ([])
+def semanticAction98 : List Runtime.Span → arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => ([])
-def semanticAction99 : arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : List Path) (p : Path) (_ : Unit) => (p :: rest)
+def semanticAction99 : List Runtime.Span → arrowsRight (semT' (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨44, of_decide_eq_true rfl⟩, Symbol.NT ⟨34, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : List Path) (p : Path) (_ : Unit) => (p :: rest)
-def semanticAction100 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
- fun (qn : QualName) => ([qn])
+def semanticAction100 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨32, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (qn : QualName) => ([qn])
-def semanticAction101 : arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (ns : List QualName) (_ : Unit) => (ns)
+def semanticAction101 : List Runtime.Span → arrowsRight (semT' (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨26, of_decide_eq_true rfl⟩, Symbol.NT ⟨39, of_decide_eq_true rfl⟩, Symbol.T ⟨25, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (ns : List QualName) (_ : Unit) => (ns)
-def semanticAction102 : arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨35, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction102 : List Runtime.Span → arrowsRight (semT' (.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨35, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), []) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩]) semanticAction2
@@ -813,7 +817,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -934,1504 +938,1679 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
/-- Terminal parse tree for `NAMESPACE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenNAMESPACE :
+noncomputable def parseTreeTokenNAMESPACE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NAMESPACE] :=
+ (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NAMESPACE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NAMESPACE))
+ (.terminal (G := grammarInst) (⟨Tok.NAMESPACE, span⟩))
/-- Terminal parse tree for `ENTITY` with its concrete grammar index. -/
-noncomputable def parseTreeTokenENTITY :
+noncomputable def parseTreeTokenENTITY
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ENTITY] :=
+ (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ENTITY, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ENTITY))
+ (.terminal (G := grammarInst) (⟨Tok.ENTITY, span⟩))
/-- Terminal parse tree for `IN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenIN :
+noncomputable def parseTreeTokenIN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IN] :=
+ (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IN))
+ (.terminal (G := grammarInst) (⟨Tok.IN, span⟩))
/-- Terminal parse tree for `TYPE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTYPE :
+noncomputable def parseTreeTokenTYPE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [Tok.TYPE] :=
+ (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.TYPE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.TYPE))
+ (.terminal (G := grammarInst) (⟨Tok.TYPE, span⟩))
/-- Terminal parse tree for `SET` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSET :
+noncomputable def parseTreeTokenSET
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SET] :=
+ (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SET, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SET))
+ (.terminal (G := grammarInst) (⟨Tok.SET, span⟩))
/-- Terminal parse tree for `APPLIESTO` with its concrete grammar index. -/
-noncomputable def parseTreeTokenAPPLIESTO :
+noncomputable def parseTreeTokenAPPLIESTO
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [Tok.APPLIESTO] :=
+ (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.APPLIESTO, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.APPLIESTO))
+ (.terminal (G := grammarInst) (⟨Tok.APPLIESTO, span⟩))
/-- Terminal parse tree for `PRINCIPAL` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPRINCIPAL :
+noncomputable def parseTreeTokenPRINCIPAL
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨6, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PRINCIPAL] :=
+ (.T (⟨6, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PRINCIPAL, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PRINCIPAL))
+ (.terminal (G := grammarInst) (⟨Tok.PRINCIPAL, span⟩))
/-- Terminal parse tree for `ACTION` with its concrete grammar index. -/
-noncomputable def parseTreeTokenACTION :
+noncomputable def parseTreeTokenACTION
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ACTION] :=
+ (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ACTION, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ACTION))
+ (.terminal (G := grammarInst) (⟨Tok.ACTION, span⟩))
/-- Terminal parse tree for `RESOURCE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRESOURCE :
+noncomputable def parseTreeTokenRESOURCE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨8, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RESOURCE] :=
+ (.T (⟨8, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RESOURCE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RESOURCE))
+ (.terminal (G := grammarInst) (⟨Tok.RESOURCE, span⟩))
/-- Terminal parse tree for `CONTEXT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCONTEXT :
+noncomputable def parseTreeTokenCONTEXT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨9, of_decide_eq_true rfl⟩ : Terminal)) [Tok.CONTEXT] :=
+ (.T (⟨9, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.CONTEXT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.CONTEXT))
+ (.terminal (G := grammarInst) (⟨Tok.CONTEXT, span⟩))
/-- Terminal parse tree for `ATTRIBUTES` with its concrete grammar index. -/
-noncomputable def parseTreeTokenATTRIBUTES :
+noncomputable def parseTreeTokenATTRIBUTES
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨10, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ATTRIBUTES] :=
+ (.T (⟨10, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ATTRIBUTES, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ATTRIBUTES))
+ (.terminal (G := grammarInst) (⟨Tok.ATTRIBUTES, span⟩))
/-- Terminal parse tree for `TAGS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTAGS :
+noncomputable def parseTreeTokenTAGS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨11, of_decide_eq_true rfl⟩ : Terminal)) [Tok.TAGS] :=
+ (.T (⟨11, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.TAGS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.TAGS))
+ (.terminal (G := grammarInst) (⟨Tok.TAGS, span⟩))
/-- Terminal parse tree for `LONG` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLONG :
+noncomputable def parseTreeTokenLONG
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨12, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LONG] :=
+ (.T (⟨12, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LONG, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LONG))
+ (.terminal (G := grammarInst) (⟨Tok.LONG, span⟩))
/-- Terminal parse tree for `STRING` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSTRING :
+noncomputable def parseTreeTokenSTRING
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨13, of_decide_eq_true rfl⟩ : Terminal)) [Tok.STRING] :=
+ (.T (⟨13, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.STRING, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.STRING))
+ (.terminal (G := grammarInst) (⟨Tok.STRING, span⟩))
/-- Terminal parse tree for `BOOL` with its concrete grammar index. -/
-noncomputable def parseTreeTokenBOOL :
+noncomputable def parseTreeTokenBOOL
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨14, of_decide_eq_true rfl⟩ : Terminal)) [Tok.BOOL] :=
+ (.T (⟨14, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.BOOL, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.BOOL))
+ (.terminal (G := grammarInst) (⟨Tok.BOOL, span⟩))
/-- Terminal parse tree for `ENUM` with its concrete grammar index. -/
-noncomputable def parseTreeTokenENUM :
+noncomputable def parseTreeTokenENUM
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨15, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ENUM] :=
+ (.T (⟨15, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ENUM, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ENUM))
+ (.terminal (G := grammarInst) (⟨Tok.ENUM, span⟩))
/-- Terminal parse tree for `IDENTIFIER` with its concrete grammar index. -/
noncomputable def parseTreeTokenIDENTIFIER
- (value : String) :
+ (value : String)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨16, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IDENTIFIER value] :=
+ (.T (⟨16, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IDENTIFIER value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IDENTIFIER value))
+ (.terminal (G := grammarInst) (⟨Tok.IDENTIFIER value, span⟩))
/-- Terminal parse tree for `NUMBER` with its concrete grammar index. -/
noncomputable def parseTreeTokenNUMBER
- (value : Nat) :
+ (value : Nat)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨17, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NUMBER value] :=
+ (.T (⟨17, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NUMBER value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NUMBER value))
+ (.terminal (G := grammarInst) (⟨Tok.NUMBER value, span⟩))
/-- Terminal parse tree for `STRINGLIT` with its concrete grammar index. -/
noncomputable def parseTreeTokenSTRINGLIT
- (value : String) :
+ (value : String)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨18, of_decide_eq_true rfl⟩ : Terminal)) [Tok.STRINGLIT value] :=
+ (.T (⟨18, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.STRINGLIT value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.STRINGLIT value))
+ (.terminal (G := grammarInst) (⟨Tok.STRINGLIT value, span⟩))
/-- Terminal parse tree for `COMMA` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCOMMA :
+noncomputable def parseTreeTokenCOMMA
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨19, of_decide_eq_true rfl⟩ : Terminal)) [Tok.COMMA] :=
+ (.T (⟨19, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.COMMA, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.COMMA))
+ (.terminal (G := grammarInst) (⟨Tok.COMMA, span⟩))
/-- Terminal parse tree for `SEMICOLON` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSEMICOLON :
+noncomputable def parseTreeTokenSEMICOLON
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨20, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SEMICOLON] :=
+ (.T (⟨20, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SEMICOLON, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SEMICOLON))
+ (.terminal (G := grammarInst) (⟨Tok.SEMICOLON, span⟩))
/-- Terminal parse tree for `COLON` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCOLON :
+noncomputable def parseTreeTokenCOLON
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨21, of_decide_eq_true rfl⟩ : Terminal)) [Tok.COLON] :=
+ (.T (⟨21, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.COLON, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.COLON))
+ (.terminal (G := grammarInst) (⟨Tok.COLON, span⟩))
/-- Terminal parse tree for `COLONCOLON` with its concrete grammar index. -/
-noncomputable def parseTreeTokenCOLONCOLON :
+noncomputable def parseTreeTokenCOLONCOLON
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) [Tok.COLONCOLON] :=
+ (.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.COLONCOLON, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.COLONCOLON))
+ (.terminal (G := grammarInst) (⟨Tok.COLONCOLON, span⟩))
/-- Terminal parse tree for `LBRACE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLBRACE :
+noncomputable def parseTreeTokenLBRACE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨23, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LBRACE] :=
+ (.T (⟨23, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LBRACE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LBRACE))
+ (.terminal (G := grammarInst) (⟨Tok.LBRACE, span⟩))
/-- Terminal parse tree for `RBRACE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRBRACE :
+noncomputable def parseTreeTokenRBRACE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨24, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RBRACE] :=
+ (.T (⟨24, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RBRACE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RBRACE))
+ (.terminal (G := grammarInst) (⟨Tok.RBRACE, span⟩))
/-- Terminal parse tree for `LBRACKET` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLBRACKET :
+noncomputable def parseTreeTokenLBRACKET
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨25, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LBRACKET] :=
+ (.T (⟨25, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LBRACKET, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LBRACKET))
+ (.terminal (G := grammarInst) (⟨Tok.LBRACKET, span⟩))
/-- Terminal parse tree for `RBRACKET` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRBRACKET :
+noncomputable def parseTreeTokenRBRACKET
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨26, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RBRACKET] :=
+ (.T (⟨26, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RBRACKET, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RBRACKET))
+ (.terminal (G := grammarInst) (⟨Tok.RBRACKET, span⟩))
/-- Terminal parse tree for `LANGLE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLANGLE :
+noncomputable def parseTreeTokenLANGLE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨27, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LANGLE] :=
+ (.T (⟨27, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LANGLE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LANGLE))
+ (.terminal (G := grammarInst) (⟨Tok.LANGLE, span⟩))
/-- Terminal parse tree for `RANGLE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRANGLE :
+noncomputable def parseTreeTokenRANGLE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨28, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RANGLE] :=
+ (.T (⟨28, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RANGLE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RANGLE))
+ (.terminal (G := grammarInst) (⟨Tok.RANGLE, span⟩))
/-- Terminal parse tree for `EQUALS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEQUALS :
+noncomputable def parseTreeTokenEQUALS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨29, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EQUALS] :=
+ (.T (⟨29, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EQUALS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EQUALS))
+ (.terminal (G := grammarInst) (⟨Tok.EQUALS, span⟩))
/-- Terminal parse tree for `QUESTION` with its concrete grammar index. -/
-noncomputable def parseTreeTokenQUESTION :
+noncomputable def parseTreeTokenQUESTION
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨30, of_decide_eq_true rfl⟩ : Terminal)) [Tok.QUESTION] :=
+ (.T (⟨30, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.QUESTION, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.QUESTION))
+ (.terminal (G := grammarInst) (⟨Tok.QUESTION, span⟩))
/-- Terminal parse tree for `AT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenAT :
+noncomputable def parseTreeTokenAT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨31, of_decide_eq_true rfl⟩ : Terminal)) [Tok.AT] :=
+ (.T (⟨31, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.AT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.AT))
+ (.terminal (G := grammarInst) (⟨Tok.AT, span⟩))
/-- Terminal parse tree for `LPAREN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLPAREN :
+noncomputable def parseTreeTokenLPAREN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨32, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LPAREN] :=
+ (.T (⟨32, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LPAREN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LPAREN))
+ (.terminal (G := grammarInst) (⟨Tok.LPAREN, span⟩))
/-- Terminal parse tree for `RPAREN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRPAREN :
+noncomputable def parseTreeTokenRPAREN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨33, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RPAREN] :=
+ (.T (⟨33, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RPAREN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RPAREN))
+ (.terminal (G := grammarInst) (⟨Tok.RPAREN, span⟩))
/-- Terminal parse tree for `EOF` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEOF :
+noncomputable def parseTreeTokenEOF
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨35, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EOF] :=
+ (.T (⟨35, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EOF, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EOF))
+ (.terminal (G := grammarInst) (⟨Tok.EOF, span⟩))
/-- Parse-tree constructor for production 0, in source RHS order. -/
noncomputable def parseTreeProduction0
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction0_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction0 tree0) = semanticAction0 (Grammar.ptSem tree0) := by
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction0 tree0) = semanticAction0 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction0
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 1, in source RHS order. -/
noncomputable def parseTreeProduction1 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction1_sem :
- Grammar.ptSem (parseTreeProduction1) = semanticAction1 := by
+@[simp] theorem parseTreeProduction1_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction1) = semanticAction1 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction1
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 2, in source RHS order. -/
noncomputable def parseTreeProduction2
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction2_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction2 tree0 tree1) = semanticAction2 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction2 tree0 tree1) = semanticAction2 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction2
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 3, in source RHS order. -/
noncomputable def parseTreeProduction3
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.AT] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1))
+ (([Tok.AT] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)))
@[simp] theorem parseTreeProduction3_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction3 tree1) = semanticAction3 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction3 tree1) = semanticAction3 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AT)])) tree1) (()) := by
unfold parseTreeProduction3
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 4, in source RHS order. -/
noncomputable def parseTreeProduction4
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.AT] ++ word1 ++ [Tok.LPAREN] ++ word3 ++ [Tok.RPAREN]) :=
- .nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN)))
+ (([Tok.AT] ++ word1 ++ [Tok.LPAREN] ++ word3 ++ [Tok.RPAREN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN))))
@[simp] theorem parseTreeProduction4_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction4 tree1 tree3) = semanticAction4 (()) (Grammar.ptSem tree3) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction4 tree1 tree3) = semanticAction4 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAT))) (tree1)) ((parseTreeTokenLPAREN))) (tree3)) ((parseTreeTokenRPAREN)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AT)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LPAREN)])) tree3) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.AT)])) tree1) (()) := by
unfold parseTreeProduction4
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 5, in source RHS order. -/
noncomputable def parseTreeProduction5 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction5_sem :
- Grammar.ptSem (parseTreeProduction5) = semanticAction5 := by
+@[simp] theorem parseTreeProduction5_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction5) = semanticAction5 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction5
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 6, in source RHS order. -/
noncomputable def parseTreeProduction6
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction6_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction6 tree0 tree1) = semanticAction6 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction6 tree0 tree1) = semanticAction6 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction6
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 7, in source RHS order. -/
noncomputable def parseTreeProduction7
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction7_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction7 tree0 tree1) = semanticAction7 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction7 tree0 tree1) = semanticAction7 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction7
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 8, in source RHS order. -/
noncomputable def parseTreeProduction8
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NAMESPACE] ++ word1 ++ [Tok.LBRACE] ++ word3 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨8, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenNAMESPACE))) (tree1)) ((parseTreeTokenLBRACE))) (tree3)) ((parseTreeTokenRBRACE)))
+ (([Tok.NAMESPACE] ++ word1 ++ [Tok.LBRACE] ++ word3 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨8, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenNAMESPACE))) (tree1)) ((parseTreeTokenLBRACE))) (tree3)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction8_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction8 tree1 tree3) = semanticAction8 (()) (Grammar.ptSem tree3) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction8 tree1 tree3) = semanticAction8 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenNAMESPACE))) (tree1)) ((parseTreeTokenLBRACE))) (tree3)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.NAMESPACE)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree3) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.NAMESPACE)])) tree1) (()) := by
unfold parseTreeProduction8
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 9, in source RHS order. -/
noncomputable def parseTreeProduction9
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨9, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨9, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction9_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction9 tree0) = semanticAction9 (Grammar.ptSem tree0) := by
+ (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction9 tree0) = semanticAction9 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction9
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 10, in source RHS order. -/
noncomputable def parseTreeProduction10 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨10, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨10, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction10_sem :
- Grammar.ptSem (parseTreeProduction10) = semanticAction10 := by
+@[simp] theorem parseTreeProduction10_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction10) = semanticAction10 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction10
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 11, in source RHS order. -/
noncomputable def parseTreeProduction11
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨11, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨11, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction11_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction11 tree0 tree1) = semanticAction11 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction11 tree0 tree1) = semanticAction11 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction11
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 12, in source RHS order. -/
noncomputable def parseTreeProduction12
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨12, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨12, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction12_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction12 tree0 tree1) = semanticAction12 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction12 tree0 tree1) = semanticAction12 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction12
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 13, in source RHS order. -/
noncomputable def parseTreeProduction13
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨13, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨13, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction13_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction13 tree0) = semanticAction13 (Grammar.ptSem tree0) := by
+ (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction13 tree0) = semanticAction13 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction13
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 14, in source RHS order. -/
noncomputable def parseTreeProduction14
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨14, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨14, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction14_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction14 tree0) = semanticAction14 (Grammar.ptSem tree0) := by
+ (.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction14 tree0) = semanticAction14 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction14
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 15, in source RHS order. -/
noncomputable def parseTreeProduction15
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨15, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨15, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction15_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction15 tree0) = semanticAction15 (Grammar.ptSem tree0) := by
+ (.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction15 tree0) = semanticAction15 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction15
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 16, in source RHS order. -/
noncomputable def parseTreeProduction16
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨16, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨16, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction16_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction16 tree0) = semanticAction16 (Grammar.ptSem tree0) := by
+ (.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction16 tree0) = semanticAction16 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction16
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 17, in source RHS order. -/
noncomputable def parseTreeProduction17
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ENTITY] ++ word1 ++ word2 ++ word3 ++ word4 ++ [Tok.SEMICOLON]) :=
- .nonTerminal (G := grammarInst) (⟨17, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenENTITY))) (tree1)) (tree2)) (tree3)) (tree4)) ((parseTreeTokenSEMICOLON)))
+ (([Tok.ENTITY] ++ word1 ++ word2 ++ word3 ++ word4 ++ [Tok.SEMICOLON]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨17, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenENTITY))) (tree1)) (tree2)) (tree3)) (tree4)) ((parseTreeTokenSEMICOLON))))
@[simp] theorem parseTreeProduction17_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction17 tree1 tree2 tree3 tree4) = semanticAction17 (()) (Grammar.ptSem tree4) (Grammar.ptSem tree3) (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction17 tree1 tree2 tree3 tree4) = semanticAction17 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenENTITY))) (tree1)) (tree2)) (tree3)) (tree4)) ((parseTreeTokenSEMICOLON)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ENTITY)] ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy ++ word3.map Runtime.Positioned.dummy)) tree4) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ENTITY)] ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy)) tree3) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ENTITY)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ENTITY)])) tree1) (()) := by
unfold parseTreeProduction17
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 18, in source RHS order. -/
noncomputable def parseTreeProduction18
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨10, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ENTITY] ++ word1 ++ [Tok.ENUM] ++ [Tok.LBRACKET] ++ word4 ++ [Tok.RBRACKET] ++ [Tok.SEMICOLON]) :=
- .nonTerminal (G := grammarInst) (⟨18, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenENTITY))) (tree1)) ((parseTreeTokenENUM))) ((parseTreeTokenLBRACKET))) (tree4)) ((parseTreeTokenRBRACKET))) ((parseTreeTokenSEMICOLON)))
+ (([Tok.ENTITY] ++ word1 ++ [Tok.ENUM] ++ [Tok.LBRACKET] ++ word4 ++ [Tok.RBRACKET] ++ [Tok.SEMICOLON]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨18, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenENTITY))) (tree1)) ((parseTreeTokenENUM))) ((parseTreeTokenLBRACKET))) (tree4)) ((parseTreeTokenRBRACKET))) ((parseTreeTokenSEMICOLON))))
@[simp] theorem parseTreeProduction18_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction18 tree1 tree4) = semanticAction18 (()) (()) (Grammar.ptSem tree4) (()) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction18 tree1 tree4) = semanticAction18 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenENTITY))) (tree1)) ((parseTreeTokenENUM))) ((parseTreeTokenLBRACKET))) (tree4)) ((parseTreeTokenRBRACKET))) ((parseTreeTokenSEMICOLON)))) (()) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ENTITY)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.ENUM)] ++ [Runtime.Positioned.dummy (Tok.LBRACKET)])) tree4) (()) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ENTITY)])) tree1) (()) := by
unfold parseTreeProduction18
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 19, in source RHS order. -/
noncomputable def parseTreeProduction19 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨19, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨19, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction19_sem :
- Grammar.ptSem (parseTreeProduction19) = semanticAction19 := by
+@[simp] theorem parseTreeProduction19_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction19) = semanticAction19 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction19
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 20, in source RHS order. -/
noncomputable def parseTreeProduction20
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨11, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IN] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨20, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1))
+ (([Tok.IN] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨20, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1)))
@[simp] theorem parseTreeProduction20_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction20 tree1) = semanticAction20 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction20 tree1) = semanticAction20 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IN)])) tree1) (()) := by
unfold parseTreeProduction20
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 21, in source RHS order. -/
noncomputable def parseTreeProduction21 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨21, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨21, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction21_sem :
- Grammar.ptSem (parseTreeProduction21) = semanticAction21 := by
+@[simp] theorem parseTreeProduction21_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction21) = semanticAction21 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction21
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 22, in source RHS order. -/
noncomputable def parseTreeProduction22
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨12, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.LBRACE] ++ word2 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨22, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE)))
+ ((word0 ++ [Tok.LBRACE] ++ word2 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨22, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction22_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction22 tree0 tree2) = semanticAction22 (()) (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction22 tree0 tree2) = semanticAction22 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction22
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 23, in source RHS order. -/
noncomputable def parseTreeProduction23 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨23, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨23, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction23_sem :
- Grammar.ptSem (parseTreeProduction23) = semanticAction23 := by
+@[simp] theorem parseTreeProduction23_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction23) = semanticAction23 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction23
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 24, in source RHS order. -/
noncomputable def parseTreeProduction24 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨13, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.EQUALS]) :=
- .nonTerminal (G := grammarInst) (⟨24, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenEQUALS)))
+ (([Tok.EQUALS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨24, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenEQUALS))))
-@[simp] theorem parseTreeProduction24_sem :
- Grammar.ptSem (parseTreeProduction24) = semanticAction24 (()) := by
+@[simp] theorem parseTreeProduction24_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction24) = semanticAction24 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenEQUALS)))) (()) := by
unfold parseTreeProduction24
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 25, in source RHS order. -/
noncomputable def parseTreeProduction25 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨25, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨25, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction25_sem :
- Grammar.ptSem (parseTreeProduction25) = semanticAction25 := by
+@[simp] theorem parseTreeProduction25_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction25) = semanticAction25 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction25
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 26, in source RHS order. -/
noncomputable def parseTreeProduction26
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨14, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TAGS] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨26, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenTAGS))) (tree1))
+ (([Tok.TAGS] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨26, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenTAGS))) (tree1)))
@[simp] theorem parseTreeProduction26_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction26 tree1) = semanticAction26 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction26 tree1) = semanticAction26 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenTAGS))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.TAGS)])) tree1) (()) := by
unfold parseTreeProduction26
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 27, in source RHS order. -/
noncomputable def parseTreeProduction27
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨15, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ACTION] ++ word1 ++ word2 ++ word3 ++ word4 ++ [Tok.SEMICOLON]) :=
- .nonTerminal (G := grammarInst) (⟨27, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenACTION))) (tree1)) (tree2)) (tree3)) (tree4)) ((parseTreeTokenSEMICOLON)))
+ (([Tok.ACTION] ++ word1 ++ word2 ++ word3 ++ word4 ++ [Tok.SEMICOLON]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨27, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenACTION))) (tree1)) (tree2)) (tree3)) (tree4)) ((parseTreeTokenSEMICOLON))))
@[simp] theorem parseTreeProduction27_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction27 tree1 tree2 tree3 tree4) = semanticAction27 (()) (Grammar.ptSem tree4) (Grammar.ptSem tree3) (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction27 tree1 tree2 tree3 tree4) = semanticAction27 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenACTION))) (tree1)) (tree2)) (tree3)) (tree4)) ((parseTreeTokenSEMICOLON)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ACTION)] ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy ++ word3.map Runtime.Positioned.dummy)) tree4) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ACTION)] ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy)) tree3) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ACTION)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ACTION)])) tree1) (()) := by
unfold parseTreeProduction27
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 28, in source RHS order. -/
noncomputable def parseTreeProduction28 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨28, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨28, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction28_sem :
- Grammar.ptSem (parseTreeProduction28) = semanticAction28 := by
+@[simp] theorem parseTreeProduction28_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction28) = semanticAction28 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction28
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 29, in source RHS order. -/
noncomputable def parseTreeProduction29
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨16, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IN] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨29, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1))
+ (([Tok.IN] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨29, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1)))
@[simp] theorem parseTreeProduction29_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction29 tree1) = semanticAction29 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction29 tree1) = semanticAction29 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenIN))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IN)])) tree1) (()) := by
unfold parseTreeProduction29
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 30, in source RHS order. -/
noncomputable def parseTreeProduction30 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨30, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨30, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction30_sem :
- Grammar.ptSem (parseTreeProduction30) = semanticAction30 := by
+@[simp] theorem parseTreeProduction30_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction30) = semanticAction30 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction30
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 31, in source RHS order. -/
noncomputable def parseTreeProduction31
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨17, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.APPLIESTO] ++ [Tok.LBRACE] ++ word2 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨31, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAPPLIESTO))) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE)))
+ (([Tok.APPLIESTO] ++ [Tok.LBRACE] ++ word2 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨31, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAPPLIESTO))) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction31_sem
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction31 tree2) = semanticAction31 (()) (Grammar.ptSem tree2) (()) (()) := by
+ (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction31 tree2) = semanticAction31 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenAPPLIESTO))) ((parseTreeTokenLBRACE))) (tree2)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.APPLIESTO)] ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree2) (()) (()) := by
unfold parseTreeProduction31
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 32, in source RHS order. -/
noncomputable def parseTreeProduction32 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨32, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨32, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction32_sem :
- Grammar.ptSem (parseTreeProduction32) = semanticAction32 := by
+@[simp] theorem parseTreeProduction32_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction32) = semanticAction32 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction32
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 33, in source RHS order. -/
noncomputable def parseTreeProduction33 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨18, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ATTRIBUTES] ++ [Tok.LBRACE] ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨33, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenATTRIBUTES))) ((parseTreeTokenLBRACE))) ((parseTreeTokenRBRACE)))
+ (([Tok.ATTRIBUTES] ++ [Tok.LBRACE] ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨33, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenATTRIBUTES))) ((parseTreeTokenLBRACE))) ((parseTreeTokenRBRACE))))
-@[simp] theorem parseTreeProduction33_sem :
- Grammar.ptSem (parseTreeProduction33) = semanticAction33 (()) (()) (()) := by
+@[simp] theorem parseTreeProduction33_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction33) = semanticAction33 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenATTRIBUTES))) ((parseTreeTokenLBRACE))) ((parseTreeTokenRBRACE)))) (()) (()) (()) := by
unfold parseTreeProduction33
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 34, in source RHS order. -/
noncomputable def parseTreeProduction34
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨19, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TYPE] ++ word1 ++ [Tok.EQUALS] ++ word3 ++ [Tok.SEMICOLON]) :=
- .nonTerminal (G := grammarInst) (⟨34, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenTYPE))) (tree1)) ((parseTreeTokenEQUALS))) (tree3)) ((parseTreeTokenSEMICOLON)))
+ (([Tok.TYPE] ++ word1 ++ [Tok.EQUALS] ++ word3 ++ [Tok.SEMICOLON]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨34, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenTYPE))) (tree1)) ((parseTreeTokenEQUALS))) (tree3)) ((parseTreeTokenSEMICOLON))))
@[simp] theorem parseTreeProduction34_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction34 tree1 tree3) = semanticAction34 (()) (Grammar.ptSem tree3) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction34 tree1 tree3) = semanticAction34 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenTYPE))) (tree1)) ((parseTreeTokenEQUALS))) (tree3)) ((parseTreeTokenSEMICOLON)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.TYPE)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.EQUALS)])) tree3) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.TYPE)])) tree1) (()) := by
unfold parseTreeProduction34
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 35, in source RHS order. -/
noncomputable def parseTreeProduction35
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COLON] ++ word2 ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨35, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2)) (tree3))
+ ((word0 ++ [Tok.COLON] ++ word2 ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨35, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2)) (tree3)))
@[simp] theorem parseTreeProduction35_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction35 tree0 tree2 tree3) = semanticAction35 (Grammar.ptSem tree3) (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction35 tree0 tree2 tree3) = semanticAction35 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOLON))) (tree2)) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLON)] ++ word2.map Runtime.Positioned.dummy)) tree3) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction35
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 36, in source RHS order. -/
noncomputable def parseTreeProduction36
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.CONTEXT] ++ [Tok.COLON] ++ word2 ++ word3) :=
- .nonTerminal (G := grammarInst) (⟨36, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenCONTEXT))) ((parseTreeTokenCOLON))) (tree2)) (tree3))
+ (([Tok.CONTEXT] ++ [Tok.COLON] ++ word2 ++ word3).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨36, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenCONTEXT))) ((parseTreeTokenCOLON))) (tree2)) (tree3)))
@[simp] theorem parseTreeProduction36_sem
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word3) :
- Grammar.ptSem (parseTreeProduction36 tree2 tree3) = semanticAction36 (Grammar.ptSem tree3) (Grammar.ptSem tree2) (()) (()) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction36 tree2 tree3) = semanticAction36 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenCONTEXT))) ((parseTreeTokenCOLON))) (tree2)) (tree3))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.CONTEXT)] ++ [Runtime.Positioned.dummy (Tok.COLON)] ++ word2.map Runtime.Positioned.dummy)) tree3) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.CONTEXT)] ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree2) (()) (()) := by
unfold parseTreeProduction36
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 37, in source RHS order. -/
noncomputable def parseTreeProduction37
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.CONTEXT] ++ [Tok.COLON] ++ [Tok.LBRACE] ++ word3 ++ [Tok.RBRACE] ++ word5) :=
- .nonTerminal (G := grammarInst) (⟨37, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenCONTEXT))) ((parseTreeTokenCOLON))) ((parseTreeTokenLBRACE))) (tree3)) ((parseTreeTokenRBRACE))) (tree5))
+ (([Tok.CONTEXT] ++ [Tok.COLON] ++ [Tok.LBRACE] ++ word3 ++ [Tok.RBRACE] ++ word5).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨37, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenCONTEXT))) ((parseTreeTokenCOLON))) ((parseTreeTokenLBRACE))) (tree3)) ((parseTreeTokenRBRACE))) (tree5)))
@[simp] theorem parseTreeProduction37_sem
{word3 : List Tok}
(tree3 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word3)
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word3.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
- Grammar.ptSem (parseTreeProduction37 tree3 tree5) = semanticAction37 (Grammar.ptSem tree5) (()) (Grammar.ptSem tree3) (()) (()) (()) := by
+ (.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction37 tree3 tree5) = semanticAction37 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenCONTEXT))) ((parseTreeTokenCOLON))) ((parseTreeTokenLBRACE))) (tree3)) ((parseTreeTokenRBRACE))) (tree5))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.CONTEXT)] ++ [Runtime.Positioned.dummy (Tok.COLON)] ++ [Runtime.Positioned.dummy (Tok.LBRACE)] ++ word3.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.RBRACE)])) tree5) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.CONTEXT)] ++ [Runtime.Positioned.dummy (Tok.COLON)] ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree3) (()) (()) (()) := by
unfold parseTreeProduction37
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 38, in source RHS order. -/
noncomputable def parseTreeProduction38 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨38, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨38, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction38_sem :
- Grammar.ptSem (parseTreeProduction38) = semanticAction38 := by
+@[simp] theorem parseTreeProduction38_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction38) = semanticAction38 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction38
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 39, in source RHS order. -/
noncomputable def parseTreeProduction39 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨39, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨39, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction39_sem :
- Grammar.ptSem (parseTreeProduction39) = semanticAction39 (()) := by
+@[simp] theorem parseTreeProduction39_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction39) = semanticAction39 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction39
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 40, in source RHS order. -/
noncomputable def parseTreeProduction40
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨21, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨40, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1))
+ (([Tok.COMMA] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨40, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)))
@[simp] theorem parseTreeProduction40_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction40 tree1) = semanticAction40 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨20, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction40 tree1) = semanticAction40 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction40
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 41, in source RHS order. -/
noncomputable def parseTreeProduction41
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨41, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨41, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction41_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction41 tree0) = semanticAction41 (Grammar.ptSem tree0) := by
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction41 tree0) = semanticAction41 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction41
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 42, in source RHS order. -/
noncomputable def parseTreeProduction42
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.SET] ++ [Tok.LANGLE] ++ word2 ++ [Tok.RANGLE]) :=
- .nonTerminal (G := grammarInst) (⟨42, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenSET))) ((parseTreeTokenLANGLE))) (tree2)) ((parseTreeTokenRANGLE)))
+ (([Tok.SET] ++ [Tok.LANGLE] ++ word2 ++ [Tok.RANGLE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨42, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenSET))) ((parseTreeTokenLANGLE))) (tree2)) ((parseTreeTokenRANGLE))))
@[simp] theorem parseTreeProduction42_sem
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction42 tree2) = semanticAction42 (()) (Grammar.ptSem tree2) (()) (()) := by
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction42 tree2) = semanticAction42 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenSET))) ((parseTreeTokenLANGLE))) (tree2)) ((parseTreeTokenRANGLE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.SET)] ++ [Runtime.Positioned.dummy (Tok.LANGLE)])) tree2) (()) (()) := by
unfold parseTreeProduction42
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 43, in source RHS order. -/
noncomputable def parseTreeProduction43
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACE] ++ word1 ++ [Tok.RBRACE]) :=
- .nonTerminal (G := grammarInst) (⟨43, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE)))
+ (([Tok.LBRACE] ++ word1 ++ [Tok.RBRACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨43, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE))))
@[simp] theorem parseTreeProduction43_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction43 tree1) = semanticAction43 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction43 tree1) = semanticAction43 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACE))) (tree1)) ((parseTreeTokenRBRACE)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACE)])) tree1) (()) := by
unfold parseTreeProduction43
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 44, in source RHS order. -/
noncomputable def parseTreeProduction44 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨44, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨44, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction44_sem :
- Grammar.ptSem (parseTreeProduction44) = semanticAction44 := by
+@[simp] theorem parseTreeProduction44_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction44) = semanticAction44 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction44
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 45, in source RHS order. -/
noncomputable def parseTreeProduction45
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨23, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨45, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨45, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction45_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction45 tree0) = semanticAction45 (Grammar.ptSem tree0) := by
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction45 tree0) = semanticAction45 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction45
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 46, in source RHS order. -/
noncomputable def parseTreeProduction46
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
+ (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1 ++ word2 ++ [Tok.COLON] ++ word4 ++ word5) :=
- .nonTerminal (G := grammarInst) (⟨46, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)) ((parseTreeTokenCOLON))) (tree4)) (tree5))
+ ((word0 ++ word1 ++ word2 ++ [Tok.COLON] ++ word4 ++ word5).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨46, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)) ((parseTreeTokenCOLON))) (tree4)) (tree5)))
@[simp] theorem parseTreeProduction46_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) word2)
+ (.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨22, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word5 : List Tok}
(tree5 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) word5) :
- Grammar.ptSem (parseTreeProduction46 tree0 tree1 tree2 tree4 tree5) = semanticAction46 (Grammar.ptSem tree5) (Grammar.ptSem tree4) (()) (Grammar.ptSem tree2) (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal)) (word5.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction46 tree0 tree1 tree2 tree4 tree5) = semanticAction46 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) (tree0)) (tree1)) (tree2)) ((parseTreeTokenCOLON))) (tree4)) (tree5))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLON)] ++ word4.map Runtime.Positioned.dummy)) tree5) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy ++ word2.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COLON)])) tree4) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction46
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 47, in source RHS order. -/
noncomputable def parseTreeProduction47 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨47, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨47, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction47_sem :
- Grammar.ptSem (parseTreeProduction47) = semanticAction47 := by
+@[simp] theorem parseTreeProduction47_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction47) = semanticAction47 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction47
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 48, in source RHS order. -/
noncomputable def parseTreeProduction48 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨48, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨48, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction48_sem :
- Grammar.ptSem (parseTreeProduction48) = semanticAction48 (()) := by
+@[simp] theorem parseTreeProduction48_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction48) = semanticAction48 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction48
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 49, in source RHS order. -/
noncomputable def parseTreeProduction49
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨25, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨49, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1))
+ (([Tok.COMMA] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨49, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)))
@[simp] theorem parseTreeProduction49_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction49 tree1) = semanticAction49 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨24, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction49 tree1) = semanticAction49 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction49
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 50, in source RHS order. -/
noncomputable def parseTreeProduction50 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨50, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨50, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction50_sem :
- Grammar.ptSem (parseTreeProduction50) = semanticAction50 := by
+@[simp] theorem parseTreeProduction50_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction50) = semanticAction50 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction50
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 51, in source RHS order. -/
noncomputable def parseTreeProduction51 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨26, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.QUESTION]) :=
- .nonTerminal (G := grammarInst) (⟨51, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenQUESTION)))
+ (([Tok.QUESTION]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨51, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenQUESTION))))
-@[simp] theorem parseTreeProduction51_sem :
- Grammar.ptSem (parseTreeProduction51) = semanticAction51 (()) := by
+@[simp] theorem parseTreeProduction51_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction51) = semanticAction51 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenQUESTION)))) (()) := by
unfold parseTreeProduction51
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 52, in source RHS order. -/
noncomputable def parseTreeProduction52
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨52, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨52, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction52_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction52 tree0) = semanticAction52 (Grammar.ptSem tree0) := by
+ (.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction52 tree0) = semanticAction52 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction52
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 53, in source RHS order. -/
noncomputable def parseTreeProduction53 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NAMESPACE]) :=
- .nonTerminal (G := grammarInst) (⟨53, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNAMESPACE)))
+ (([Tok.NAMESPACE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨53, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNAMESPACE))))
-@[simp] theorem parseTreeProduction53_sem :
- Grammar.ptSem (parseTreeProduction53) = semanticAction53 (()) := by
+@[simp] theorem parseTreeProduction53_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction53) = semanticAction53 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenNAMESPACE)))) (()) := by
unfold parseTreeProduction53
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 54, in source RHS order. -/
noncomputable def parseTreeProduction54 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ENTITY]) :=
- .nonTerminal (G := grammarInst) (⟨54, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenENTITY)))
+ (([Tok.ENTITY]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨54, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenENTITY))))
-@[simp] theorem parseTreeProduction54_sem :
- Grammar.ptSem (parseTreeProduction54) = semanticAction54 (()) := by
+@[simp] theorem parseTreeProduction54_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction54) = semanticAction54 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenENTITY)))) (()) := by
unfold parseTreeProduction54
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 55, in source RHS order. -/
noncomputable def parseTreeProduction55 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.SET]) :=
- .nonTerminal (G := grammarInst) (⟨55, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSET)))
+ (([Tok.SET]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨55, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSET))))
-@[simp] theorem parseTreeProduction55_sem :
- Grammar.ptSem (parseTreeProduction55) = semanticAction55 (()) := by
+@[simp] theorem parseTreeProduction55_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction55) = semanticAction55 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSET)))) (()) := by
unfold parseTreeProduction55
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 56, in source RHS order. -/
noncomputable def parseTreeProduction56 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.APPLIESTO]) :=
- .nonTerminal (G := grammarInst) (⟨56, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenAPPLIESTO)))
+ (([Tok.APPLIESTO]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨56, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenAPPLIESTO))))
-@[simp] theorem parseTreeProduction56_sem :
- Grammar.ptSem (parseTreeProduction56) = semanticAction56 (()) := by
+@[simp] theorem parseTreeProduction56_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction56) = semanticAction56 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenAPPLIESTO)))) (()) := by
unfold parseTreeProduction56
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 57, in source RHS order. -/
noncomputable def parseTreeProduction57 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PRINCIPAL]) :=
- .nonTerminal (G := grammarInst) (⟨57, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL)))
+ (([Tok.PRINCIPAL]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨57, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL))))
-@[simp] theorem parseTreeProduction57_sem :
- Grammar.ptSem (parseTreeProduction57) = semanticAction57 (()) := by
+@[simp] theorem parseTreeProduction57_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction57) = semanticAction57 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPRINCIPAL)))) (()) := by
unfold parseTreeProduction57
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 58, in source RHS order. -/
noncomputable def parseTreeProduction58 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ACTION]) :=
- .nonTerminal (G := grammarInst) (⟨58, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenACTION)))
+ (([Tok.ACTION]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨58, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenACTION))))
-@[simp] theorem parseTreeProduction58_sem :
- Grammar.ptSem (parseTreeProduction58) = semanticAction58 (()) := by
+@[simp] theorem parseTreeProduction58_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction58) = semanticAction58 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenACTION)))) (()) := by
unfold parseTreeProduction58
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 59, in source RHS order. -/
noncomputable def parseTreeProduction59 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.RESOURCE]) :=
- .nonTerminal (G := grammarInst) (⟨59, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE)))
+ (([Tok.RESOURCE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨59, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE))))
-@[simp] theorem parseTreeProduction59_sem :
- Grammar.ptSem (parseTreeProduction59) = semanticAction59 (()) := by
+@[simp] theorem parseTreeProduction59_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction59) = semanticAction59 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenRESOURCE)))) (()) := by
unfold parseTreeProduction59
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 60, in source RHS order. -/
noncomputable def parseTreeProduction60 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.CONTEXT]) :=
- .nonTerminal (G := grammarInst) (⟨60, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCONTEXT)))
+ (([Tok.CONTEXT]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨60, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCONTEXT))))
-@[simp] theorem parseTreeProduction60_sem :
- Grammar.ptSem (parseTreeProduction60) = semanticAction60 (()) := by
+@[simp] theorem parseTreeProduction60_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction60) = semanticAction60 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCONTEXT)))) (()) := by
unfold parseTreeProduction60
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 61, in source RHS order. -/
noncomputable def parseTreeProduction61 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ATTRIBUTES]) :=
- .nonTerminal (G := grammarInst) (⟨61, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenATTRIBUTES)))
+ (([Tok.ATTRIBUTES]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨61, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenATTRIBUTES))))
-@[simp] theorem parseTreeProduction61_sem :
- Grammar.ptSem (parseTreeProduction61) = semanticAction61 (()) := by
+@[simp] theorem parseTreeProduction61_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction61) = semanticAction61 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenATTRIBUTES)))) (()) := by
unfold parseTreeProduction61
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 62, in source RHS order. -/
noncomputable def parseTreeProduction62 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TAGS]) :=
- .nonTerminal (G := grammarInst) (⟨62, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTAGS)))
+ (([Tok.TAGS]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨62, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTAGS))))
-@[simp] theorem parseTreeProduction62_sem :
- Grammar.ptSem (parseTreeProduction62) = semanticAction62 (()) := by
+@[simp] theorem parseTreeProduction62_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction62) = semanticAction62 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenTAGS)))) (()) := by
unfold parseTreeProduction62
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 63, in source RHS order. -/
noncomputable def parseTreeProduction63 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.BOOL]) :=
- .nonTerminal (G := grammarInst) (⟨63, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenBOOL)))
+ (([Tok.BOOL]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨63, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenBOOL))))
-@[simp] theorem parseTreeProduction63_sem :
- Grammar.ptSem (parseTreeProduction63) = semanticAction63 (()) := by
+@[simp] theorem parseTreeProduction63_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction63) = semanticAction63 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenBOOL)))) (()) := by
unfold parseTreeProduction63
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 64, in source RHS order. -/
noncomputable def parseTreeProduction64 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LONG]) :=
- .nonTerminal (G := grammarInst) (⟨64, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLONG)))
+ (([Tok.LONG]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨64, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenLONG))))
-@[simp] theorem parseTreeProduction64_sem :
- Grammar.ptSem (parseTreeProduction64) = semanticAction64 (()) := by
+@[simp] theorem parseTreeProduction64_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction64) = semanticAction64 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenLONG)))) (()) := by
unfold parseTreeProduction64
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 65, in source RHS order. -/
noncomputable def parseTreeProduction65 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.STRING]) :=
- .nonTerminal (G := grammarInst) (⟨65, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTRING)))
+ (([Tok.STRING]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨65, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTRING))))
-@[simp] theorem parseTreeProduction65_sem :
- Grammar.ptSem (parseTreeProduction65) = semanticAction65 (()) := by
+@[simp] theorem parseTreeProduction65_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction65) = semanticAction65 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSTRING)))) (()) := by
unfold parseTreeProduction65
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 66, in source RHS order. -/
noncomputable def parseTreeProduction66 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TYPE]) :=
- .nonTerminal (G := grammarInst) (⟨66, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTYPE)))
+ (([Tok.TYPE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨66, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTYPE))))
-@[simp] theorem parseTreeProduction66_sem :
- Grammar.ptSem (parseTreeProduction66) = semanticAction66 (()) := by
+@[simp] theorem parseTreeProduction66_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction66) = semanticAction66 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenTYPE)))) (()) := by
unfold parseTreeProduction66
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 67, in source RHS order. -/
noncomputable def parseTreeProduction67 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IN]) :=
- .nonTerminal (G := grammarInst) (⟨67, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIN)))
+ (([Tok.IN]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨67, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIN))))
-@[simp] theorem parseTreeProduction67_sem :
- Grammar.ptSem (parseTreeProduction67) = semanticAction67 (()) := by
+@[simp] theorem parseTreeProduction67_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction67) = semanticAction67 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIN)))) (()) := by
unfold parseTreeProduction67
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 68, in source RHS order. -/
noncomputable def parseTreeProduction68 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ENUM]) :=
- .nonTerminal (G := grammarInst) (⟨68, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenENUM)))
+ (([Tok.ENUM]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨68, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenENUM))))
-@[simp] theorem parseTreeProduction68_sem :
- Grammar.ptSem (parseTreeProduction68) = semanticAction68 (()) := by
+@[simp] theorem parseTreeProduction68_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction68) = semanticAction68 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenENUM)))) (()) := by
unfold parseTreeProduction68
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 69, in source RHS order. -/
@@ -2439,14 +2618,16 @@ noncomputable def parseTreeProduction69
(value0 : String) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨28, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IDENTIFIER value0]) :=
- .nonTerminal (G := grammarInst) (⟨69, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIDENTIFIER value0)))
+ (([Tok.IDENTIFIER value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨69, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenIDENTIFIER value0))))
@[simp] theorem parseTreeProduction69_sem
- (value0 : String) :
- Grammar.ptSem (parseTreeProduction69 value0) = semanticAction69 (value0) := by
+ (value0 : String)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction69 value0) = semanticAction69 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenIDENTIFIER value0)))) (value0) := by
unfold parseTreeProduction69
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 70, in source RHS order. -/
@@ -2454,640 +2635,706 @@ noncomputable def parseTreeProduction70
(value0 : String) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.STRINGLIT value0]) :=
- .nonTerminal (G := grammarInst) (⟨70, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTRINGLIT value0)))
+ (([Tok.STRINGLIT value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨70, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSTRINGLIT value0))))
@[simp] theorem parseTreeProduction70_sem
- (value0 : String) :
- Grammar.ptSem (parseTreeProduction70 value0) = semanticAction70 (value0) := by
+ (value0 : String)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction70 value0) = semanticAction70 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSTRINGLIT value0)))) (value0) := by
unfold parseTreeProduction70
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 71, in source RHS order. -/
noncomputable def parseTreeProduction71
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨71, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨71, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction71_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction71 tree0) = semanticAction71 (Grammar.ptSem tree0) := by
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction71 tree0) = semanticAction71 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction71
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 72, in source RHS order. -/
noncomputable def parseTreeProduction72
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨72, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨72, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction72_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction72 tree0) = semanticAction72 (Grammar.ptSem tree0) := by
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction72 tree0) = semanticAction72 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction72
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 73, in source RHS order. -/
noncomputable def parseTreeProduction73
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨73, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨73, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction73_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction73 tree0) = semanticAction73 (Grammar.ptSem tree0) := by
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction73 tree0) = semanticAction73 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction73
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 74, in source RHS order. -/
noncomputable def parseTreeProduction74
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨74, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨74, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction74_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction74 tree0) = semanticAction74 (Grammar.ptSem tree0) := by
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction74 tree0) = semanticAction74 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction74
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 75, in source RHS order. -/
noncomputable def parseTreeProduction75
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨75, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨75, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction75_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction75 tree0 tree1) = semanticAction75 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction75 tree0 tree1) = semanticAction75 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction75
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 76, in source RHS order. -/
noncomputable def parseTreeProduction76 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨76, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨76, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction76_sem :
- Grammar.ptSem (parseTreeProduction76) = semanticAction76 := by
+@[simp] theorem parseTreeProduction76_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction76) = semanticAction76 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction76
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 77, in source RHS order. -/
noncomputable def parseTreeProduction77
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COLONCOLON] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨77, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1))
+ (([Tok.COLONCOLON] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨77, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)))
@[simp] theorem parseTreeProduction77_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction77 tree1) = semanticAction77 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨29, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction77 tree1) = semanticAction77 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree1) (()) := by
unfold parseTreeProduction77
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 78, in source RHS order. -/
noncomputable def parseTreeProduction78
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COLONCOLON] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨78, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)) (tree2))
+ (([Tok.COLONCOLON] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨78, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction78_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction78 tree1 tree2) = semanticAction78 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨33, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction78 tree1 tree2) = semanticAction78 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree1) (()) := by
unfold parseTreeProduction78
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 79, in source RHS order. -/
noncomputable def parseTreeProduction79
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨79, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨79, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction79_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction79 tree0 tree1) = semanticAction79 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction79 tree0 tree1) = semanticAction79 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction79
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 80, in source RHS order. -/
noncomputable def parseTreeProduction80 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨80, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨80, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction80_sem :
- Grammar.ptSem (parseTreeProduction80) = semanticAction80 := by
+@[simp] theorem parseTreeProduction80_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction80) = semanticAction80 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction80
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 81, in source RHS order. -/
noncomputable def parseTreeProduction81
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COLONCOLON] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨81, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)) (tree2))
+ (([Tok.COLONCOLON] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨81, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction81_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction81 tree1 tree2) = semanticAction81 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨35, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction81 tree1 tree2) = semanticAction81 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOLONCOLON))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COLONCOLON)])) tree1) (()) := by
unfold parseTreeProduction81
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 82, in source RHS order. -/
noncomputable def parseTreeProduction82
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨36, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨82, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨82, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction82_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction82 tree0) = semanticAction82 (Grammar.ptSem tree0) := by
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction82 tree0) = semanticAction82 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction82
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 83, in source RHS order. -/
noncomputable def parseTreeProduction83
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨83, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨83, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction83_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction83 tree0) = semanticAction83 (Grammar.ptSem tree0) := by
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction83 tree0) = semanticAction83 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction83
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 84, in source RHS order. -/
noncomputable def parseTreeProduction84
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COMMA] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨84, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))
+ ((word0 ++ [Tok.COMMA] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨84, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2)))
@[simp] theorem parseTreeProduction84_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨27, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction84 tree0 tree2) = semanticAction84 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨37, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction84 tree0 tree2) = semanticAction84 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction84
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 85, in source RHS order. -/
noncomputable def parseTreeProduction85
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨85, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨85, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction85_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction85 tree0) = semanticAction85 (Grammar.ptSem tree0) := by
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction85 tree0) = semanticAction85 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction85
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 86, in source RHS order. -/
noncomputable def parseTreeProduction86
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COMMA] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨86, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))
+ ((word0 ++ [Tok.COMMA] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨86, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2)))
@[simp] theorem parseTreeProduction86_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨31, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction86 tree0 tree2) = semanticAction86 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨38, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction86 tree0 tree2) = semanticAction86 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction86
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 87, in source RHS order. -/
noncomputable def parseTreeProduction87
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨87, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨87, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction87_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction87 tree0) = semanticAction87 (Grammar.ptSem tree0) := by
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction87 tree0) = semanticAction87 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction87
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 88, in source RHS order. -/
noncomputable def parseTreeProduction88
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COMMA] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨88, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))
+ ((word0 ++ [Tok.COMMA] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨88, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2)))
@[simp] theorem parseTreeProduction88_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction88 tree0 tree2) = semanticAction88 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction88 tree0 tree2) = semanticAction88 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction88
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 89, in source RHS order. -/
noncomputable def parseTreeProduction89
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨89, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨89, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction89_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction89 tree0) = semanticAction89 (Grammar.ptSem tree0) := by
+ (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction89 tree0) = semanticAction89 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction89
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 90, in source RHS order. -/
noncomputable def parseTreeProduction90
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.COMMA] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨90, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))
+ ((word0 ++ [Tok.COMMA] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨90, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2)))
@[simp] theorem parseTreeProduction90_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨30, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction90 tree0 tree2) = semanticAction90 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨40, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction90 tree0 tree2) = semanticAction90 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenCOMMA))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction90
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 91, in source RHS order. -/
noncomputable def parseTreeProduction91 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.PRINCIPAL]) :=
- .nonTerminal (G := grammarInst) (⟨91, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL)))
+ (([Tok.PRINCIPAL]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨91, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenPRINCIPAL))))
-@[simp] theorem parseTreeProduction91_sem :
- Grammar.ptSem (parseTreeProduction91) = semanticAction91 (()) := by
+@[simp] theorem parseTreeProduction91_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction91) = semanticAction91 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenPRINCIPAL)))) (()) := by
unfold parseTreeProduction91
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 92, in source RHS order. -/
noncomputable def parseTreeProduction92 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨41, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.RESOURCE]) :=
- .nonTerminal (G := grammarInst) (⟨92, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE)))
+ (([Tok.RESOURCE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨92, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenRESOURCE))))
-@[simp] theorem parseTreeProduction92_sem :
- Grammar.ptSem (parseTreeProduction92) = semanticAction92 (()) := by
+@[simp] theorem parseTreeProduction92_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction92) = semanticAction92 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenRESOURCE)))) (()) := by
unfold parseTreeProduction92
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 93, in source RHS order. -/
noncomputable def parseTreeProduction93
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨93, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨93, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction93_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction93 tree0) = semanticAction93 (Grammar.ptSem tree0) := by
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction93 tree0) = semanticAction93 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction93
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 94, in source RHS order. -/
noncomputable def parseTreeProduction94
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨42, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]) :=
- .nonTerminal (G := grammarInst) (⟨94, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))
+ (([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨94, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET))))
@[simp] theorem parseTreeProduction94_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction94 tree1) = semanticAction94 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction94 tree1) = semanticAction94 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACKET)])) tree1) (()) := by
unfold parseTreeProduction94
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 95, in source RHS order. -/
noncomputable def parseTreeProduction95 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨95, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨95, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction95_sem :
- Grammar.ptSem (parseTreeProduction95) = semanticAction95 := by
+@[simp] theorem parseTreeProduction95_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction95) = semanticAction95 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction95
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 96, in source RHS order. -/
noncomputable def parseTreeProduction96
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨43, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨96, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1))
+ ((word0 ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨96, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) (tree1)))
@[simp] theorem parseTreeProduction96_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction96 tree0 tree1) = semanticAction96 (Grammar.ptSem tree1) (Grammar.ptSem tree0) := by
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction96 tree0 tree1) = semanticAction96 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy)) tree1) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction96
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 97, in source RHS order. -/
noncomputable def parseTreeProduction97 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))
- ([]) :=
- .nonTerminal (G := grammarInst) (⟨97, of_decide_eq_true rfl⟩ : Production) (.nil)
+ ((([] : List Tok)).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨97, of_decide_eq_true rfl⟩ : Production) (.nil))
-@[simp] theorem parseTreeProduction97_sem :
- Grammar.ptSem (parseTreeProduction97) = semanticAction97 := by
+@[simp] theorem parseTreeProduction97_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction97) = semanticAction97 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.nil)) := by
unfold parseTreeProduction97
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 98, in source RHS order. -/
noncomputable def parseTreeProduction98 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA]) :=
- .nonTerminal (G := grammarInst) (⟨98, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA)))
+ (([Tok.COMMA]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨98, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenCOMMA))))
-@[simp] theorem parseTreeProduction98_sem :
- Grammar.ptSem (parseTreeProduction98) = semanticAction98 (()) := by
+@[simp] theorem parseTreeProduction98_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction98) = semanticAction98 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenCOMMA)))) (()) := by
unfold parseTreeProduction98
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 99, in source RHS order. -/
noncomputable def parseTreeProduction99
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.COMMA] ++ word1 ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨99, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))
+ (([Tok.COMMA] ++ word1 ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨99, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2)))
@[simp] theorem parseTreeProduction99_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨34, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction99 tree1 tree2) = semanticAction99 (Grammar.ptSem tree2) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨44, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction99 tree1 tree2) = semanticAction99 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenCOMMA))) (tree1)) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)] ++ word1.map Runtime.Positioned.dummy)) tree2) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.COMMA)])) tree1) (()) := by
unfold parseTreeProduction99
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 100, in source RHS order. -/
noncomputable def parseTreeProduction100
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨100, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨100, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction100_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction100 tree0) = semanticAction100 (Grammar.ptSem tree0) := by
+ (.NT (⟨32, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction100 tree0) = semanticAction100 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction100
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 101, in source RHS order. -/
noncomputable def parseTreeProduction101
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨45, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]) :=
- .nonTerminal (G := grammarInst) (⟨101, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))
+ (([Tok.LBRACKET] ++ word1 ++ [Tok.RBRACKET]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨101, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET))))
@[simp] theorem parseTreeProduction101_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction101 tree1) = semanticAction101 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨39, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction101 tree1) = semanticAction101 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLBRACKET))) (tree1)) ((parseTreeTokenRBRACKET)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LBRACKET)])) tree1) (()) := by
unfold parseTreeProduction101
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 102, in source RHS order. -/
noncomputable def parseTreeProduction102
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨46, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.EOF]) :=
- .nonTerminal (G := grammarInst) (⟨102, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))
+ ((word0 ++ [Tok.EOF]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨102, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF))))
@[simp] theorem parseTreeProduction102_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction102 tree0) = semanticAction102 (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction102 tree0) = semanticAction102 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction102
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
@@ -4498,847 +4745,847 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Schema :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Schema :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CedarSchemaParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : CedarSchemaParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees28 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 28 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨28, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 28 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨28, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees29 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 29 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨29, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 29 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨29, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees30 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 30 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨30, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 30 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨30, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees31 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 31 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨31, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 31 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨31, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees32 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 32 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨32, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 32 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨32, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees33 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 33 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨33, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 33 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨33, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees34 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 34 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨34, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 34 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨34, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees35 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 35 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨35, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 35 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨35, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees36 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 36 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨36, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 36 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨36, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees37 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 37 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨37, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 37 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨37, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees38 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 38 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨38, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 38 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨38, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees39 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 39 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨39, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 39 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨39, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees40 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 40 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨40, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 40 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨40, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees41 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 41 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨41, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 41 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨41, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees42 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 42 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨42, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 42 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨42, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees43 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 43 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨43, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 43 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨43, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees44 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 44 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨44, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 44 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨44, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees45 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 45 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨45, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 45 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨45, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees46 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 46 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨46, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 46 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨46, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees47 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 47 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨47, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 47 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨47, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees48 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 48 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨48, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 48 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨48, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees49 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 49 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨49, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 49 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨49, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees50 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 50 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨50, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 50 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨50, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees51 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 51 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨51, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 51 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨51, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees52 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 52 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨52, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 52 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨52, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees53 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 53 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨53, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 53 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨53, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees54 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 54 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨54, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 54 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨54, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees55 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 55 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨55, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 55 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨55, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees56 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 56 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨56, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 56 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨56, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees57 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 57 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨57, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 57 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨57, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees58 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 58 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨58, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 58 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨58, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees59 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 59 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨59, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 59 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨59, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees60 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 60 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨60, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 60 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨60, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees61 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 61 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨61, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 61 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨61, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees62 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 62 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨62, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 62 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨62, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees63 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 63 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨63, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 63 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨63, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees64 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 64 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨64, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 64 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨64, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees65 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 65 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨65, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 65 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨65, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees66 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 66 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨66, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 66 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨66, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees67 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 67 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨67, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 67 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨67, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees68 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 68 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨68, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 68 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨68, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees69 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 69 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨69, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 69 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨69, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees70 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 70 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨70, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 70 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨70, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees71 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 71 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨71, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 71 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨71, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees72 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 72 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨72, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 72 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨72, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees73 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 73 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨73, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 73 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨73, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees74 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 74 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨74, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 74 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨74, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees75 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 75 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨75, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 75 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨75, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees76 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 76 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨76, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 76 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨76, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees77 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 77 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨77, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 77 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨77, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees78 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 78 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨78, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 78 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨78, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees79 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 79 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨79, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 79 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨79, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees80 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 80 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨80, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 80 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨80, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees81 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 81 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨81, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 81 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨81, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees82 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 82 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨82, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 82 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨82, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees83 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 83 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨83, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 83 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨83, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees84 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 84 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨84, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 84 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨84, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees85 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 85 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨85, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 85 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨85, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees86 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 86 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨86, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 86 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨86, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees87 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 87 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨87, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 87 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨87, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees88 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 88 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨88, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 88 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨88, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees89 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 89 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨89, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 89 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨89, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees90 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 90 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨90, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 90 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨90, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees91 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 91 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨91, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 91 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨91, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees92 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 92 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨92, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 92 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨92, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees93 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 93 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨93, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 93 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨93, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees94 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 94 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨94, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 94 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨94, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees95 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 95 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨95, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 95 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨95, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees96 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 96 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨96, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 96 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨96, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees97 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 97 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨97, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 97 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨97, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees98 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 98 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨98, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 98 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨98, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees99 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 99 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨99, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 99 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨99, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees100 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 100 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨100, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 100 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨100, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees101 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 101 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨101, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 101 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨101, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees102 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
- CedarSchemaParser.table.sem 102 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨102, of_decide_eq_true rfl⟩ : Production))),
+ CedarSchemaParser.semV 102 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨102, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- CedarSchemaParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ CedarSchemaParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨28, _⟩, values => refinementSemanticAgrees28 values
- | ⟨29, _⟩, values => refinementSemanticAgrees29 values
- | ⟨30, _⟩, values => refinementSemanticAgrees30 values
- | ⟨31, _⟩, values => refinementSemanticAgrees31 values
- | ⟨32, _⟩, values => refinementSemanticAgrees32 values
- | ⟨33, _⟩, values => refinementSemanticAgrees33 values
- | ⟨34, _⟩, values => refinementSemanticAgrees34 values
- | ⟨35, _⟩, values => refinementSemanticAgrees35 values
- | ⟨36, _⟩, values => refinementSemanticAgrees36 values
- | ⟨37, _⟩, values => refinementSemanticAgrees37 values
- | ⟨38, _⟩, values => refinementSemanticAgrees38 values
- | ⟨39, _⟩, values => refinementSemanticAgrees39 values
- | ⟨40, _⟩, values => refinementSemanticAgrees40 values
- | ⟨41, _⟩, values => refinementSemanticAgrees41 values
- | ⟨42, _⟩, values => refinementSemanticAgrees42 values
- | ⟨43, _⟩, values => refinementSemanticAgrees43 values
- | ⟨44, _⟩, values => refinementSemanticAgrees44 values
- | ⟨45, _⟩, values => refinementSemanticAgrees45 values
- | ⟨46, _⟩, values => refinementSemanticAgrees46 values
- | ⟨47, _⟩, values => refinementSemanticAgrees47 values
- | ⟨48, _⟩, values => refinementSemanticAgrees48 values
- | ⟨49, _⟩, values => refinementSemanticAgrees49 values
- | ⟨50, _⟩, values => refinementSemanticAgrees50 values
- | ⟨51, _⟩, values => refinementSemanticAgrees51 values
- | ⟨52, _⟩, values => refinementSemanticAgrees52 values
- | ⟨53, _⟩, values => refinementSemanticAgrees53 values
- | ⟨54, _⟩, values => refinementSemanticAgrees54 values
- | ⟨55, _⟩, values => refinementSemanticAgrees55 values
- | ⟨56, _⟩, values => refinementSemanticAgrees56 values
- | ⟨57, _⟩, values => refinementSemanticAgrees57 values
- | ⟨58, _⟩, values => refinementSemanticAgrees58 values
- | ⟨59, _⟩, values => refinementSemanticAgrees59 values
- | ⟨60, _⟩, values => refinementSemanticAgrees60 values
- | ⟨61, _⟩, values => refinementSemanticAgrees61 values
- | ⟨62, _⟩, values => refinementSemanticAgrees62 values
- | ⟨63, _⟩, values => refinementSemanticAgrees63 values
- | ⟨64, _⟩, values => refinementSemanticAgrees64 values
- | ⟨65, _⟩, values => refinementSemanticAgrees65 values
- | ⟨66, _⟩, values => refinementSemanticAgrees66 values
- | ⟨67, _⟩, values => refinementSemanticAgrees67 values
- | ⟨68, _⟩, values => refinementSemanticAgrees68 values
- | ⟨69, _⟩, values => refinementSemanticAgrees69 values
- | ⟨70, _⟩, values => refinementSemanticAgrees70 values
- | ⟨71, _⟩, values => refinementSemanticAgrees71 values
- | ⟨72, _⟩, values => refinementSemanticAgrees72 values
- | ⟨73, _⟩, values => refinementSemanticAgrees73 values
- | ⟨74, _⟩, values => refinementSemanticAgrees74 values
- | ⟨75, _⟩, values => refinementSemanticAgrees75 values
- | ⟨76, _⟩, values => refinementSemanticAgrees76 values
- | ⟨77, _⟩, values => refinementSemanticAgrees77 values
- | ⟨78, _⟩, values => refinementSemanticAgrees78 values
- | ⟨79, _⟩, values => refinementSemanticAgrees79 values
- | ⟨80, _⟩, values => refinementSemanticAgrees80 values
- | ⟨81, _⟩, values => refinementSemanticAgrees81 values
- | ⟨82, _⟩, values => refinementSemanticAgrees82 values
- | ⟨83, _⟩, values => refinementSemanticAgrees83 values
- | ⟨84, _⟩, values => refinementSemanticAgrees84 values
- | ⟨85, _⟩, values => refinementSemanticAgrees85 values
- | ⟨86, _⟩, values => refinementSemanticAgrees86 values
- | ⟨87, _⟩, values => refinementSemanticAgrees87 values
- | ⟨88, _⟩, values => refinementSemanticAgrees88 values
- | ⟨89, _⟩, values => refinementSemanticAgrees89 values
- | ⟨90, _⟩, values => refinementSemanticAgrees90 values
- | ⟨91, _⟩, values => refinementSemanticAgrees91 values
- | ⟨92, _⟩, values => refinementSemanticAgrees92 values
- | ⟨93, _⟩, values => refinementSemanticAgrees93 values
- | ⟨94, _⟩, values => refinementSemanticAgrees94 values
- | ⟨95, _⟩, values => refinementSemanticAgrees95 values
- | ⟨96, _⟩, values => refinementSemanticAgrees96 values
- | ⟨97, _⟩, values => refinementSemanticAgrees97 values
- | ⟨98, _⟩, values => refinementSemanticAgrees98 values
- | ⟨99, _⟩, values => refinementSemanticAgrees99 values
- | ⟨100, _⟩, values => refinementSemanticAgrees100 values
- | ⟨101, _⟩, values => refinementSemanticAgrees101 values
- | ⟨102, _⟩, values => refinementSemanticAgrees102 values
- | ⟨n + 103, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨28, _⟩, spans, values => refinementSemanticAgrees28 spans values
+ | ⟨29, _⟩, spans, values => refinementSemanticAgrees29 spans values
+ | ⟨30, _⟩, spans, values => refinementSemanticAgrees30 spans values
+ | ⟨31, _⟩, spans, values => refinementSemanticAgrees31 spans values
+ | ⟨32, _⟩, spans, values => refinementSemanticAgrees32 spans values
+ | ⟨33, _⟩, spans, values => refinementSemanticAgrees33 spans values
+ | ⟨34, _⟩, spans, values => refinementSemanticAgrees34 spans values
+ | ⟨35, _⟩, spans, values => refinementSemanticAgrees35 spans values
+ | ⟨36, _⟩, spans, values => refinementSemanticAgrees36 spans values
+ | ⟨37, _⟩, spans, values => refinementSemanticAgrees37 spans values
+ | ⟨38, _⟩, spans, values => refinementSemanticAgrees38 spans values
+ | ⟨39, _⟩, spans, values => refinementSemanticAgrees39 spans values
+ | ⟨40, _⟩, spans, values => refinementSemanticAgrees40 spans values
+ | ⟨41, _⟩, spans, values => refinementSemanticAgrees41 spans values
+ | ⟨42, _⟩, spans, values => refinementSemanticAgrees42 spans values
+ | ⟨43, _⟩, spans, values => refinementSemanticAgrees43 spans values
+ | ⟨44, _⟩, spans, values => refinementSemanticAgrees44 spans values
+ | ⟨45, _⟩, spans, values => refinementSemanticAgrees45 spans values
+ | ⟨46, _⟩, spans, values => refinementSemanticAgrees46 spans values
+ | ⟨47, _⟩, spans, values => refinementSemanticAgrees47 spans values
+ | ⟨48, _⟩, spans, values => refinementSemanticAgrees48 spans values
+ | ⟨49, _⟩, spans, values => refinementSemanticAgrees49 spans values
+ | ⟨50, _⟩, spans, values => refinementSemanticAgrees50 spans values
+ | ⟨51, _⟩, spans, values => refinementSemanticAgrees51 spans values
+ | ⟨52, _⟩, spans, values => refinementSemanticAgrees52 spans values
+ | ⟨53, _⟩, spans, values => refinementSemanticAgrees53 spans values
+ | ⟨54, _⟩, spans, values => refinementSemanticAgrees54 spans values
+ | ⟨55, _⟩, spans, values => refinementSemanticAgrees55 spans values
+ | ⟨56, _⟩, spans, values => refinementSemanticAgrees56 spans values
+ | ⟨57, _⟩, spans, values => refinementSemanticAgrees57 spans values
+ | ⟨58, _⟩, spans, values => refinementSemanticAgrees58 spans values
+ | ⟨59, _⟩, spans, values => refinementSemanticAgrees59 spans values
+ | ⟨60, _⟩, spans, values => refinementSemanticAgrees60 spans values
+ | ⟨61, _⟩, spans, values => refinementSemanticAgrees61 spans values
+ | ⟨62, _⟩, spans, values => refinementSemanticAgrees62 spans values
+ | ⟨63, _⟩, spans, values => refinementSemanticAgrees63 spans values
+ | ⟨64, _⟩, spans, values => refinementSemanticAgrees64 spans values
+ | ⟨65, _⟩, spans, values => refinementSemanticAgrees65 spans values
+ | ⟨66, _⟩, spans, values => refinementSemanticAgrees66 spans values
+ | ⟨67, _⟩, spans, values => refinementSemanticAgrees67 spans values
+ | ⟨68, _⟩, spans, values => refinementSemanticAgrees68 spans values
+ | ⟨69, _⟩, spans, values => refinementSemanticAgrees69 spans values
+ | ⟨70, _⟩, spans, values => refinementSemanticAgrees70 spans values
+ | ⟨71, _⟩, spans, values => refinementSemanticAgrees71 spans values
+ | ⟨72, _⟩, spans, values => refinementSemanticAgrees72 spans values
+ | ⟨73, _⟩, spans, values => refinementSemanticAgrees73 spans values
+ | ⟨74, _⟩, spans, values => refinementSemanticAgrees74 spans values
+ | ⟨75, _⟩, spans, values => refinementSemanticAgrees75 spans values
+ | ⟨76, _⟩, spans, values => refinementSemanticAgrees76 spans values
+ | ⟨77, _⟩, spans, values => refinementSemanticAgrees77 spans values
+ | ⟨78, _⟩, spans, values => refinementSemanticAgrees78 spans values
+ | ⟨79, _⟩, spans, values => refinementSemanticAgrees79 spans values
+ | ⟨80, _⟩, spans, values => refinementSemanticAgrees80 spans values
+ | ⟨81, _⟩, spans, values => refinementSemanticAgrees81 spans values
+ | ⟨82, _⟩, spans, values => refinementSemanticAgrees82 spans values
+ | ⟨83, _⟩, spans, values => refinementSemanticAgrees83 spans values
+ | ⟨84, _⟩, spans, values => refinementSemanticAgrees84 spans values
+ | ⟨85, _⟩, spans, values => refinementSemanticAgrees85 spans values
+ | ⟨86, _⟩, spans, values => refinementSemanticAgrees86 spans values
+ | ⟨87, _⟩, spans, values => refinementSemanticAgrees87 spans values
+ | ⟨88, _⟩, spans, values => refinementSemanticAgrees88 spans values
+ | ⟨89, _⟩, spans, values => refinementSemanticAgrees89 spans values
+ | ⟨90, _⟩, spans, values => refinementSemanticAgrees90 spans values
+ | ⟨91, _⟩, spans, values => refinementSemanticAgrees91 spans values
+ | ⟨92, _⟩, spans, values => refinementSemanticAgrees92 spans values
+ | ⟨93, _⟩, spans, values => refinementSemanticAgrees93 spans values
+ | ⟨94, _⟩, spans, values => refinementSemanticAgrees94 spans values
+ | ⟨95, _⟩, spans, values => refinementSemanticAgrees95 spans values
+ | ⟨96, _⟩, spans, values => refinementSemanticAgrees96 spans values
+ | ⟨97, _⟩, spans, values => refinementSemanticAgrees97 spans values
+ | ⟨98, _⟩, spans, values => refinementSemanticAgrees98 spans values
+ | ⟨99, _⟩, spans, values => refinementSemanticAgrees99 spans values
+ | ⟨100, _⟩, spans, values => refinementSemanticAgrees100 spans values
+ | ⟨101, _⟩, spans, values => refinementSemanticAgrees101 spans values
+ | ⟨102, _⟩, spans, values => refinementSemanticAgrees102 spans values
+ | ⟨n + 103, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -5445,17 +5692,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- CedarSchemaParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ CedarSchemaParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) CedarSchemaParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) CedarSchemaParser.V := {
table := CedarSchemaParser.table
- decode := fun t => CedarSchemaParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := CedarSchemaParser.semV
+ decode := CedarSchemaParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -5500,13 +5749,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change CedarSchemaParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change CedarSchemaParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -5514,21 +5764,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (CedarSchemaParser.run input logNSteps) := by
+ have hrun : CedarSchemaParser.run input logNSteps
= Runtime.Exec.run CedarSchemaParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [CedarSchemaParser.run]
rw [Runtime.Exec.runFast_eq_run CedarSchemaParser.stackOps CedarSchemaParser.flat CedarSchemaParser.fuse
CedarSchemaParser.termOf CedarSchemaParser.valOf CedarSchemaParser.stackLawful CedarSchemaParser.fuseOK]
- simp only [CedarSchemaParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- CedarSchemaParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ CedarSchemaParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold CedarSchemaParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -5536,49 +5786,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : CedarSchemaParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Schema)
- (accepted : CedarSchemaParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : CedarSchemaParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (CedarSchemaParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (CedarSchemaParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : CedarSchemaParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -5587,7 +5839,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- CedarSchemaParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ CedarSchemaParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -5603,13 +5855,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- CedarSchemaParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ CedarSchemaParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -5619,14 +5873,20 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
end CedarSchemaVerified
diff --git a/test/imp/ImpParser.lean b/test/imp/ImpParser.lean
index 8387338..e90c50d 100644
--- a/test/imp/ImpParser.lean
+++ b/test/imp/ImpParser.lean
@@ -91,31 +91,34 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def sem : Nat → List VP → VP
- | 0, [(s_span, .v0 s), (__s1, _), (c_span, .v0 c)] => (Runtime.Span.merge s_span c_span, .v0 (Com.seq s c))
- | 1, [(s_span, .v0 s)] => (s_span, .v0 (s))
- | 2, [(__s0, _)] => (__s0, .v0 (Com.skip))
- | 3, [(x_span, .v3 x), (__s1, _), (a_span, .v2 a)] => (Runtime.Span.merge x_span a_span, .v0 (Com.assign x a))
- | 4, [(__s0, _), (b_span, .v1 b), (__s2, _), (__s3, _), (c1_span, .v0 c1), (__s5, _), (__s6, _), (__s7, _), (c2_span, .v0 c2), (__s9, _)] => (Runtime.Span.merge __s0 __s9, .v0 (Com.ite b c1 c2))
- | 5, [(__s0, _), (b_span, .v1 b), (__s2, _), (__s3, _), (c_span, .v0 c), (__s5, _)] => (Runtime.Span.merge __s0 __s5, .v0 (Com.while b c))
- | 6, [(b_span, .v1 b), (__s1, _), (c_span, .v1 c)] => (Runtime.Span.merge b_span c_span, .v1 (BExp.and b c))
- | 7, [(b_span, .v1 b)] => (b_span, .v1 (b))
- | 8, [(__s0, _)] => (__s0, .v1 (BExp.tru))
- | 9, [(__s0, _)] => (__s0, .v1 (BExp.fls))
- | 10, [(__s0, _), (b_span, .v1 b)] => (Runtime.Span.merge __s0 b_span, .v1 (BExp.not b))
- | 11, [(a1_span, .v2 a1), (__s1, _), (a2_span, .v2 a2)] => (Runtime.Span.merge a1_span a2_span, .v1 (BExp.le a1 a2))
- | 12, [(a1_span, .v2 a1), (__s1, _), (a2_span, .v2 a2)] => (Runtime.Span.merge a1_span a2_span, .v1 (BExp.eq a1 a2))
- | 13, [(__s0, _), (b_span, .v1 b), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v1 (b))
- | 14, [(a_span, .v2 a), (__s1, _), (t_span, .v2 t)] => (Runtime.Span.merge a_span t_span, .v2 (AExp.add a t))
- | 15, [(a_span, .v2 a), (__s1, _), (t_span, .v2 t)] => (Runtime.Span.merge a_span t_span, .v2 (AExp.sub a t))
- | 16, [(t_span, .v2 t)] => (t_span, .v2 (t))
- | 17, [(t_span, .v2 t), (__s1, _), (f_span, .v2 f)] => (Runtime.Span.merge t_span f_span, .v2 (AExp.mul t f))
- | 18, [(f_span, .v2 f)] => (f_span, .v2 (f))
- | 19, [(__s0, _), (a_span, .v2 a), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v2 (a))
- | 20, [(x_span, .v3 x)] => (x_span, .v2 (AExp.var x))
- | 21, [(n_span, .v4 n)] => (n_span, .v2 (AExp.num n))
- | 22, [x, _] => x
- | _, _ => (Runtime.Span.dummy, .unit ())
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v0 s, _, .v0 c] => .v0 (Com.seq s c)
+ | 1, _, [.v0 s] => .v0 (s)
+ | 2, _, [_] => .v0 (Com.skip)
+ | 3, _, [.v3 x, _, .v2 a] => .v0 (Com.assign x a)
+ | 4, _, [_, .v1 b, _, _, .v0 c1, _, _, _, .v0 c2, _] => .v0 (Com.ite b c1 c2)
+ | 5, _, [_, .v1 b, _, _, .v0 c, _] => .v0 (Com.while b c)
+ | 6, _, [.v1 b, _, .v1 c] => .v1 (BExp.and b c)
+ | 7, _, [.v1 b] => .v1 (b)
+ | 8, _, [_] => .v1 (BExp.tru)
+ | 9, _, [_] => .v1 (BExp.fls)
+ | 10, _, [_, .v1 b] => .v1 (BExp.not b)
+ | 11, _, [.v2 a1, _, .v2 a2] => .v1 (BExp.le a1 a2)
+ | 12, _, [.v2 a1, _, .v2 a2] => .v1 (BExp.eq a1 a2)
+ | 13, _, [_, .v1 b, _] => .v1 (b)
+ | 14, _, [.v2 a, _, .v2 t] => .v2 (AExp.add a t)
+ | 15, _, [.v2 a, _, .v2 t] => .v2 (AExp.sub a t)
+ | 16, _, [.v2 t] => .v2 (t)
+ | 17, _, [.v2 t, _, .v2 f] => .v2 (AExp.mul t f)
+ | 18, _, [.v2 f] => .v2 (f)
+ | 19, _, [_, .v2 a, _] => .v2 (a)
+ | 20, _, [.v3 x] => .v2 (AExp.var x)
+ | 21, _, [.v4 n] => .v2 (AExp.num n)
+ | 22, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -166,6 +169,34 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c3 st _ _ _ _ => st
| .c4 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -220,6 +251,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.shift 2, .shift 4, .error, .error, .shift 5, .error, .error, .error, .error, .error, .error, .error, .error,
@@ -502,6 +534,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
diff --git a/test/imp/ImpParserRoundtrip.lean b/test/imp/ImpParserRoundtrip.lean
index b5066df..8cc6861 100644
--- a/test/imp/ImpParserRoundtrip.lean
+++ b/test/imp/ImpParserRoundtrip.lean
@@ -23,10 +23,11 @@ namespace ImpParserRoundtrip
open Runtime ImpUnparse
/-- A parse tree certifying that `tokens` parse to `value`. The start tree
- includes the explicit EOF required by the augmented grammar. -/
+ includes the explicit EOF required by the augmented grammar. Its tokens carry
+ the dummy span, as the token generator produces no positions. -/
structure Certificate (tokens : List Tok) (value : Com) where
- tree : ImpVerified.ParserStartTree (tokens ++ [Tok.EOF])
- semantics : Runtime.Grammar.ptSem tree = value
+ tree : ImpVerified.ParserStartTree ((tokens ++ [Tok.EOF]).map Positioned.dummy)
+ semantics : Runtime.SpanGrammar.ptSem ⟨0⟩ tree = value
/-- Sufficient logarithmic fuel computed from the certified tree. -/
def Certificate.logFuel {tokens : List Tok} {value : Com}
diff --git a/test/imp/ImpParserRoundtripProof.lean b/test/imp/ImpParserRoundtripProof.lean
index 75a3717..d96ae9c 100644
--- a/test/imp/ImpParserRoundtripProof.lean
+++ b/test/imp/ImpParserRoundtripProof.lean
@@ -26,7 +26,7 @@ open Imp ImpUnparse Runtime Runtime.Grammar
noncomputable def aexpTree : (expression : AExp) →
ParseTree (G := ImpVerified.grammarInst)
- (.NT (⟨4, by omega⟩ : ImpVerified.NonTerminal)) (unparseAExp expression)
+ (.NT (⟨4, by omega⟩ : ImpVerified.NonTerminal)) ((unparseAExp expression).map Positioned.dummy)
| .num value =>
ImpVerified.parseTreeProduction16
(ImpVerified.parseTreeProduction18
@@ -61,7 +61,7 @@ noncomputable def aexpTree : (expression : AExp) →
noncomputable def bexpTree : (expression : BExp) →
ParseTree (G := ImpVerified.grammarInst)
- (.NT (⟨2, by omega⟩ : ImpVerified.NonTerminal)) (unparseBExp expression)
+ (.NT (⟨2, by omega⟩ : ImpVerified.NonTerminal)) ((unparseBExp expression).map Positioned.dummy)
| .tru => ImpVerified.parseTreeProduction7 ImpVerified.parseTreeProduction8
| .fls => ImpVerified.parseTreeProduction7 ImpVerified.parseTreeProduction9
| .le lhs rhs =>
@@ -92,13 +92,13 @@ mutual
noncomputable def comTree : (command : PrintableCom) →
ParseTree (G := ImpVerified.grammarInst)
- (.NT (⟨0, by omega⟩ : ImpVerified.NonTerminal)) (unparsePrintableCom command)
+ (.NT (⟨0, by omega⟩ : ImpVerified.NonTerminal)) ((unparsePrintableCom command).map Positioned.dummy)
| .last stmt => ImpVerified.parseTreeProduction1 (stmtTree stmt)
| .seq stmt rest => ImpVerified.parseTreeProduction0 (stmtTree stmt) (comTree rest)
noncomputable def stmtTree : (statement : PrintableStmt) →
ParseTree (G := ImpVerified.grammarInst)
- (.NT (⟨1, by omega⟩ : ImpVerified.NonTerminal)) (unparsePrintableStmt statement)
+ (.NT (⟨1, by omega⟩ : ImpVerified.NonTerminal)) ((unparsePrintableStmt statement).map Positioned.dummy)
| .skip => ImpVerified.parseTreeProduction2
| .assign name value => ImpVerified.parseTreeProduction3 name (aexpTree value)
| .ite cond thenBranch elseBranch =>
@@ -109,8 +109,9 @@ noncomputable def stmtTree : (statement : PrintableStmt) →
end
-theorem aexpTree_sem (expression : AExp) : ptSem (aexpTree expression) = expression := by
- induction expression with
+theorem aexpTree_sem (expression : AExp) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (aexpTree expression) = expression := by
+ induction expression generalizing pe with
| num value =>
rw [show aexpTree (AExp.num value)
= ImpVerified.parseTreeProduction16
@@ -161,8 +162,9 @@ theorem aexpTree_sem (expression : AExp) : ptSem (aexpTree expression) = express
ImpVerified.parseTreeProduction19_sem, ImpVerified.parseTreeProduction19_sem, ihl, ihr]
rfl
-theorem bexpTree_sem (expression : BExp) : ptSem (bexpTree expression) = expression := by
- induction expression with
+theorem bexpTree_sem (expression : BExp) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (bexpTree expression) = expression := by
+ induction expression generalizing pe with
| tru =>
rw [show bexpTree BExp.tru
= ImpVerified.parseTreeProduction7 ImpVerified.parseTreeProduction8 from rfl]
@@ -212,20 +214,20 @@ theorem bexpTree_sem (expression : BExp) : ptSem (bexpTree expression) = express
mutual
-theorem comTree_sem (command : PrintableCom) :
- ptSem (comTree command) = command.toCom := by
+theorem comTree_sem (command : PrintableCom) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (comTree command) = command.toCom := by
cases command with
| last stmt =>
simp only [comTree, PrintableCom.toCom]
erw [ImpVerified.parseTreeProduction1_sem]
- exact stmtTree_sem stmt
+ exact stmtTree_sem stmt _
| seq stmt rest =>
simp only [comTree, PrintableCom.toCom]
erw [ImpVerified.parseTreeProduction0_sem, stmtTree_sem, comTree_sem]
rfl
-theorem stmtTree_sem (statement : PrintableStmt) :
- ptSem (stmtTree statement) = statement.toCom := by
+theorem stmtTree_sem (statement : PrintableStmt) (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (stmtTree statement) = statement.toCom := by
cases statement with
| skip =>
simp only [stmtTree, PrintableStmt.toCom]
@@ -250,9 +252,9 @@ noncomputable def certificate (command : PrintableCom) :
ImpParserRoundtrip.Certificate (unparsePrintableCom command) command.toCom := by
refine { tree := ?_, semantics := ?_ }
· with_unfolding_all exact ImpVerified.parseTreeProduction22 (comTree command)
- · show ptSem (ImpVerified.parseTreeProduction22 (comTree command)) = command.toCom
+ · show SpanGrammar.ptSem ⟨0⟩ (ImpVerified.parseTreeProduction22 (comTree command)) = command.toCom
erw [ImpVerified.parseTreeProduction22_sem]
- exact comTree_sem command
+ exact comTree_sem command _
/-- Universal token-level parser roundtrip for the grammar-shaped IMP command type. -/
theorem parse_roundtrip (command : PrintableCom) :
diff --git a/test/imp/ImpVerified.lean b/test/imp/ImpVerified.lean
index 7bee5f7..b9ac872 100644
--- a/test/imp/ImpVerified.lean
+++ b/test/imp/ImpVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -43,6 +45,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace ImpVerified
abbrev Terminal := Fin 23
@@ -150,40 +154,40 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 7
augmentedProduction := 22 }
-def semTbl : List (Σ T : Type, T → ImpParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Com : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Com : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(BExp : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(BExp : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(AExp : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(AExp : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(AExp : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(Com : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → ImpParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → ImpParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(String : Type), fun v => .v3 v⟩,
+ ⟨(Int : Type), fun v => .v4 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Com : Type), fun v => .v0 v⟩,
+ ⟨(Com : Type), fun v => .v0 v⟩,
+ ⟨(BExp : Type), fun v => .v1 v⟩,
+ ⟨(BExp : Type), fun v => .v1 v⟩,
+ ⟨(AExp : Type), fun v => .v2 v⟩,
+ ⟨(AExp : Type), fun v => .v2 v⟩,
+ ⟨(AExp : Type), fun v => .v2 v⟩,
+ ⟨(Com : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → ImpParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -192,79 +196,79 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (c : Com) (_ : Unit) (s : Com) => (Com.seq s c)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (c : Com) (_ : Unit) (s : Com) => (Com.seq s c)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : Com) => (s)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : Com) => (s)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (Com.skip)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (Com.skip)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : AExp) (_ : Unit) (x : String) => (Com.assign x a)
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : AExp) (_ : Unit) (x : String) => (Com.assign x a)
-def semanticAction4 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (c2 : Com) (_ : Unit) (_ : Unit) (_ : Unit) (c1 : Com) (_ : Unit) (_ : Unit) (b : BExp) (_ : Unit) => (Com.ite b c1 c2)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (c2 : Com) (_ : Unit) (_ : Unit) (_ : Unit) (c1 : Com) (_ : Unit) (_ : Unit) (b : BExp) (_ : Unit) => (Com.ite b c1 c2)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (c : Com) (_ : Unit) (_ : Unit) (b : BExp) (_ : Unit) => (Com.while b c)
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (c : Com) (_ : Unit) (_ : Unit) (b : BExp) (_ : Unit) => (Com.while b c)
-def semanticAction6 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (c : BExp) (_ : Unit) (b : BExp) => (BExp.and b c)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (c : BExp) (_ : Unit) (b : BExp) => (BExp.and b c)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : BExp) => (b)
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : BExp) => (b)
-def semanticAction8 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (BExp.tru)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (BExp.tru)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) => (BExp.fls)
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨7, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) => (BExp.fls)
-def semanticAction10 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : BExp) (_ : Unit) => (BExp.not b)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : BExp) (_ : Unit) => (BExp.not b)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (a2 : AExp) (_ : Unit) (a1 : AExp) => (BExp.le a1 a2)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨17, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a2 : AExp) (_ : Unit) (a1 : AExp) => (BExp.le a1 a2)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (a2 : AExp) (_ : Unit) (a1 : AExp) => (BExp.eq a1 a2)
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a2 : AExp) (_ : Unit) (a1 : AExp) => (BExp.eq a1 a2)
-def semanticAction13 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (b : BExp) (_ : Unit) => (b)
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (b : BExp) (_ : Unit) => (b)
-def semanticAction14 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : AExp) (_ : Unit) (a : AExp) => (AExp.add a t)
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : AExp) (_ : Unit) (a : AExp) => (AExp.add a t)
-def semanticAction15 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : AExp) (_ : Unit) (a : AExp) => (AExp.sub a t)
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : AExp) (_ : Unit) (a : AExp) => (AExp.sub a t)
-def semanticAction16 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : AExp) => (t)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : AExp) => (t)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : AExp) (_ : Unit) (t : AExp) => (AExp.mul t f)
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨16, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : AExp) (_ : Unit) (t : AExp) => (AExp.mul t f)
-def semanticAction18 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (f : AExp) => (f)
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (f : AExp) => (f)
-def semanticAction19 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (a : AExp) (_ : Unit) => (a)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (a : AExp) (_ : Unit) => (a)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (AExp.var x)
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨19, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (AExp.var x)
-def semanticAction21 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Int) => (AExp.num n)
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨20, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Int) => (AExp.num n)
-def semanticAction22 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨22, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨0, of_decide_eq_true rfl⟩]) semanticAction2
@@ -296,7 +300,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -378,224 +382,254 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
/-- Terminal parse tree for `SKIP` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSKIP :
+noncomputable def parseTreeTokenSKIP
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SKIP] :=
+ (.T (⟨0, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SKIP, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SKIP))
+ (.terminal (G := grammarInst) (⟨Tok.SKIP, span⟩))
/-- Terminal parse tree for `IF` with its concrete grammar index. -/
-noncomputable def parseTreeTokenIF :
+noncomputable def parseTreeTokenIF
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [Tok.IF] :=
+ (.T (⟨1, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.IF, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.IF))
+ (.terminal (G := grammarInst) (⟨Tok.IF, span⟩))
/-- Terminal parse tree for `THEN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTHEN :
+noncomputable def parseTreeTokenTHEN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [Tok.THEN] :=
+ (.T (⟨2, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.THEN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.THEN))
+ (.terminal (G := grammarInst) (⟨Tok.THEN, span⟩))
/-- Terminal parse tree for `ELSE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenELSE :
+noncomputable def parseTreeTokenELSE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ELSE] :=
+ (.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ELSE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ELSE))
+ (.terminal (G := grammarInst) (⟨Tok.ELSE, span⟩))
/-- Terminal parse tree for `WHILE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenWHILE :
+noncomputable def parseTreeTokenWHILE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [Tok.WHILE] :=
+ (.T (⟨4, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.WHILE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.WHILE))
+ (.terminal (G := grammarInst) (⟨Tok.WHILE, span⟩))
/-- Terminal parse tree for `DO` with its concrete grammar index. -/
-noncomputable def parseTreeTokenDO :
+noncomputable def parseTreeTokenDO
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [Tok.DO] :=
+ (.T (⟨5, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.DO, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.DO))
+ (.terminal (G := grammarInst) (⟨Tok.DO, span⟩))
/-- Terminal parse tree for `TRUE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTRUE :
+noncomputable def parseTreeTokenTRUE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨6, of_decide_eq_true rfl⟩ : Terminal)) [Tok.TRUE] :=
+ (.T (⟨6, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.TRUE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.TRUE))
+ (.terminal (G := grammarInst) (⟨Tok.TRUE, span⟩))
/-- Terminal parse tree for `FALSE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenFALSE :
+noncomputable def parseTreeTokenFALSE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [Tok.FALSE] :=
+ (.T (⟨7, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.FALSE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.FALSE))
+ (.terminal (G := grammarInst) (⟨Tok.FALSE, span⟩))
/-- Terminal parse tree for `NOT` with its concrete grammar index. -/
-noncomputable def parseTreeTokenNOT :
+noncomputable def parseTreeTokenNOT
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨8, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NOT] :=
+ (.T (⟨8, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NOT, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NOT))
+ (.terminal (G := grammarInst) (⟨Tok.NOT, span⟩))
/-- Terminal parse tree for `AND` with its concrete grammar index. -/
-noncomputable def parseTreeTokenAND :
+noncomputable def parseTreeTokenAND
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨9, of_decide_eq_true rfl⟩ : Terminal)) [Tok.AND] :=
+ (.T (⟨9, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.AND, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.AND))
+ (.terminal (G := grammarInst) (⟨Tok.AND, span⟩))
/-- Terminal parse tree for `ASSIGN` with its concrete grammar index. -/
-noncomputable def parseTreeTokenASSIGN :
+noncomputable def parseTreeTokenASSIGN
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨10, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ASSIGN] :=
+ (.T (⟨10, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ASSIGN, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ASSIGN))
+ (.terminal (G := grammarInst) (⟨Tok.ASSIGN, span⟩))
/-- Terminal parse tree for `SEMI` with its concrete grammar index. -/
-noncomputable def parseTreeTokenSEMI :
+noncomputable def parseTreeTokenSEMI
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨11, of_decide_eq_true rfl⟩ : Terminal)) [Tok.SEMI] :=
+ (.T (⟨11, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.SEMI, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.SEMI))
+ (.terminal (G := grammarInst) (⟨Tok.SEMI, span⟩))
/-- Terminal parse tree for `LPAR` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLPAR :
+noncomputable def parseTreeTokenLPAR
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨12, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LPAR] :=
+ (.T (⟨12, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LPAR, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LPAR))
+ (.terminal (G := grammarInst) (⟨Tok.LPAR, span⟩))
/-- Terminal parse tree for `RPAR` with its concrete grammar index. -/
-noncomputable def parseTreeTokenRPAR :
+noncomputable def parseTreeTokenRPAR
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨13, of_decide_eq_true rfl⟩ : Terminal)) [Tok.RPAR] :=
+ (.T (⟨13, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.RPAR, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.RPAR))
+ (.terminal (G := grammarInst) (⟨Tok.RPAR, span⟩))
/-- Terminal parse tree for `PLUS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenPLUS :
+noncomputable def parseTreeTokenPLUS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨14, of_decide_eq_true rfl⟩ : Terminal)) [Tok.PLUS] :=
+ (.T (⟨14, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.PLUS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.PLUS))
+ (.terminal (G := grammarInst) (⟨Tok.PLUS, span⟩))
/-- Terminal parse tree for `MINUS` with its concrete grammar index. -/
-noncomputable def parseTreeTokenMINUS :
+noncomputable def parseTreeTokenMINUS
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨15, of_decide_eq_true rfl⟩ : Terminal)) [Tok.MINUS] :=
+ (.T (⟨15, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.MINUS, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.MINUS))
+ (.terminal (G := grammarInst) (⟨Tok.MINUS, span⟩))
/-- Terminal parse tree for `TIMES` with its concrete grammar index. -/
-noncomputable def parseTreeTokenTIMES :
+noncomputable def parseTreeTokenTIMES
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨16, of_decide_eq_true rfl⟩ : Terminal)) [Tok.TIMES] :=
+ (.T (⟨16, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.TIMES, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.TIMES))
+ (.terminal (G := grammarInst) (⟨Tok.TIMES, span⟩))
/-- Terminal parse tree for `LE` with its concrete grammar index. -/
-noncomputable def parseTreeTokenLE :
+noncomputable def parseTreeTokenLE
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨17, of_decide_eq_true rfl⟩ : Terminal)) [Tok.LE] :=
+ (.T (⟨17, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.LE, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.LE))
+ (.terminal (G := grammarInst) (⟨Tok.LE, span⟩))
/-- Terminal parse tree for `EQ` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEQ :
+noncomputable def parseTreeTokenEQ
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨18, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EQ] :=
+ (.T (⟨18, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EQ, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EQ))
+ (.terminal (G := grammarInst) (⟨Tok.EQ, span⟩))
/-- Terminal parse tree for `ID` with its concrete grammar index. -/
noncomputable def parseTreeTokenID
- (value : String) :
+ (value : String)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨19, of_decide_eq_true rfl⟩ : Terminal)) [Tok.ID value] :=
+ (.T (⟨19, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.ID value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.ID value))
+ (.terminal (G := grammarInst) (⟨Tok.ID value, span⟩))
/-- Terminal parse tree for `NUM` with its concrete grammar index. -/
noncomputable def parseTreeTokenNUM
- (value : Int) :
+ (value : Int)
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨20, of_decide_eq_true rfl⟩ : Terminal)) [Tok.NUM value] :=
+ (.T (⟨20, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.NUM value, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.NUM value))
+ (.terminal (G := grammarInst) (⟨Tok.NUM value, span⟩))
/-- Terminal parse tree for `EOF` with its concrete grammar index. -/
-noncomputable def parseTreeTokenEOF :
+noncomputable def parseTreeTokenEOF
+ (span : Runtime.Span := Runtime.Span.dummy) :
Grammar.ParseTree (G := grammarInst)
- (.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) [Tok.EOF] :=
+ (.T (⟨22, of_decide_eq_true rfl⟩ : Terminal)) [(⟨Tok.EOF, span⟩ : Runtime.Positioned Tok)] :=
Runtime.castPT (G := grammarInst) (by with_unfolding_all rfl)
- (.terminal (G := grammarInst) (Tok.EOF))
+ (.terminal (G := grammarInst) (⟨Tok.EOF, span⟩))
/-- Parse-tree constructor for production 0, in source RHS order. -/
noncomputable def parseTreeProduction0
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.SEMI] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenSEMI))) (tree2))
+ ((word0 ++ [Tok.SEMI] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨0, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenSEMI))) (tree2)))
@[simp] theorem parseTreeProduction0_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction0 tree0 tree2) = semanticAction0 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction0 tree0 tree2) = semanticAction0 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenSEMI))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.SEMI)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction0
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 1, in source RHS order. -/
noncomputable def parseTreeProduction1
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨1, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction1_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction1 tree0) = semanticAction1 (Grammar.ptSem tree0) := by
+ (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction1 tree0) = semanticAction1 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction1
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 2, in source RHS order. -/
noncomputable def parseTreeProduction2 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.SKIP]) :=
- .nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSKIP)))
+ (([Tok.SKIP]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨2, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenSKIP))))
-@[simp] theorem parseTreeProduction2_sem :
- Grammar.ptSem (parseTreeProduction2) = semanticAction2 (()) := by
+@[simp] theorem parseTreeProduction2_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction2) = semanticAction2 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenSKIP)))) (()) := by
unfold parseTreeProduction2
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 3, in source RHS order. -/
@@ -603,366 +637,400 @@ noncomputable def parseTreeProduction3
(value0 : String)
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ID value0] ++ [Tok.ASSIGN] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenID value0))) ((parseTreeTokenASSIGN))) (tree2))
+ (([Tok.ID value0] ++ [Tok.ASSIGN] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨3, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenID value0))) ((parseTreeTokenASSIGN))) (tree2)))
@[simp] theorem parseTreeProduction3_sem
(value0 : String)
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction3 value0 tree2) = semanticAction3 (Grammar.ptSem tree2) (()) (value0) := by
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction3 value0 tree2) = semanticAction3 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenID value0))) ((parseTreeTokenASSIGN))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.ID value0)] ++ [Runtime.Positioned.dummy (Tok.ASSIGN)])) tree2) (()) (value0) := by
unfold parseTreeProduction3
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 4, in source RHS order. -/
noncomputable def parseTreeProduction4
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word8 : List Tok}
(tree8 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word8) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word8.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.IF] ++ word1 ++ [Tok.THEN] ++ [Tok.LPAR] ++ word4 ++ [Tok.RPAR] ++ [Tok.ELSE] ++ [Tok.LPAR] ++ word8 ++ [Tok.RPAR]) :=
- .nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) (tree1)) ((parseTreeTokenTHEN))) ((parseTreeTokenLPAR))) (tree4)) ((parseTreeTokenRPAR))) ((parseTreeTokenELSE))) ((parseTreeTokenLPAR))) (tree8)) ((parseTreeTokenRPAR)))
+ (([Tok.IF] ++ word1 ++ [Tok.THEN] ++ [Tok.LPAR] ++ word4 ++ [Tok.RPAR] ++ [Tok.ELSE] ++ [Tok.LPAR] ++ word8 ++ [Tok.RPAR]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨4, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) (tree1)) ((parseTreeTokenTHEN))) ((parseTreeTokenLPAR))) (tree4)) ((parseTreeTokenRPAR))) ((parseTreeTokenELSE))) ((parseTreeTokenLPAR))) (tree8)) ((parseTreeTokenRPAR))))
@[simp] theorem parseTreeProduction4_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word4)
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
{word8 : List Tok}
(tree8 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word8) :
- Grammar.ptSem (parseTreeProduction4 tree1 tree4 tree8) = semanticAction4 (()) (Grammar.ptSem tree8) (()) (()) (()) (Grammar.ptSem tree4) (()) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word8.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction4 tree1 tree4 tree8) = semanticAction4 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenIF))) (tree1)) ((parseTreeTokenTHEN))) ((parseTreeTokenLPAR))) (tree4)) ((parseTreeTokenRPAR))) ((parseTreeTokenELSE))) ((parseTreeTokenLPAR))) (tree8)) ((parseTreeTokenRPAR)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.THEN)] ++ [Runtime.Positioned.dummy (Tok.LPAR)] ++ word4.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.RPAR)] ++ [Runtime.Positioned.dummy (Tok.ELSE)] ++ [Runtime.Positioned.dummy (Tok.LPAR)])) tree8) (()) (()) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.THEN)] ++ [Runtime.Positioned.dummy (Tok.LPAR)])) tree4) (()) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.IF)])) tree1) (()) := by
unfold parseTreeProduction4
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 5, in source RHS order. -/
noncomputable def parseTreeProduction5
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.WHILE] ++ word1 ++ [Tok.DO] ++ [Tok.LPAR] ++ word4 ++ [Tok.RPAR]) :=
- .nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenWHILE))) (tree1)) ((parseTreeTokenDO))) ((parseTreeTokenLPAR))) (tree4)) ((parseTreeTokenRPAR)))
+ (([Tok.WHILE] ++ word1 ++ [Tok.DO] ++ [Tok.LPAR] ++ word4 ++ [Tok.RPAR]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨5, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenWHILE))) (tree1)) ((parseTreeTokenDO))) ((parseTreeTokenLPAR))) (tree4)) ((parseTreeTokenRPAR))))
@[simp] theorem parseTreeProduction5_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1)
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
{word4 : List Tok}
(tree4 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word4) :
- Grammar.ptSem (parseTreeProduction5 tree1 tree4) = semanticAction5 (()) (Grammar.ptSem tree4) (()) (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word4.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction5 tree1 tree4) = semanticAction5 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.cons (.cons (.cons (.nil) ((parseTreeTokenWHILE))) (tree1)) ((parseTreeTokenDO))) ((parseTreeTokenLPAR))) (tree4)) ((parseTreeTokenRPAR)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.WHILE)] ++ word1.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.DO)] ++ [Runtime.Positioned.dummy (Tok.LPAR)])) tree4) (()) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.WHILE)])) tree1) (()) := by
unfold parseTreeProduction5
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 6, in source RHS order. -/
noncomputable def parseTreeProduction6
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.AND] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenAND))) (tree2))
+ ((word0 ++ [Tok.AND] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨6, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenAND))) (tree2)))
@[simp] theorem parseTreeProduction6_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction6 tree0 tree2) = semanticAction6 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction6 tree0 tree2) = semanticAction6 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenAND))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.AND)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction6
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 7, in source RHS order. -/
noncomputable def parseTreeProduction7
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨7, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction7_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction7 tree0) = semanticAction7 (Grammar.ptSem tree0) := by
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction7 tree0) = semanticAction7 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction7
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 8, in source RHS order. -/
noncomputable def parseTreeProduction8 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.TRUE]) :=
- .nonTerminal (G := grammarInst) (⟨8, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTRUE)))
+ (([Tok.TRUE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨8, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenTRUE))))
-@[simp] theorem parseTreeProduction8_sem :
- Grammar.ptSem (parseTreeProduction8) = semanticAction8 (()) := by
+@[simp] theorem parseTreeProduction8_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction8) = semanticAction8 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenTRUE)))) (()) := by
unfold parseTreeProduction8
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 9, in source RHS order. -/
noncomputable def parseTreeProduction9 :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.FALSE]) :=
- .nonTerminal (G := grammarInst) (⟨9, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFALSE)))
+ (([Tok.FALSE]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨9, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenFALSE))))
-@[simp] theorem parseTreeProduction9_sem :
- Grammar.ptSem (parseTreeProduction9) = semanticAction9 (()) := by
+@[simp] theorem parseTreeProduction9_sem
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction9) = semanticAction9 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenFALSE)))) (()) := by
unfold parseTreeProduction9
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 10, in source RHS order. -/
noncomputable def parseTreeProduction10
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NOT] ++ word1) :=
- .nonTerminal (G := grammarInst) (⟨10, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenNOT))) (tree1))
+ (([Tok.NOT] ++ word1).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨10, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) ((parseTreeTokenNOT))) (tree1)))
@[simp] theorem parseTreeProduction10_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction10 tree1) = semanticAction10 (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction10 tree1) = semanticAction10 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) ((parseTreeTokenNOT))) (tree1))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.NOT)])) tree1) (()) := by
unfold parseTreeProduction10
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 11, in source RHS order. -/
noncomputable def parseTreeProduction11
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.LE] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨11, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLE))) (tree2))
+ ((word0 ++ [Tok.LE] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨11, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLE))) (tree2)))
@[simp] theorem parseTreeProduction11_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction11 tree0 tree2) = semanticAction11 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction11 tree0 tree2) = semanticAction11 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenLE))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.LE)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction11
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 12, in source RHS order. -/
noncomputable def parseTreeProduction12
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.EQ] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨12, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEQ))) (tree2))
+ ((word0 ++ [Tok.EQ] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨12, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEQ))) (tree2)))
@[simp] theorem parseTreeProduction12_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction12 tree0 tree2) = semanticAction12 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction12 tree0 tree2) = semanticAction12 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEQ))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.EQ)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction12
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 13, in source RHS order. -/
noncomputable def parseTreeProduction13
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LPAR] ++ word1 ++ [Tok.RPAR]) :=
- .nonTerminal (G := grammarInst) (⟨13, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR)))
+ (([Tok.LPAR] ++ word1 ++ [Tok.RPAR]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨13, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR))))
@[simp] theorem parseTreeProduction13_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction13 tree1) = semanticAction13 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction13 tree1) = semanticAction13 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LPAR)])) tree1) (()) := by
unfold parseTreeProduction13
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 14, in source RHS order. -/
noncomputable def parseTreeProduction14
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.PLUS] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨14, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenPLUS))) (tree2))
+ ((word0 ++ [Tok.PLUS] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨14, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenPLUS))) (tree2)))
@[simp] theorem parseTreeProduction14_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction14 tree0 tree2) = semanticAction14 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction14 tree0 tree2) = semanticAction14 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenPLUS))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.PLUS)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction14
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 15, in source RHS order. -/
noncomputable def parseTreeProduction15
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.MINUS] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨15, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenMINUS))) (tree2))
+ ((word0 ++ [Tok.MINUS] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨15, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenMINUS))) (tree2)))
@[simp] theorem parseTreeProduction15_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction15 tree0 tree2) = semanticAction15 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction15 tree0 tree2) = semanticAction15 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenMINUS))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.MINUS)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction15
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 16, in source RHS order. -/
noncomputable def parseTreeProduction16
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨16, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨16, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction16_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction16 tree0) = semanticAction16 (Grammar.ptSem tree0) := by
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction16 tree0) = semanticAction16 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction16
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 17, in source RHS order. -/
noncomputable def parseTreeProduction17
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.TIMES] ++ word2) :=
- .nonTerminal (G := grammarInst) (⟨17, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenTIMES))) (tree2))
+ ((word0 ++ [Tok.TIMES] ++ word2).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨17, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenTIMES))) (tree2)))
@[simp] theorem parseTreeProduction17_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) word0)
+ (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
{word2 : List Tok}
(tree2 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word2) :
- Grammar.ptSem (parseTreeProduction17 tree0 tree2) = semanticAction17 (Grammar.ptSem tree2) (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word2.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction17 tree0 tree2) = semanticAction17 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) (tree0)) ((parseTreeTokenTIMES))) (tree2))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ word0.map Runtime.Positioned.dummy ++ [Runtime.Positioned.dummy (Tok.TIMES)])) tree2) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction17
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 18, in source RHS order. -/
noncomputable def parseTreeProduction18
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0) :=
- .nonTerminal (G := grammarInst) (⟨18, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0))
+ ((word0).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨18, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) (tree0)))
@[simp] theorem parseTreeProduction18_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction18 tree0) = semanticAction18 (Grammar.ptSem tree0) := by
+ (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction18 tree0) = semanticAction18 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) (tree0))) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction18
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 19, in source RHS order. -/
noncomputable def parseTreeProduction19
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.LPAR] ++ word1 ++ [Tok.RPAR]) :=
- .nonTerminal (G := grammarInst) (⟨19, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR)))
+ (([Tok.LPAR] ++ word1 ++ [Tok.RPAR]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨19, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR))))
@[simp] theorem parseTreeProduction19_sem
{word1 : List Tok}
(tree1 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) word1) :
- Grammar.ptSem (parseTreeProduction19 tree1) = semanticAction19 (()) (Grammar.ptSem tree1) (()) := by
+ (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal)) (word1.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction19 tree1) = semanticAction19 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.cons (.nil) ((parseTreeTokenLPAR))) (tree1)) ((parseTreeTokenRPAR)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)) ++ [Runtime.Positioned.dummy (Tok.LPAR)])) tree1) (()) := by
unfold parseTreeProduction19
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 20, in source RHS order. -/
@@ -970,14 +1038,16 @@ noncomputable def parseTreeProduction20
(value0 : String) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.ID value0]) :=
- .nonTerminal (G := grammarInst) (⟨20, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenID value0)))
+ (([Tok.ID value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨20, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenID value0))))
@[simp] theorem parseTreeProduction20_sem
- (value0 : String) :
- Grammar.ptSem (parseTreeProduction20 value0) = semanticAction20 (value0) := by
+ (value0 : String)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction20 value0) = semanticAction20 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenID value0)))) (value0) := by
unfold parseTreeProduction20
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 21, in source RHS order. -/
@@ -985,33 +1055,37 @@ noncomputable def parseTreeProduction21
(value0 : Int) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))
- ([Tok.NUM value0]) :=
- .nonTerminal (G := grammarInst) (⟨21, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNUM value0)))
+ (([Tok.NUM value0]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨21, of_decide_eq_true rfl⟩ : Production) (.cons (.nil) ((parseTreeTokenNUM value0))))
@[simp] theorem parseTreeProduction21_sem
- (value0 : Int) :
- Grammar.ptSem (parseTreeProduction21 value0) = semanticAction21 (value0) := by
+ (value0 : Int)
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction21 value0) = semanticAction21 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.nil) ((parseTreeTokenNUM value0)))) (value0) := by
unfold parseTreeProduction21
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
/-- Parse-tree constructor for production 22, in source RHS order. -/
noncomputable def parseTreeProduction22
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy)) :
Grammar.ParseTree (G := grammarInst)
(.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))
- (word0 ++ [Tok.EOF]) :=
- .nonTerminal (G := grammarInst) (⟨22, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))
+ ((word0 ++ [Tok.EOF]).map Runtime.Positioned.dummy) :=
+ SpanGrammar.castWord (SG := spanGrammarInst) (by simp)
+ (.nonTerminal (G := grammarInst) (⟨22, of_decide_eq_true rfl⟩ : Production) (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF))))
@[simp] theorem parseTreeProduction22_sem
{word0 : List Tok}
(tree0 : Grammar.ParseTree (G := grammarInst)
- (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) word0) :
- Grammar.ptSem (parseTreeProduction22 tree0) = semanticAction22 (()) (Grammar.ptSem tree0) := by
+ (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal)) (word0.map Runtime.Positioned.dummy))
+ (pe : String.Pos.Raw) :
+ SpanGrammar.ptSem pe (parseTreeProduction22 tree0) = semanticAction22 (SpanGrammar.ptlSpans (SG := spanGrammarInst) pe (.cons (.cons (.nil) (tree0)) ((parseTreeTokenEOF)))) (()) (SpanGrammar.ptSem (Runtime.Positioned.wordEnd pe (([] : List (Runtime.Positioned Tok)))) tree0) := by
unfold parseTreeProduction22
- erw [Grammar.ptSem_nonTerminal, Grammar.ptlSem_cons, Grammar.ptlSem_cons, Grammar.ptlSem_nil]
+ erw [SpanGrammar.ptSem_castWord, SpanGrammar.ptSem_nonTerminal, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_cons, SpanGrammar.ptlSem_nil]
with_unfolding_all rfl
@@ -1560,207 +1634,207 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Com :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Com :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : ImpParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : ImpParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))))))) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))))))) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- ImpParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ ImpParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- ImpParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ ImpParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨n + 23, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨n + 23, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -1867,17 +1941,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- ImpParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ ImpParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) ImpParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) ImpParser.V := {
table := ImpParser.table
- decode := fun t => ImpParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := ImpParser.semV
+ decode := ImpParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -1922,13 +1998,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change ImpParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change ImpParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -1936,21 +2013,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (ImpParser.run input logNSteps) := by
+ have hrun : ImpParser.run input logNSteps
= Runtime.Exec.run ImpParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [ImpParser.run]
rw [Runtime.Exec.runFast_eq_run ImpParser.stackOps ImpParser.flat ImpParser.fuse
ImpParser.termOf ImpParser.valOf ImpParser.stackLawful ImpParser.fuseOK]
- simp only [ImpParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- ImpParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ ImpParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold ImpParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -1958,49 +2035,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : ImpParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Com)
- (accepted : ImpParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : ImpParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (ImpParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (ImpParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : ImpParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -2009,7 +2088,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- ImpParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ ImpParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -2025,13 +2104,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- ImpParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ ImpParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -2041,14 +2122,20 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
end ImpVerified
diff --git a/test/rustactions/RustactionsLexer.lean b/test/rustactions/RustactionsLexer.lean
index 7480294..2666539 100644
--- a/test/rustactions/RustactionsLexer.lean
+++ b/test/rustactions/RustactionsLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
public import rustactions.RustActionsAst
@@ -219,9 +223,93 @@ theorem RustactionsLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees RustactionsLexer.fastActs RustactionsLexer.cbyte.flat.base.acts :=
RustactionsLexer.fastActs_agree
-theorem RustactionsLexer.byteValidated0 :
- Lexer.byteValidate (RustactionsLexer.cbyte.bytes.getD 0 default)
- (RustactionsLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def RustactionsLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte RustactionsLexer.cbyte input
+
+theorem RustactionsLexer.byteUnicodeValidated : Lexer.byteValidAll RustactionsLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem RustactionsLexer.posLexerAgrees : Lexer.PosLexerAgrees RustactionsLexer.cbyte RustactionsLexer.tokenize := by
+ intro s
+ rw [RustactionsLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll RustactionsLexer.cbyte RustactionsLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem RustactionsLexer.tokenizeByte_toOption (s : String) :
+ (RustactionsLexer.tokenizeByte s).toOption = (RustactionsLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption RustactionsLexer.cbyte RustactionsLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem RustactionsLexer.noEofEmit :
+ ∀ m r, (RustactionsLexer.fastActs.get m r).emit = true → ∀ s, (RustactionsLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL RustactionsLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (by intro h; cases h) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) Lexer.AllL.nil)))))))))))))))))))
+ Lexer.AllL.nil)
+
+theorem RustactionsLexer.stay0 : ∀ r, (RustactionsLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL RustactionsLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil))))))))))))))))))) Lexer.AllL.nil) 0
+
+theorem RustactionsLexer.textIndep0 : ∀ r, RustactionsLexer.cflat.needsText 0 r = false →
+ ∀ s, (RustactionsLexer.fastActs.get 0 r).toAct s = (RustactionsLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ RustactionsLexer.fastActs (RustactionsLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons nofun Lexer.Forall₂.nil)))))))))))))))))))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem RustactionsLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : RustactionsLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization RustactionsLexer.rules0 input.toList ∧
+ Lexer.tokenize RustactionsLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound RustactionsLexer.cflat RustactionsLexer.fastActs RustactionsLexer.fastActs_agree
+ RustactionsLexer.validated0 rfl RustactionsLexer.flatValidated0 (by decide) RustactionsLexer.stay0
+ RustactionsLexer.textIndep0 (by rw [← RustactionsLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem RustactionsLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing RustactionsLexer.rules0 input.toList steps) :
+ ∃ ts, RustactionsLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens RustactionsLexer.lexer RustactionsLexer.lexer.start input.toList steps := by
+ rw [RustactionsLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete RustactionsLexer.cflat RustactionsLexer.fastActs RustactionsLexer.fastActs_agree
+ RustactionsLexer.validated0 rfl RustactionsLexer.flatValidated0 (by decide) RustactionsLexer.stay0
+ RustactionsLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev RustactionsLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing RustactionsLexer.rules0 (Lexer.modeAct RustactionsLexer.lexer RustactionsLexer.lexer.start)
+ RustactionsLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem RustactionsLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ RustactionsLexer.tokenize s = .ok ts ↔ RustactionsLexer.Lexes s ts := by
+ rw [RustactionsLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' RustactionsLexer.cflat RustactionsLexer.fastActs
+ RustactionsLexer.fastActs_agree RustactionsLexer.validated0 rfl RustactionsLexer.flatValidated0 (by decide)
+ RustactionsLexer.stay0 RustactionsLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem RustactionsLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos RustactionsLexer.cbyte s = .ok ts ↔ RustactionsLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff RustactionsLexer.posLexerAgrees s ts).trans (RustactionsLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem RustactionsLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : RustactionsLexer.Lexes s ts₁) (h₂ : RustactionsLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem RustactionsLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : RustactionsLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees RustactionsLexer.lexer RustactionsLexer.fastActs RustactionsLexer.fastActs_agree
+ _ RustactionsLexer.noEofEmit _) h
diff --git a/test/rustactions/RustactionsParser.lean b/test/rustactions/RustactionsParser.lean
index 47d405b..5c7b2b4 100644
--- a/test/rustactions/RustactionsParser.lean
+++ b/test/rustactions/RustactionsParser.lean
@@ -85,36 +85,39 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def sem : Nat → List VP → VP
- | 0, [(ss_span, .v1 ss)] => (ss_span, .v0 (Program.mk ss 7))
- | 1, [(s_span, .v2 s), (__s1, _), (rest_span, .v1 rest)] => (Runtime.Span.merge s_span rest_span, .v1 (s :: rest))
- | 2, [] => (Runtime.Span.dummy, .v1 ([]))
- | 3, [(__s0, _), (x_span, .v5 x), (__s2, _), (e_span, .v3 e)] => (Runtime.Span.merge __s0 e_span, .v2 (Stmt.bind { name := x, value := e, index := 1 }))
- | 4, [(__s0, _), (e_span, .v3 e)] => (Runtime.Span.merge __s0 e_span, .v2 (Stmt.print e))
- | 5, [(__s0, _), (c_span, .v3 c), (__s2, _), (t_span, .v3 t), (__s4, _), (e_span, .v3 e)] => (Runtime.Span.merge __s0 e_span, .v3 (Expr.cond c t (some e)))
- | 6, [(__s0, _), (c_span, .v3 c), (__s2, _), (t_span, .v3 t)] => (Runtime.Span.merge __s0 t_span, .v3 (Expr.cond c t none))
- | 7, [(e_span, .v3 e)] => (e_span, .v3 (e))
- | 8, [(a_span, .v3 a), (__s1, _), (b_span, .v3 b)] => (Runtime.Span.merge a_span b_span, .v3 (Expr.bin .add a b))
- | 9, [(a_span, .v3 a), (__s1, _), (b_span, .v3 b)] => (Runtime.Span.merge a_span b_span, .v3 (Expr.bin .sub a b))
- | 10, [(a_span, .v3 a)] => (a_span, .v3 (a))
- | 11, [(a_span, .v3 a), (__s1, _), (b_span, .v3 b)] => (Runtime.Span.merge a_span b_span, .v3 (Expr.bin .mul a b))
- | 12, [(a_span, .v3 a)] => (a_span, .v3 (a))
- | 13, [(n_span, .v6 n)] => (n_span, .v3 (Expr.num n))
- | 14, [(__s0, _), (a_span, .v3 a)] => (Runtime.Span.merge __s0 a_span, .v3 (Expr.neg a))
- | 15, [(x_span, .v5 x)] => (x_span, .v3 (Expr.var x))
- | 16, [(x_span, .v5 x), (__s1, _)] => (Runtime.Span.merge x_span __s1, .v3 (Expr.located x x_span))
- | 17, [(s_span, .v5 s)] => (s_span, .v3 (Expr.str s))
- | 18, [(s_span, .v5 s), (__s1, _)] => (Runtime.Span.merge s_span __s1, .v3 (Expr.len s.length))
- | 19, [(f_span, .v5 f), (__s1, _), (args_span, .v4 args), (__s3, _)] => (Runtime.Span.merge f_span __s3, .v3 (Expr.call f args))
- | 20, [(__s0, _), (a_span, .v3 a), (__s2, _), (b_span, .v3 b), (__s4, _)] => (Runtime.Span.merge __s0 __s4, .v3 (Expr.pair (a, b)))
- | 21, [(__s0, _), (a_span, .v3 a), (__s2, _), (b_span, .v3 b), (__s4, _), (c_span, .v3 c), (__s6, _)] => (Runtime.Span.merge __s0 __s6, .v3 (Expr.triple (a, b, c)))
- | 22, [(__s0, _), (e_span, .v3 e), (__s2, _)] => (Runtime.Span.merge __s0 __s2, .v3 (e))
- | 23, [(xs_span, .v4 xs)] => (xs_span, .v4 (xs))
- | 24, [(xs_span, .v4 xs), (x_span, .v3 x)] => (Runtime.Span.merge xs_span x_span, .v4 (xs.push x))
- | 25, [] => (Runtime.Span.dummy, .v4 (#[]))
- | 26, [(xs_span, .v4 xs), (x_span, .v3 x), (__s2, _)] => (Runtime.Span.merge xs_span __s2, .v4 (xs.push x))
- | 27, [x, _] => x
- | _, _ => (Runtime.Span.dummy, .unit ())
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, _, [.v1 ss] => .v0 (Program.mk ss 7)
+ | 1, _, [.v2 s, _, .v1 rest] => .v1 (s :: rest)
+ | 2, _, [] => .v1 ([])
+ | 3, _, [_, .v5 x, _, .v3 e] => .v2 (Stmt.bind { name := x, value := e, index := 1 })
+ | 4, _, [_, .v3 e] => .v2 (Stmt.print e)
+ | 5, _, [_, .v3 c, _, .v3 t, _, .v3 e] => .v3 (Expr.cond c t (some e))
+ | 6, _, [_, .v3 c, _, .v3 t] => .v3 (Expr.cond c t none)
+ | 7, _, [.v3 e] => .v3 (e)
+ | 8, _, [.v3 a, _, .v3 b] => .v3 (Expr.bin .add a b)
+ | 9, _, [.v3 a, _, .v3 b] => .v3 (Expr.bin .sub a b)
+ | 10, _, [.v3 a] => .v3 (a)
+ | 11, _, [.v3 a, _, .v3 b] => .v3 (Expr.bin .mul a b)
+ | 12, _, [.v3 a] => .v3 (a)
+ | 13, _, [.v6 n] => .v3 (Expr.num n)
+ | 14, _, [_, .v3 a] => .v3 (Expr.neg a)
+ | 15, _, [.v5 x] => .v3 (Expr.var x)
+ | 16, __spans, [.v5 x, _] => let x_span : Runtime.Span := __spans.getD 0 Runtime.Span.dummy; .v3 (Expr.located x x_span)
+ | 17, _, [.v5 s] => .v3 (Expr.str s)
+ | 18, _, [.v5 s, _] => .v3 (Expr.len s.length)
+ | 19, _, [.v5 f, _, .v4 args, _] => .v3 (Expr.call f args)
+ | 20, _, [_, .v3 a, _, .v3 b, _] => .v3 (Expr.pair (a, b))
+ | 21, _, [_, .v3 a, _, .v3 b, _, .v3 c, _] => .v3 (Expr.triple (a, b, c))
+ | 22, _, [_, .v3 e, _] => .v3 (e)
+ | 23, _, [.v4 xs] => .v4 (xs)
+ | 24, _, [.v4 xs, .v3 x] => .v4 (xs.push x)
+ | 25, _, [] => .v4 (#[])
+ | 26, _, [.v4 xs, .v3 x, _] => .v4 (xs.push x)
+ | 27, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -173,6 +176,38 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .c5 st _ _ _ _ => st
| .c6 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+ | .c1 _ _ e _ _ => e
+ | .c2 _ _ e _ _ => e
+ | .c3 _ _ e _ _ => e
+ | .c4 _ _ e _ _ => e
+ | .c5 _ _ e _ _ => e
+ | .c6 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+ | .c1 st _ e _ _ => k st e
+ | .c2 st _ e _ _ => k st e
+ | .c3 st _ e _ _ => k st e
+ | .c4 st _ e _ _ => k st e
+ | .c5 st _ e _ _ => k st e
+ | .c6 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -225,6 +260,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.shift 3, .shift 4, .error, .error, .error, .error, .error, .error, .error, .error, .error, .error, .error,
@@ -361,7 +397,7 @@ def fuse1 : Stk → Stk :=
| _ => .fail stk
def fuse2 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 10 1 (Stk.top 0 __tail) (fun __st => .c1 __st ⟨0⟩ ⟨0⟩ ([]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 10 1 __top (fun __st => .c1 __st __e __e ([]) __tail) (fun _ => .fail __tail))
def fuse3 : Stk → Stk :=
fun stk => match stk with
@@ -474,7 +510,7 @@ def fuse24 : Stk → Stk :=
| _ => .fail stk
def fuse25 : Stk → Stk :=
- fun __tail => Runtime.Exec.pushGotoWith gotoData 10 8 (Stk.top 0 __tail) (fun __st => .c4 __st ⟨0⟩ ⟨0⟩ (#[]) __tail) (fun _ => .fail __tail)
+ fun __tail => Stk.withTop 0 __tail (fun __top __e => Runtime.Exec.pushGotoWith gotoData 10 8 __top (fun __st => .c4 __st __e __e (#[]) __tail) (fun _ => .fail __tail))
def fuse26 : Stk → Stk :=
fun stk => match stk with
@@ -509,6 +545,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
@@ -530,9 +567,9 @@ theorem fuseOK1 : Runtime.Exec.FuseOKAt stackOps flat 1 fuse1 := by
theorem fuseOK2 : Runtime.Exec.FuseOKAt stackOps flat 2 fuse2 := by
intro stk
- unfold fuse2
+ simp only [fuse2, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 2
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 2
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK3 : Runtime.Exec.FuseOKAt stackOps flat 3 fuse3 := by
@@ -735,9 +772,9 @@ theorem fuseOK24 : Runtime.Exec.FuseOKAt stackOps flat 24 fuse24 := by
theorem fuseOK25 : Runtime.Exec.FuseOKAt stackOps flat 25 fuse25 := by
intro stk
- unfold fuse25
+ simp only [fuse25, Stk.withTop_eq]
· try dsimp only
- apply Runtime.Exec.fuseOKAt_of_pop stackLawful flat 25
+ apply Runtime.Exec.fuseOKAt_of_eps stackLawful flat 25
all_goals first | exact fun _ => rfl | rfl
theorem fuseOK26 : Runtime.Exec.FuseOKAt stackOps flat 26 fuse26 := by
diff --git a/test/rustactions/RustactionsVerified.lean b/test/rustactions/RustactionsVerified.lean
index 3cf8ad2..5290160 100644
--- a/test/rustactions/RustactionsVerified.lean
+++ b/test/rustactions/RustactionsVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -43,6 +45,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace RustactionsVerified
abbrev Terminal := Fin 19
@@ -149,38 +153,38 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 9
augmentedProduction := 27 }
-def semTbl : List (Σ T : Type, T → RustactionsParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(String : Type), fun v => (Runtime.Span.dummy, .v5 v)⟩,
- ⟨(Int : Type), fun v => (Runtime.Span.dummy, .v6 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Program : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Stmts : Type), fun v => (Runtime.Span.dummy, .v1 v)⟩,
- ⟨(Stmt : Type), fun v => (Runtime.Span.dummy, .v2 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Expr : Type), fun v => (Runtime.Span.dummy, .v3 v)⟩,
- ⟨(Array (Expr) : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Array (Expr) : Type), fun v => (Runtime.Span.dummy, .v4 v)⟩,
- ⟨(Program : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
-
-def semDefault : Σ T : Type, T → RustactionsParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semTbl : List (Σ T : Type, T → RustactionsParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(String : Type), fun v => .v5 v⟩,
+ ⟨(String : Type), fun v => .v5 v⟩,
+ ⟨(Int : Type), fun v => .v6 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Program : Type), fun v => .v0 v⟩,
+ ⟨(Stmts : Type), fun v => .v1 v⟩,
+ ⟨(Stmt : Type), fun v => .v2 v⟩,
+ ⟨(Expr : Type), fun v => .v3 v⟩,
+ ⟨(Expr : Type), fun v => .v3 v⟩,
+ ⟨(Expr : Type), fun v => .v3 v⟩,
+ ⟨(Expr : Type), fun v => .v3 v⟩,
+ ⟨(Array (Expr) : Type), fun v => .v4 v⟩,
+ ⟨(Array (Expr) : Type), fun v => .v4 v⟩,
+ ⟨(Program : Type), fun v => .v0 v⟩]
+
+def semDefault : Σ T : Type, T → RustactionsParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -189,94 +193,94 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (ss : Stmts) => (Program.mk ss 7)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (ss : Stmts) => (Program.mk ss 7)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (rest : Stmts) (_ : Unit) (s : Stmt) => (s :: rest)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (rest : Stmts) (_ : Unit) (s : Stmt) => (s :: rest)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- (([]) : Stmts)
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => (([]) : Stmts)
-def semanticAction3 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) (x : String) (_ : Unit) => (Stmt.bind { name := x, value := e, index := 1 })
+def semanticAction3 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨12, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩, Symbol.T ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) (x : String) (_ : Unit) => (Stmt.bind { name := x, value := e, index := 1 })
-def semanticAction4 : arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) => (Stmt.print e)
+def semanticAction4 : List Runtime.Span → arrowsRight (semT' (.NT (⟨2, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) => (Stmt.print e)
-def semanticAction5 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) (_ : Unit) (t : Expr) (_ : Unit) (c : Expr) (_ : Unit) => (Expr.cond c t (some e))
+def semanticAction5 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨4, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) (_ : Unit) (t : Expr) (_ : Unit) (c : Expr) (_ : Unit) => (Expr.cond c t (some e))
-def semanticAction6 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
- fun (t : Expr) (_ : Unit) (c : Expr) (_ : Unit) => (Expr.cond c t none)
+def semanticAction6 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩, Symbol.T ⟨2, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (t : Expr) (_ : Unit) (c : Expr) (_ : Unit) => (Expr.cond c t none)
-def semanticAction7 : arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (e : Expr) => (e)
+def semanticAction7 : List Runtime.Span → arrowsRight (semT' (.NT (⟨3, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (e : Expr) => (e)
-def semanticAction8 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : Expr) (_ : Unit) (a : Expr) => (Expr.bin .add a b)
+def semanticAction8 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨5, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : Expr) (_ : Unit) (a : Expr) => (Expr.bin .add a b)
-def semanticAction9 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : Expr) (_ : Unit) (a : Expr) => (Expr.bin .sub a b)
+def semanticAction9 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩, Symbol.NT ⟨4, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : Expr) (_ : Unit) (a : Expr) => (Expr.bin .sub a b)
-def semanticAction10 : arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Expr) => (a)
+def semanticAction10 : List Runtime.Span → arrowsRight (semT' (.NT (⟨4, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Expr) => (a)
-def semanticAction11 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
- fun (b : Expr) (_ : Unit) (a : Expr) => (Expr.bin .mul a b)
+def semanticAction11 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨7, of_decide_eq_true rfl⟩, Symbol.NT ⟨5, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (b : Expr) (_ : Unit) (a : Expr) => (Expr.bin .mul a b)
-def semanticAction12 : arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Expr) => (a)
+def semanticAction12 : List Runtime.Span → arrowsRight (semT' (.NT (⟨5, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Expr) => (a)
-def semanticAction13 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
- fun (n : Int) => (Expr.num n)
+def semanticAction13 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨16, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (n : Int) => (Expr.num n)
-def semanticAction14 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
- fun (a : Expr) (_ : Unit) => (Expr.neg a)
+def semanticAction14 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨6, of_decide_eq_true rfl⟩, Symbol.T ⟨6, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (a : Expr) (_ : Unit) => (Expr.neg a)
-def semanticAction15 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : String) => (Expr.var x)
+def semanticAction15 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : String) => (Expr.var x)
-def semanticAction16 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (x : String) => (Expr.located x x_span)
+def semanticAction16 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (__spans : List Runtime.Span) => let x_span : Runtime.Span := __spans.getD 0 Runtime.Span.dummy; fun (_ : Unit) (x : String) => (Expr.located x x_span)
-def semanticAction17 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (s : String) => (Expr.str s)
+def semanticAction17 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (s : String) => (Expr.str s)
-def semanticAction18 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (s : String) => (Expr.len s.length)
+def semanticAction18 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨13, of_decide_eq_true rfl⟩, Symbol.T ⟨15, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (s : String) => (Expr.len s.length)
-def semanticAction19 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (args : Array (Expr)) (_ : Unit) (f : String) => (Expr.call f args)
+def semanticAction19 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨7, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩, Symbol.T ⟨14, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (args : Array (Expr)) (_ : Unit) (f : String) => (Expr.call f args)
-def semanticAction20 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (b : Expr) (_ : Unit) (a : Expr) (_ : Unit) => (Expr.pair (a, b))
+def semanticAction20 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (b : Expr) (_ : Unit) (a : Expr) (_ : Unit) => (Expr.pair (a, b))
-def semanticAction21 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (c : Expr) (_ : Unit) (b : Expr) (_ : Unit) (a : Expr) (_ : Unit) => (Expr.triple (a, b, c))
+def semanticAction21 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (c : Expr) (_ : Unit) (b : Expr) (_ : Unit) (a : Expr) (_ : Unit) => (Expr.triple (a, b, c))
-def semanticAction22 : arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (e : Expr) (_ : Unit) => (e)
+def semanticAction22 : List Runtime.Span → arrowsRight (semT' (.NT (⟨6, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨9, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.T ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (e : Expr) (_ : Unit) => (e)
-def semanticAction23 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (xs : Array (Expr)) => (xs)
+def semanticAction23 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (xs : Array (Expr)) => (xs)
-def semanticAction24 : arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (x : Expr) (xs : Array (Expr)) => (xs.push x)
+def semanticAction24 : List Runtime.Span → arrowsRight (semT' (.NT (⟨7, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (x : Expr) (xs : Array (Expr)) => (xs.push x)
-def semanticAction25 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
- ((#[]) : Array (Expr))
+def semanticAction25 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([].map semT') :=
+ fun (_ : List Runtime.Span) => ((#[]) : Array (Expr))
-def semanticAction26 : arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (x : Expr) (xs : Array (Expr)) => (xs.push x)
+def semanticAction26 : List Runtime.Span → arrowsRight (semT' (.NT (⟨8, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨10, of_decide_eq_true rfl⟩, Symbol.NT ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨8, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (x : Expr) (xs : Array (Expr)) => (xs.push x)
-def semanticAction27 : arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction27 : List Runtime.Span → arrowsRight (semT' (.NT (⟨9, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨18, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.NT ⟨1, of_decide_eq_true rfl⟩, Symbol.T ⟨11, of_decide_eq_true rfl⟩, Symbol.NT ⟨2, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), []) semanticAction2
@@ -313,7 +317,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -383,13 +387,15 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
abbrev lastSymb' : NonInitState → Symbol Terminal NonTerminal
| s => match s with
| ⟨0, _⟩ => Symbol.NT ⟨1, of_decide_eq_true rfl⟩
@@ -893,247 +899,247 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Program :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Program :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : RustactionsParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : RustactionsParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees3 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 3 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨3, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 3 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨3, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees4 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 4 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨4, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 4 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨4, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees5 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 5 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨5, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 5 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
+ (values.apply (prodAction' (⟨5, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil)))))) => rfl
theorem refinementSemanticAgrees6 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 6 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨6, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 6 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨6, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees7 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 7 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨7, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 7 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨7, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees8 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 8 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨8, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 8 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨8, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees9 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 9 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨9, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 9 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨9, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees10 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 10 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨10, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 10 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨10, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees11 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 11 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨11, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 11 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨11, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees12 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 12 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨12, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 12 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨12, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees13 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 13 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨13, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 13 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨13, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees14 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 14 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨14, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 14 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨14, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees15 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 15 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨15, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 15 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨15, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees16 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 16 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨16, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 16 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨16, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees17 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 17 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨17, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 17 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨17, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees18 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 18 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨18, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 18 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨18, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees19 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 19 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨19, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 19 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
+ (values.apply (prodAction' (⟨19, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.nil)))) => rfl
theorem refinementSemanticAgrees20 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 20 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨20, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 20 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
+ (values.apply (prodAction' (⟨20, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))) => rfl
theorem refinementSemanticAgrees21 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 21 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨21, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 21 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
+ (values.apply (prodAction' (⟨21, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.cons _ (.nil))))))) => rfl
theorem refinementSemanticAgrees22 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 22 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨22, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 22 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨22, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees23 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 23 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨23, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 23 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨23, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees24 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 24 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨24, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 24 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨24, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees25 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 25 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨25, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 25 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production)))
- | .nil => rfl
+ (values.apply (prodAction' (⟨25, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .nil => rfl
theorem refinementSemanticAgrees26 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 26 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨26, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 26 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.cons _ (.nil))) => rfl
+ (values.apply (prodAction' (⟨26, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.cons _ (.nil))) => rfl
theorem refinementSemanticAgrees27 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
- RustactionsParser.table.sem 27 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨27, of_decide_eq_true rfl⟩ : Production))),
+ RustactionsParser.semV 27 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨27, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- RustactionsParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ RustactionsParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨3, _⟩, values => refinementSemanticAgrees3 values
- | ⟨4, _⟩, values => refinementSemanticAgrees4 values
- | ⟨5, _⟩, values => refinementSemanticAgrees5 values
- | ⟨6, _⟩, values => refinementSemanticAgrees6 values
- | ⟨7, _⟩, values => refinementSemanticAgrees7 values
- | ⟨8, _⟩, values => refinementSemanticAgrees8 values
- | ⟨9, _⟩, values => refinementSemanticAgrees9 values
- | ⟨10, _⟩, values => refinementSemanticAgrees10 values
- | ⟨11, _⟩, values => refinementSemanticAgrees11 values
- | ⟨12, _⟩, values => refinementSemanticAgrees12 values
- | ⟨13, _⟩, values => refinementSemanticAgrees13 values
- | ⟨14, _⟩, values => refinementSemanticAgrees14 values
- | ⟨15, _⟩, values => refinementSemanticAgrees15 values
- | ⟨16, _⟩, values => refinementSemanticAgrees16 values
- | ⟨17, _⟩, values => refinementSemanticAgrees17 values
- | ⟨18, _⟩, values => refinementSemanticAgrees18 values
- | ⟨19, _⟩, values => refinementSemanticAgrees19 values
- | ⟨20, _⟩, values => refinementSemanticAgrees20 values
- | ⟨21, _⟩, values => refinementSemanticAgrees21 values
- | ⟨22, _⟩, values => refinementSemanticAgrees22 values
- | ⟨23, _⟩, values => refinementSemanticAgrees23 values
- | ⟨24, _⟩, values => refinementSemanticAgrees24 values
- | ⟨25, _⟩, values => refinementSemanticAgrees25 values
- | ⟨26, _⟩, values => refinementSemanticAgrees26 values
- | ⟨27, _⟩, values => refinementSemanticAgrees27 values
- | ⟨n + 28, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨3, _⟩, spans, values => refinementSemanticAgrees3 spans values
+ | ⟨4, _⟩, spans, values => refinementSemanticAgrees4 spans values
+ | ⟨5, _⟩, spans, values => refinementSemanticAgrees5 spans values
+ | ⟨6, _⟩, spans, values => refinementSemanticAgrees6 spans values
+ | ⟨7, _⟩, spans, values => refinementSemanticAgrees7 spans values
+ | ⟨8, _⟩, spans, values => refinementSemanticAgrees8 spans values
+ | ⟨9, _⟩, spans, values => refinementSemanticAgrees9 spans values
+ | ⟨10, _⟩, spans, values => refinementSemanticAgrees10 spans values
+ | ⟨11, _⟩, spans, values => refinementSemanticAgrees11 spans values
+ | ⟨12, _⟩, spans, values => refinementSemanticAgrees12 spans values
+ | ⟨13, _⟩, spans, values => refinementSemanticAgrees13 spans values
+ | ⟨14, _⟩, spans, values => refinementSemanticAgrees14 spans values
+ | ⟨15, _⟩, spans, values => refinementSemanticAgrees15 spans values
+ | ⟨16, _⟩, spans, values => refinementSemanticAgrees16 spans values
+ | ⟨17, _⟩, spans, values => refinementSemanticAgrees17 spans values
+ | ⟨18, _⟩, spans, values => refinementSemanticAgrees18 spans values
+ | ⟨19, _⟩, spans, values => refinementSemanticAgrees19 spans values
+ | ⟨20, _⟩, spans, values => refinementSemanticAgrees20 spans values
+ | ⟨21, _⟩, spans, values => refinementSemanticAgrees21 spans values
+ | ⟨22, _⟩, spans, values => refinementSemanticAgrees22 spans values
+ | ⟨23, _⟩, spans, values => refinementSemanticAgrees23 spans values
+ | ⟨24, _⟩, spans, values => refinementSemanticAgrees24 spans values
+ | ⟨25, _⟩, spans, values => refinementSemanticAgrees25 spans values
+ | ⟨26, _⟩, spans, values => refinementSemanticAgrees26 spans values
+ | ⟨27, _⟩, spans, values => refinementSemanticAgrees27 spans values
+ | ⟨n + 28, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -1240,17 +1246,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- RustactionsParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ RustactionsParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) RustactionsParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) RustactionsParser.V := {
table := RustactionsParser.table
- decode := fun t => RustactionsParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := RustactionsParser.semV
+ decode := RustactionsParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -1295,13 +1303,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change RustactionsParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change RustactionsParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -1309,21 +1318,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (RustactionsParser.run input logNSteps) := by
+ have hrun : RustactionsParser.run input logNSteps
= Runtime.Exec.run RustactionsParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [RustactionsParser.run]
rw [Runtime.Exec.runFast_eq_run RustactionsParser.stackOps RustactionsParser.flat RustactionsParser.fuse
RustactionsParser.termOf RustactionsParser.valOf RustactionsParser.stackLawful RustactionsParser.fuseOK]
- simp only [RustactionsParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- RustactionsParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ RustactionsParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold RustactionsParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -1331,49 +1340,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : RustactionsParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Program)
- (accepted : RustactionsParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : RustactionsParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (RustactionsParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (RustactionsParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : RustactionsParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -1382,7 +1393,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- RustactionsParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ RustactionsParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -1398,13 +1409,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- RustactionsParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ RustactionsParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -1414,14 +1427,20 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
end RustactionsVerified
diff --git a/test/spanuse/SpanUseLexer.lean b/test/spanuse/SpanUseLexer.lean
index 7860f94..7ec3eb2 100644
--- a/test/spanuse/SpanUseLexer.lean
+++ b/test/spanuse/SpanUseLexer.lean
@@ -10,12 +10,16 @@ public import LeanParserGenerator.Lexer.ByteValidator
public import LeanParserGenerator.Lexer.DFA
public import LeanParserGenerator.Lexer.ByteScan
public import LeanParserGenerator.Lexer.FastAct
+public import LeanParserGenerator.Lexer.ByteAgree
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.Lexing
meta import LeanParserGenerator.Lexer.Validator
meta import LeanParserGenerator.Lexer.ByteTokenize
meta import LeanParserGenerator.Lexer.ByteValidator
meta import LeanParserGenerator.Lexer.DFA
meta import LeanParserGenerator.Lexer.ByteScan
meta import LeanParserGenerator.Lexer.FlatTokenize
+meta import LeanParserGenerator.Lexer.ByteAgree
@@ -110,9 +114,93 @@ theorem SpanUseLexer.fastActs_agree_byte :
Lexer.FastActs.Agrees SpanUseLexer.fastActs SpanUseLexer.cbyte.flat.base.acts :=
SpanUseLexer.fastActs_agree
-theorem SpanUseLexer.byteValidated0 :
- Lexer.byteValidate (SpanUseLexer.cbyte.bytes.getD 0 default)
- (SpanUseLexer.cflat.flats.getD 0 default) = true := by native_decide
-
def SpanUseLexer.tokenizeByte (input : String) : Except Lexer.LexError (List Tok) :=
Lexer.tokenizeByte SpanUseLexer.cbyte input
+
+theorem SpanUseLexer.byteUnicodeValidated : Lexer.byteValidAll SpanUseLexer.cbyte = true := by
+ native_decide
+
+/-- The positioned byte lexer `lexPos` and `tokenize` succeed on the same inputs with the
+ same tokens and spans (`Lexer.posLexerAgrees_of_byteValidAll`). -/
+theorem SpanUseLexer.posLexerAgrees : Lexer.PosLexerAgrees SpanUseLexer.cbyte SpanUseLexer.tokenize := by
+ intro s
+ rw [SpanUseLexer.tokenize_eq_flat]
+ exact Lexer.posLexerAgrees_of_byteValidAll SpanUseLexer.cbyte SpanUseLexer.byteUnicodeValidated s
+
+/-- `tokenizeByte` succeeds exactly when `tokenize` does, with its token values. -/
+theorem SpanUseLexer.tokenizeByte_toOption (s : String) :
+ (SpanUseLexer.tokenizeByte s).toOption = (SpanUseLexer.tokenize s).toOption.map (List.map (·.val)) :=
+ Lexer.tokenizeByte_toOption SpanUseLexer.cbyte SpanUseLexer.posLexerAgrees s
+
+/-- No rule emits the end-of-input token `Tok.EOF`. -/
+theorem SpanUseLexer.noEofEmit :
+ ∀ m r, (SpanUseLexer.fastActs.get m r).emit = true → ∀ s, (SpanUseLexer.fastActs.get m r).tok s ≠ Tok.EOF :=
+ Lexer.FastActs.get_of_allL SpanUseLexer.fastActs
+ (fun f => f.emit = true → ∀ s, f.tok s ≠ Tok.EOF) (by intro h; cases h)
+ (Lexer.AllL.cons
+ (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (fun _ _ => nofun) (Lexer.AllL.cons (by intro h; cases h) Lexer.AllL.nil)))
+ Lexer.AllL.nil)
+
+theorem SpanUseLexer.stay0 : ∀ r, (SpanUseLexer.fastActs.get 0 r).trans = Lexer.Trans.stay :=
+ Lexer.FastActs.get_of_allL SpanUseLexer.fastActs (fun f => f.trans = Lexer.Trans.stay) rfl
+ (Lexer.AllL.cons (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl (Lexer.AllL.cons rfl Lexer.AllL.nil))) Lexer.AllL.nil) 0
+
+theorem SpanUseLexer.textIndep0 : ∀ r, SpanUseLexer.cflat.needsText 0 r = false →
+ ∀ s, (SpanUseLexer.fastActs.get 0 r).toAct s = (SpanUseLexer.fastActs.get 0 r).toAct "" :=
+ Lexer.FastActs.textIndep_of_forall₂ SpanUseLexer.fastActs (SpanUseLexer.cflat.textDep.getD 0 #[]) 0
+ (Lexer.Forall₂.cons nofun (Lexer.Forall₂.cons (fun _ _ => rfl) (Lexer.Forall₂.cons (fun _ _ => rfl) Lexer.Forall₂.nil)))
+
+/-- A successful `tokenize` is a maximal-munch tokenization of the input, and the spec
+ tokenizer `Lexer.tokenize` returns the same token values. -/
+theorem SpanUseLexer.tokenize_sound {input : String} {ts : List (Runtime.Positioned Tok)}
+ (h : SpanUseLexer.tokenize input = .ok ts) :
+ Lexer.Tokenization SpanUseLexer.rules0 input.toList ∧
+ Lexer.tokenize SpanUseLexer.lexer input = .ok (ts.map (·.val)) :=
+ Lexer.tokenizeFlatStrPos_sound SpanUseLexer.cflat SpanUseLexer.fastActs SpanUseLexer.fastActs_agree
+ SpanUseLexer.validated0 rfl SpanUseLexer.flatValidated0 (by decide) SpanUseLexer.stay0
+ SpanUseLexer.textIndep0 (by rw [← SpanUseLexer.tokenize_eq_flat]; exact h)
+
+/-- **Completeness.** A maximal-munch `Lexer.Lexing` of the input makes `tokenize` succeed,
+ and the token values are the tokens of its steps. -/
+theorem SpanUseLexer.tokenize_complete {input : String} {steps : List (Nat × Nat)}
+ (h : Lexer.Lexing SpanUseLexer.rules0 input.toList steps) :
+ ∃ ts, SpanUseLexer.tokenize input = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens SpanUseLexer.lexer SpanUseLexer.lexer.start input.toList steps := by
+ rw [SpanUseLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_complete SpanUseLexer.cflat SpanUseLexer.fastActs SpanUseLexer.fastActs_agree
+ SpanUseLexer.validated0 rfl SpanUseLexer.flatValidated0 (by decide) SpanUseLexer.stay0
+ SpanUseLexer.textIndep0 h
+
+/-- The positioned maximal-munch tokenization of `s` by this lexer (`Lexer.PosLexing`): each
+ token's span delimits its lexeme, and skip rules consume the bytes between tokens. -/
+abbrev SpanUseLexer.Lexes (s : String) (ts : List (Runtime.Positioned Tok)) : Prop :=
+ Lexer.PosLexing SpanUseLexer.rules0 (Lexer.modeAct SpanUseLexer.lexer SpanUseLexer.lexer.start)
+ SpanUseLexer.lexer.eofToken s s.startPos ts
+
+/-- `tokenize` computes the positioned tokenization. -/
+theorem SpanUseLexer.tokenize_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ SpanUseLexer.tokenize s = .ok ts ↔ SpanUseLexer.Lexes s ts := by
+ rw [SpanUseLexer.tokenize_eq_flat]
+ exact Lexer.tokenizeFlatStrPos_iff_posLexing' SpanUseLexer.cflat SpanUseLexer.fastActs
+ SpanUseLexer.fastActs_agree SpanUseLexer.validated0 rfl SpanUseLexer.flatValidated0 (by decide)
+ SpanUseLexer.stay0 SpanUseLexer.textIndep0 s ts
+
+/-- The byte lexer `lexPos` computes the positioned tokenization. -/
+theorem SpanUseLexer.lexPos_iff_lexes (s : String) (ts : List (Runtime.Positioned Tok)) :
+ Lexer.lexPos SpanUseLexer.cbyte s = .ok ts ↔ SpanUseLexer.Lexes s ts :=
+ (Lexer.lexPos_ok_iff SpanUseLexer.posLexerAgrees s ts).trans (SpanUseLexer.tokenize_iff_lexes s ts)
+
+/-- The positioned tokenization of a string is unique. -/
+theorem SpanUseLexer.lexes_unique {s : String} {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : SpanUseLexer.Lexes s ts₁) (h₂ : SpanUseLexer.Lexes s ts₂) : ts₁ = ts₂ :=
+ Lexer.PosLexing.unique h₁ h₂
+
+/-- **The end-of-input token is last.** The positioned tokenization of `s` ends with
+ `Tok.EOF` at the end of `s`, and no other token is `Tok.EOF` (`noEofEmit`). -/
+theorem SpanUseLexer.lexes_eof_last {s : String} {ts : List (Runtime.Positioned Tok)}
+ (h : SpanUseLexer.Lexes s ts) :
+ ∃ ts0, ts = ts0 ++ [⟨Tok.EOF, Runtime.Span.point s.endPos.offset⟩] ∧
+ ∀ t ∈ ts0, t.val ≠ Tok.EOF :=
+ Lexer.PosLexing.eof_last (eof := Tok.EOF) (fun t => t ≠ Tok.EOF)
+ (Lexer.modeAct_emit_of_agrees SpanUseLexer.lexer SpanUseLexer.fastActs SpanUseLexer.fastActs_agree
+ _ SpanUseLexer.noEofEmit _) h
diff --git a/test/spanuse/SpanUseParser.lean b/test/spanuse/SpanUseParser.lean
index 7d8ab62..91e0817 100644
--- a/test/spanuse/SpanUseParser.lean
+++ b/test/spanuse/SpanUseParser.lean
@@ -48,11 +48,14 @@ def valOf : Tok → V
def decode : Runtime.Positioned Tok → Nat × VP :=
Runtime.Exec.decodeWith termOf valOf
-def sem : Nat → List VP → VP
- | 0, [(w_span, .v0 w)] => (w_span, .v0 (w_span.endPos.byteIdx - w_span.startPos.byteIdx))
- | 1, [(w_span, .v0 w), (__s1, _)] => (Runtime.Span.merge w_span __s1, .v0 (w))
- | 2, [x, _] => x
- | _, _ => (Runtime.Span.dummy, .unit ())
+def semV : Nat → List Runtime.Span → List V → V
+ | 0, __spans, [.v0 w] => let w_span : Runtime.Span := __spans.getD 0 Runtime.Span.dummy; .v0 (w_span.endPos.byteIdx - w_span.startPos.byteIdx)
+ | 1, _, [.v0 w, _] => .v0 (w)
+ | 2, _, [x, _] => x
+ | _, _, _ => .unit ()
+
+def sem : Nat → Runtime.Exec.Stack VP → List VP → VP :=
+ Runtime.Exec.spanSem semV
/-- The parser stack: one cell constructor per semantic type (`cUnit` for `Unit`),
each holding the state, the span offsets, and the unwrapped value. -/
@@ -87,6 +90,26 @@ theorem Stk.toList_ofList (l : Runtime.Exec.Stack VP) : (Stk.ofList l).toList =
| .cUnit st _ _ _ => st
| .c0 st _ _ _ _ => st
+/-- The end of the span of the top cell, byte 0 when empty (`Runtime.Exec.stackEnd`). -/
+@[inline] def Stk.endPos : Stk → String.Pos.Raw
+ | .nil => ⟨0⟩
+ | .fail _ => ⟨0⟩
+ | .cUnit _ _ e _ => e
+ | .c0 _ _ e _ _ => e
+
+/-- The top state and the end of the top cell, read with one match on the stack (an
+ empty right-hand side needs both). -/
+@[inline] def Stk.withTop (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) : Stk :=
+ match s with
+ | .nil => k start ⟨0⟩
+ | .fail _ => k start ⟨0⟩
+ | .cUnit st _ e _ => k st e
+ | .c0 st _ e _ _ => k st e
+
+theorem Stk.withTop_eq (start : Nat) (s : Stk) (k : Nat → String.Pos.Raw → Stk) :
+ Stk.withTop start s k = k (Stk.top start s) (Stk.endPos s) := by
+ cases s <;> rfl
+
@[inline] def Stk.isFail : Stk → Bool
| .fail _ => true
| _ => false
@@ -118,6 +141,7 @@ instance stackOps : Runtime.Exec.StackOps V Tok Stk where
accept := Stk.accept
toList := Stk.toList
ofList := Stk.ofList
+ endPos := Stk.endPos
def actionData : Array Runtime.Exec.Act :=
#[.error, .shift 1, .error, .error, .shift 3, .error, .error, .reduce 0, .error, .error, .error, .shift 4, .error,
@@ -173,6 +197,7 @@ theorem stackLawful : stackOps.Lawful valOf flat.eof.2 where
pushEof_eq := by intro st s; rfl
accept_eq := by intro s; cases s <;> rfl
toList_ofList := Stk.toList_ofList
+ endPos_eq := by intro s; cases s <;> rfl
theorem fuseOK0 : Runtime.Exec.FuseOKAt stackOps flat 0 fuse0 := by
intro stk
diff --git a/test/spanuse/SpanUseVerified.lean b/test/spanuse/SpanUseVerified.lean
index d2a371e..70e3fbf 100644
--- a/test/spanuse/SpanUseVerified.lean
+++ b/test/spanuse/SpanUseVerified.lean
@@ -16,6 +16,8 @@ public import LeanParserGenerator.Runtime.Complete
public import LeanParserGenerator.Runtime.GrammarView
+public import LeanParserGenerator.Runtime.SpanGrammar
+
meta import LeanParserGenerator.Runtime.Validator.Safe
meta import LeanParserGenerator.Runtime.Validator.Complete
@@ -28,6 +30,9 @@ public import spanuse.SpanUseParser
import all spanuse.SpanUseParser
meta import spanuse.SpanUseParser
public import LeanParserGenerator.Lexer.StreamRun
+public import LeanParserGenerator.Lexer.LexerSound
+public import LeanParserGenerator.Lexer.SpanText
+public import LeanParserGenerator.Runtime.ParseEnd
public import spanuse.SpanUseLexer
@@ -42,6 +47,8 @@ set_option maxRecDepth 1000000
set_option maxHeartbeats 40000000
+set_option linter.unusedVariables false
+
namespace SpanUseVerified
abbrev Terminal := Fin 4
@@ -85,15 +92,15 @@ def verifiedGrammarView : Runtime.VerifiedGrammarView :=
augmentedNonterminal := 1
augmentedProduction := 2 }
-def semTbl : List (Σ T : Type, T → SpanUseParser.VP) := [
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩,
- ⟨(Nat : Type), fun v => (Runtime.Span.dummy, .v0 v)⟩]
+def semTbl : List (Σ T : Type, T → SpanUseParser.V) := [
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Nat : Type), fun v => .v0 v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Unit : Type), fun v => .unit v⟩,
+ ⟨(Nat : Type), fun v => .v0 v⟩,
+ ⟨(Nat : Type), fun v => .v0 v⟩]
-def semDefault : Σ T : Type, T → SpanUseParser.VP := ⟨(Unit : Type), fun v => (Runtime.Span.dummy, .unit v)⟩
+def semDefault : Σ T : Type, T → SpanUseParser.V := ⟨(Unit : Type), fun v => .unit v⟩
def symIdx : Symbol Terminal NonTerminal → Nat
| .T t => t.val
@@ -102,19 +109,19 @@ def symIdx : Symbol Terminal NonTerminal → Nat
abbrev semT' (s : Symbol Terminal NonTerminal) : Type :=
(semTbl.getD (symIdx s) semDefault).1
-def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) :=
+def box : (pr : NonTerminal × List (Symbol Terminal NonTerminal)) → (act : List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')) → ((pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))) :=
fun pr act => ⟨pr, act⟩
-def semanticAction0 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (w : Nat) => (w_span.endPos.byteIdx - w_span.startPos.byteIdx)
+def semanticAction0 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (__spans : List Runtime.Span) => let w_span : Runtime.Span := __spans.getD 0 Runtime.Span.dummy; fun (w : Nat) => (w_span.endPos.byteIdx - w_span.startPos.byteIdx)
-def semanticAction1 : arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) (w : Nat) => (w)
+def semanticAction1 : List Runtime.Span → arrowsRight (semT' (.NT (⟨0, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) => fun (_ : Unit) (w : Nat) => (w)
-def semanticAction2 : arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
- fun (_ : Unit) x => x
+def semanticAction2 : List Runtime.Span → arrowsRight (semT' (.NT (⟨1, of_decide_eq_true rfl⟩ : NonTerminal))) ([Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩].map semT') :=
+ fun (_ : List Runtime.Span) (_ : Unit) x => x
-def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × arrowsRight (semT' (.NT pr.1)) (pr.2.map semT')
+def prodContents' : Production → (pr : NonTerminal × List (Symbol Terminal NonTerminal)) × (List Runtime.Span → arrowsRight (semT' (.NT pr.1)) (pr.2.map semT'))
| ⟨0, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨1, of_decide_eq_true rfl⟩]) semanticAction0
| ⟨1, _⟩ => box ((⟨0, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨0, of_decide_eq_true rfl⟩, Symbol.T ⟨1, of_decide_eq_true rfl⟩]) semanticAction1
| ⟨2, _⟩ => box ((⟨1, of_decide_eq_true rfl⟩ : NonTerminal), [Symbol.T ⟨3, of_decide_eq_true rfl⟩, Symbol.NT ⟨0, of_decide_eq_true rfl⟩]) semanticAction2
@@ -126,7 +133,7 @@ def prodLhs' : Production → NonTerminal :=
def prodRhsRev' : Production → List (Symbol Terminal NonTerminal) :=
fun p => (prodContents' p).1.2
-def prodAction' : (p : Production) → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
+def prodAction' : (p : Production) → List Runtime.Span → arrowsRight (semT' (.NT (prodLhs' p))) ((prodRhsRev' p).map semT') :=
fun p => (prodContents' p).2
def tokenName' : Tok → String
@@ -151,13 +158,15 @@ def tokenSem' : (tok : Tok) → semT' (.T (tokenTerm' tok))
prodLhs := prodLhs'
prodRhsRev := prodRhsRev'
-instance grammarInst : Grammar := { sigInst with
+instance spanGrammarInst : SpanGrammar := { sigInst with
semT := semT'
prodAction := prodAction'
- Token := Tok
+ Tok := Tok
tokenTerm := tokenTerm'
tokenSem := tokenSem' }
+instance grammarInst : Grammar := SpanGrammar.toGrammar (SG := spanGrammarInst)
+
abbrev lastSymb' : NonInitState → Symbol Terminal NonTerminal
| s => match s with
| ⟨0, _⟩ => Symbol.T ⟨1, of_decide_eq_true rfl⟩
@@ -309,47 +318,47 @@ theorem completenessValidation : completeValidator (A := automatonInst) = true :
theorem completeness : Complete := complete_of_completeValidator completenessValidation
-def toStream (input : List Tok) : Runtime.NatStream Tok :=
- fun n => input.getD n .EOF
-def parse (input : List Tok) (logNSteps : Nat := 40) : Option Nat :=
+def toStream (input : List (Runtime.Positioned Tok)) : Runtime.NatStream (Runtime.Positioned Tok) :=
+ fun n => input.getD n ⟨.EOF, Runtime.Span.dummy⟩
+def parse (input : List (Runtime.Positioned Tok)) (logNSteps : Nat := 40) : Option Nat :=
match Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps with
- | .Parsed r _ => some r
+ | .Parsed r _ => some (r ⟨0⟩).2
| _ => none
-def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : SpanUseParser.VP :=
+def refinementEncodeValue (s : Symbol Terminal NonTerminal) (v : semT' s) : SpanUseParser.V :=
(semTbl.getD (symIdx s) semDefault).2 v
theorem refinementSemanticAgrees0 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
- SpanUseParser.table.sem 0 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨0, of_decide_eq_true rfl⟩ : Production))),
+ SpanUseParser.semV 0 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.nil) => rfl
+ (values.apply (prodAction' (⟨0, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.nil) => rfl
theorem refinementSemanticAgrees1 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
- SpanUseParser.table.sem 1 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨1, of_decide_eq_true rfl⟩ : Production))),
+ SpanUseParser.semV 1 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨1, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees2 :
- ∀ (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
- SpanUseParser.table.sem 2 (values.encode refinementEncodeValue).reverse =
+ ∀ (spans : List Runtime.Span) (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' (⟨2, of_decide_eq_true rfl⟩ : Production))),
+ SpanUseParser.semV 2 spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production)))
- | .cons _ (.cons _ (.nil)) => rfl
+ (values.apply (prodAction' (⟨2, of_decide_eq_true rfl⟩ : Production) spans))
+ | _, .cons _ (.cons _ (.nil)) => rfl
theorem refinementSemanticAgrees :
- ∀ (production : Production)
- (values : Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production)),
- SpanUseParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ ∀ (production : Production) (spans : List Runtime.Span)
+ (values : Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production)),
+ SpanUseParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- | ⟨0, _⟩, values => refinementSemanticAgrees0 values
- | ⟨1, _⟩, values => refinementSemanticAgrees1 values
- | ⟨2, _⟩, values => refinementSemanticAgrees2 values
- | ⟨n + 3, h⟩, _ => absurd h (by omega)
+ (values.apply (prodAction' production spans))
+ | ⟨0, _⟩, spans, values => refinementSemanticAgrees0 spans values
+ | ⟨1, _⟩, spans, values => refinementSemanticAgrees1 spans values
+ | ⟨2, _⟩, spans, values => refinementSemanticAgrees2 spans values
+ | ⟨n + 3, h⟩, _, _ => absurd h (by omega)
def refinementStateIndex : St → Nat
| .Init _ => 0
@@ -456,17 +465,19 @@ theorem refinementProductionLengthAgrees (production : Production) :
simp only [Bool.and_eq_true] at checked
exact of_decide_eq_true checked.2
-theorem refinementDecodeAgrees (token : grammarInst.Token) :
- SpanUseParser.decode ⟨token, Runtime.Span.dummy⟩ =
- (refinementTerminalIndex (tokenTerm' token),
- refinementEncodeValue (.T (tokenTerm' token)) (tokenSem' token)) := by
+theorem refinementDecodeAgrees (token : Runtime.Positioned Tok) :
+ SpanUseParser.decode token =
+ (refinementTerminalIndex (tokenTerm' token.val),
+ (token.span, refinementEncodeValue (.T (tokenTerm' token.val)) (tokenSem' token.val))) := by
+ obtain ⟨token, span⟩ := token
cases token <;> rfl
-def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
- (A := automatonInst) SpanUseParser.VP := {
+def executableRefinement : Runtime.Refinement.ExecRefinement (SG := spanGrammarInst)
+ (A := automatonInst) SpanUseParser.V := {
table := SpanUseParser.table
- decode := fun t => SpanUseParser.decode ⟨t, Runtime.Span.dummy⟩
- eof := .EOF
+ semV := SpanUseParser.semV
+ decode := SpanUseParser.decode
+ eof := ⟨.EOF, Runtime.Span.dummy⟩
encodeValue := refinementEncodeValue
stateIndex := refinementStateIndex
terminalIndex := refinementTerminalIndex
@@ -511,13 +522,14 @@ def executableRefinement : Runtime.Refinement.ExecRefinement (G := grammarInst)
have rhsDef : grammarInst.prodRhsRev production = prodRhsRev' production := rfl
simpa [refinementProductionIndex, rhsDef] using
refinementProductionLengthAgrees production
+ sem_agrees := by rfl
semantic_agrees := by
- intro production values
- change Runtime.Refinement.Values (G := grammarInst) (prodRhsRev' production) at values
- change SpanUseParser.table.sem production.val (values.encode refinementEncodeValue).reverse =
+ intro production spans values
+ change Runtime.SpanGrammar.Values (SG := spanGrammarInst) (prodRhsRev' production) at values
+ change SpanUseParser.semV production.val spans (values.encode refinementEncodeValue).reverse =
refinementEncodeValue (.NT (prodLhs' production))
- (values.apply (prodAction' production))
- exact refinementSemanticAgrees production values
+ (values.apply (prodAction' production spans))
+ exact refinementSemanticAgrees production spans values
}
theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
@@ -525,21 +537,21 @@ theorem parserRunRefines (input : List grammarInst.Token) (logNSteps : Nat) :
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps)
- (SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
- have hrun : SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps
+ (SpanUseParser.run input logNSteps) := by
+ have hrun : SpanUseParser.run input logNSteps
= Runtime.Exec.run SpanUseParser.table (input.map executableRefinement.decode) logNSteps := by
simp only [SpanUseParser.run]
rw [Runtime.Exec.runFast_eq_run SpanUseParser.stackOps SpanUseParser.flat SpanUseParser.fuse
SpanUseParser.termOf SpanUseParser.valOf SpanUseParser.stackLawful SpanUseParser.fuseOK]
- simp only [SpanUseParser.table, executableRefinement, List.map_map]
rfl
rw [hrun]
- simpa [executableRefinement] using
- Runtime.Refinement.run_refines executableRefinement safety
- (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+ exact Runtime.Refinement.run_refines executableRefinement safety
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) input logNSteps
+/-- **Refinement.** The executable parser returns the value the dependent parser returns, on
+ the same positioned tokens. -/
theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
- SpanUseParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = parse input logNSteps := by
+ SpanUseParser.parse input logNSteps = parse input logNSteps := by
have related := parserRunRefines input logNSteps
unfold SpanUseParser.parse parse
have streamEq : Runtime.Refinement.listStream executableRefinement input = toStream input := rfl
@@ -547,49 +559,51 @@ theorem parse_eq_dependent (input : List grammarInst.Token) (logNSteps : Nat) :
generalize hDep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.Refinement.listStream executableRefinement input) logNSteps = dependent
at related ⊢
- generalize hExec : SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = executable at related ⊢
+ generalize hExec : SpanUseParser.run input logNSteps = executable at related ⊢
cases related <;> rfl
abbrev ParserStartTree (word : List grammarInst.Token) :=
Grammar.ParseTree (G := grammarInst)
(.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) word
+/-- **Soundness.** An accepted token list starts with the word of a parse tree whose value,
+ at the start of the input, is the result. -/
theorem parser_sound (input : List grammarInst.Token) (logNSteps : Nat)
(semantic : Nat)
- (accepted : SpanUseParser.parse (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some semantic) :
+ (accepted : SpanUseParser.parse input logNSteps = some semantic) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
toStream input = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = semantic := by
+ SpanGrammar.ptSem ⟨0⟩ tree = semantic := by
rw [parse_eq_dependent] at accepted
unfold parse at accepted
+ have sound := SpanGrammar.parseCorrect (SG := spanGrammarInst) (A := automatonInst)
+ (S := Runtime.NatStream grammarInst.Token)
+ (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hResult : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
- (toStream input) logNSteps = result at accepted
+ (toStream input) logNSteps = result at accepted sound
cases result with
| Fail state token => cases accepted
| Timeout => cases accepted
| Err message => cases accepted
| Parsed value rest =>
- have valueEq : value = semantic := Option.some.inj accepted
- have sound := Runtime.parseCorrect (G := grammarInst) (A := automatonInst)
- (S := Runtime.NatStream grammarInst.Token)
- (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
- rw [hResult] at sound
+ have valueEq : (value ⟨0⟩).2 = semantic := Option.some.inj accepted
obtain ⟨word, tree, inputEq, semanticEq⟩ := sound
- exact ⟨word, tree, rest, inputEq, semanticEq.trans valueEq⟩
+ refine ⟨word, tree, rest, inputEq, ?_⟩
+ rw [← valueEq, semanticEq]
theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
- Runtime.Exec.ResultErrFree (SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) := by
+ Runtime.Exec.ResultErrFree (SpanUseParser.run input logNSteps) := by
have related := parserRunRefines input logNSteps
change Runtime.Refinement.ResultRel executableRefinement
(⟨0, of_decide_eq_true rfl⟩ : InitState)
(Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps)
- (SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps) at related
+ (SpanUseParser.run input logNSteps) at related
have dependentFree := Runtime.parse_err_free (G := grammarInst) (A := automatonInst)
safety (⟨0, of_decide_eq_true rfl⟩ : InitState) (toStream input) logNSteps
generalize hDependent : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
(toStream input) logNSteps = dependent at related dependentFree
- generalize hParser : SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = result at related ⊢
+ generalize hParser : SpanUseParser.run input logNSteps = result at related ⊢
cases related with
| fail state token => trivial
| parsed value stream => trivial
@@ -598,7 +612,7 @@ theorem parser_err_free (input : List grammarInst.Token) (logNSteps : Nat) :
theorem parser_ne_err (input : List grammarInst.Token) (logNSteps : Nat)
(message : String) :
- SpanUseParser.run (input.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps ≠ .err message := by
+ SpanUseParser.run input logNSteps ≠ .err message := by
intro isError
have errorFree := parser_err_free input logNSteps
rw [isError] at errorFree
@@ -614,13 +628,15 @@ theorem toStream_eq_appList (input : List grammarInst.Token) :
| zero => rfl
| succ index => exact ih index
+/-- **Completeness.** The word of a parse tree is accepted, with the tree's value, when the
+ fuel covers the tree's size. -/
theorem parser_complete {word : List grammarInst.Token}
(tree : ParserStartTree word) (logNSteps : Nat)
(fuel : Grammar.ptSize tree ≤ 2 ^ logNSteps) :
- SpanUseParser.parse (word.map (fun t => ⟨t, Runtime.Span.dummy⟩)) logNSteps = some (Grammar.ptSem tree) := by
+ SpanUseParser.parse word logNSteps = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
rw [parse_eq_dependent]
unfold parse
- have complete := Runtime.parseComplete (G := grammarInst) (A := automatonInst)
+ have complete := SpanGrammar.parseComplete (SG := spanGrammarInst) (A := automatonInst)
(S := Runtime.NatStream grammarInst.Token) completeness
(⟨0, of_decide_eq_true rfl⟩ : InitState) logNSteps (toStream []) tree
rw [← toStream_eq_appList] at complete
@@ -630,56 +646,59 @@ theorem parser_complete {word : List grammarInst.Token}
| Fail state token => exact complete.elim
| Err message => exact complete.elim
| Timeout => omega
- | Parsed semantic rest => exact congrArg some complete.1
+ | Parsed semantic rest =>
+ have h0 := complete.1 ⟨0⟩
+ show some (semantic ⟨0⟩).2 = _
+ rw [h0]
+/-- **Unambiguity.** Two parse trees over the same positioned word have the same span and
+ value (at every start position `pe`). -/
theorem parser_unambiguous {word : List grammarInst.Token}
- (tree1 tree2 : ParserStartTree word) :
- Grammar.ptSem tree1 = Grammar.ptSem tree2 := by
- letI : Inhabited grammarInst.Token := ⟨.EOF⟩
- exact Runtime.unambiguity (G := grammarInst) (A := automatonInst)
- completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2
-
-/-- `lexPos` and `SpanUseLexer.tokenize` succeed on the same inputs with the same tokens. Stated, not proved. -/
+ (tree1 tree2 : ParserStartTree word) (pe : String.Pos.Raw := ⟨0⟩) :
+ SpanGrammar.ptSpan pe tree1 = SpanGrammar.ptSpan pe tree2 ∧
+ SpanGrammar.ptSem pe tree1 = SpanGrammar.ptSem pe tree2 := by
+ letI : Inhabited Tok := ⟨.EOF⟩
+ exact SpanGrammar.unambiguity (SG := spanGrammarInst) (A := automatonInst)
+ completeness (⟨0, of_decide_eq_true rfl⟩ : InitState) tree1 tree2 pe
+
+/-- `lexPos` and `SpanUseLexer.tokenize` succeed on the same inputs with the same tokens. Proved as
+ `posLexerAgrees`. -/
abbrev PosLexerAgrees : Prop := Lexer.PosLexerAgrees SpanUseLexer.cbyte SpanUseLexer.tokenize
-/-- `SpanUseParser.parse` ignores token spans. Stated, not proved; false when an action reads `x_span`. -/
-abbrev SpanIndependent : Prop := Runtime.Exec.SpanIndependent (fun ts k => SpanUseParser.parse ts k)
+theorem posLexerAgrees : PosLexerAgrees := SpanUseLexer.posLexerAgrees
+
+theorem lexPos_eq_of_tokenize (s : String) (ts : List (Runtime.Positioned Tok)) (h : SpanUseLexer.tokenize s = .ok ts) :
+ Lexer.lexPos SpanUseLexer.cbyte s = .ok ts := by
+ have hagree := posLexerAgrees s
+ rw [h] at hagree
+ revert hagree
+ cases Lexer.lexPos SpanUseLexer.cbyte s with
+ | error e => intro hc; simp [Except.toOption] at hc
+ | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
-theorem parseStr_eq (hlex : PosLexerAgrees) (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+theorem parseStr_eq (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
(h : SpanUseLexer.tokenize s = .ok ts) : SpanUseParser.parseStr s k = SpanUseParser.parse ts k := by
- have hp : Lexer.lexPos SpanUseLexer.cbyte s = .ok ts := by
- have hagree := hlex s
- rw [h] at hagree
- revert hagree
- cases Lexer.lexPos SpanUseLexer.cbyte s with
- | error e => intro hc; simp [Except.toOption] at hc
- | ok v => intro hc; simp [Except.toOption] at hc; rw [hc]
+ have hp : Lexer.lexPos SpanUseLexer.cbyte s = .ok ts := lexPos_eq_of_tokenize s ts h
exact SpanUseParser.parseStr_eq_lexPos s k ts hp
-theorem parseStr_eq_dependent (hspan : SpanIndependent) (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_eq_dependent (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : SpanUseLexer.tokenize s = .ok ts) :
- SpanUseParser.parseStr s k = parse (ts.map (·.val)) k := by
- have hs : SpanUseParser.parse ts k = SpanUseParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- hspan ts k
- rw [parseStr_eq hlex s k ts h, hs, ← parse_eq_dependent (ts.map (·.val)) k, List.map_map]
- rfl
+ SpanUseParser.parseStr s k = parse ts k := by
+ rw [parseStr_eq s k ts h, parse_eq_dependent]
-theorem parseStr_sound (hspan : SpanIndependent) (hlex : PosLexerAgrees) (s : String)
+theorem parseStr_sound (s : String)
(k : Nat) (ts : List (Runtime.Positioned Tok)) (h : SpanUseLexer.tokenize s = .ok ts) (p : Nat)
(accepted : SpanUseParser.parseStr s k = some p) :
∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
(rest : Runtime.NatStream grammarInst.Token),
- toStream (ts.map (·.val)) = Runtime.NatStream.appList word rest ∧
- Grammar.ptSem tree = p := by
- have hs : SpanUseParser.parse ts k = SpanUseParser.parse (ts.map fun t => ⟨t.val, Runtime.Span.dummy⟩) k :=
- hspan ts k
- rw [parseStr_eq hlex s k ts h, hs] at accepted
- exact parser_sound (ts.map (·.val)) k p
- (by simpa [List.map_map, Function.comp_def] using accepted)
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ rw [parseStr_eq s k ts h] at accepted
+ exact parser_sound ts k p accepted
/-- When `tokenize` fails, the byte lexer delivers a prefix `ts` and fails, and `parseStr`
is `none` or `parse` of an extension of `ts`. -/
-theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat)
+theorem parseStr_of_tokenize_error (s : String) (k : Nat)
(e : Lexer.LexError) (h : SpanUseLexer.tokenize s = .error e) :
∃ ts e', Runtime.Exec.Fails (Lexer.pullSource (Lexer.pullAux SpanUseLexer.cbyte s.toUTF8))
⟨false, s.toUTF8.size + 1, 0, [SpanUseLexer.cbyte.flat.base.start]⟩ ts e' ∧
@@ -688,10 +707,281 @@ theorem parseStr_of_tokenize_error (hlex : PosLexerAgrees) (s : String) (k : Nat
· exfalso
have hp : Lexer.lexPos SpanUseLexer.cbyte s = .ok ts :=
Lexer.lexPosAux_of_denotes SpanUseLexer.cbyte s.toUTF8 _ _ _ ts hD
- have hagree := hlex s
+ have hagree := posLexerAgrees s
rw [hp, h] at hagree
simp [Except.toOption] at hagree
· exact hF
+/-- Every production of the start symbol has the end marker `$` on its right-hand side. -/
+theorem startProds_end : ∀ p : Production,
+ prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ Symbol.T (⟨3, of_decide_eq_true rfl⟩ : Terminal) ∈ prodRhsRev' p := by
+ native_decide
+
+theorem tokenTerm_eq_end (t : Tok)
+ (h : tokenTerm' t = (⟨3, of_decide_eq_true rfl⟩ : Terminal)) : t = .EOF := by
+ cases t <;> first | rfl | exact absurd (congrArg Fin.val h) (Nat.ne_of_beq_eq_false rfl)
+
+/-- The dependent parser does not accept a token list with no `EOF` that is longer than
+ `2^k`: it has not reached the end marker. -/
+theorem dependent_ne_parsed_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length)
+ (r : SpanGrammar.semR (SG := spanGrammarInst) (.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))))
+ (rest : Runtime.NatStream grammarInst.Token) :
+ Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k ≠ .Parsed r rest :=
+ Runtime.parse_ne_parsed_of_no_end (G := grammarInst) (A := automatonInst) _ _
+ startProds_end input ⟨.EOF, Runtime.Span.dummy⟩ rfl
+ (fun t ht he => hin t ht (tokenTerm_eq_end t.val he)) k hlen r rest
+
+theorem parse_eq_none_of_no_eof (input : List (Runtime.Positioned Tok)) (k : Nat)
+ (hin : ∀ t ∈ input, t.val ≠ .EOF) (hlen : 2 ^ k < input.length) : parse input k = none := by
+ unfold parse
+ cases hp : Runtime.parse (S := Runtime.NatStream _) (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (toStream input) k with
+ | Parsed r rest => exact absurd hp (dependent_ne_parsed_of_no_eof input k hin hlen r rest)
+ | _ => rfl
+
+/-- A prefix of lexed tokens with no `EOF`, padded with copies of its first token. -/
+theorem no_eof_pad (t0 : Runtime.Positioned Tok) (ts : List (Runtime.Positioned Tok))
+ (hts : ∀ t ∈ t0 :: ts, t.val ≠ .EOF) (k : Nat) :
+ (∀ t ∈ t0 :: ts ++ List.replicate (2 ^ k + 1) t0, t.val ≠ .EOF) ∧
+ 2 ^ k < (t0 :: ts ++ List.replicate (2 ^ k + 1) t0).length := by
+ constructor
+ · intro x hx
+ rcases List.mem_append.mp hx with hx | hx
+ · exact hts x hx
+ · rw [List.eq_of_mem_replicate hx]; exact hts t0 (List.mem_cons_self ..)
+ · simp only [List.length_append, List.length_replicate, List.length_cons]
+ omega
+
+/-- **Lex failure.** When the positioned byte lexer fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_lexPos (s : String) (k : Nat)
+ (h : ∀ ts, Lexer.lexPos SpanUseLexer.cbyte s ≠ .ok ts) : SpanUseParser.parseStr s k = none := by
+ rcases SpanUseParser.parseStr_total s k with ⟨ts, hD, _⟩ | ⟨ts, e, hF, hr⟩
+ · exact absurd (Lexer.lexPosAux_of_denotes SpanUseLexer.cbyte s.toUTF8 _ _ _ ts hD) (h ts)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens SpanUseLexer.cbyte SpanUseLexer.fastActs SpanUseLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) SpanUseLexer.noEofEmit s.toUTF8 _ ts e hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ unfold SpanUseParser.parseStr
+ rw [SpanUseParser.runStream_eq_runSrc]
+ unfold Runtime.Exec.runSrc
+ rw [hn]
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · exact h1
+ · rw [h1, parse_eq_dependent]
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ exact parse_eq_none_of_no_eof _ k hin hlen
+
+/-- **Lex failure.** When `tokenize` fails, `parseStr` is `none`. -/
+theorem parseStr_eq_none_of_tokenize_error (s : String) (k : Nat)
+ (e : Lexer.LexError) (h : SpanUseLexer.tokenize s = .error e) : SpanUseParser.parseStr s k = none :=
+ parseStr_eq_none_of_lexPos s k (fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree)
+
+/-- **Lex failure, stream engine.** When `tokenize` fails, `runStream` does not accept. It may
+ reject or run out of steps before it reaches the lex error, so the result need not be
+ `.err`. -/
+theorem runStream_ne_ok_of_tokenize_error (s : String) (k : Nat) (e : Lexer.LexError)
+ (h : SpanUseLexer.tokenize s = .error e) : ∀ v, SpanUseParser.runStream s k ≠ .ok v := by
+ intro v hok
+ have hlex : ∀ ts, Lexer.lexPos SpanUseLexer.cbyte s ≠ .ok ts := fun ts hts => by
+ have hagree := posLexerAgrees s
+ rw [hts, h] at hagree
+ simp [Except.toOption] at hagree
+ unfold SpanUseParser.runStream at hok
+ rcases Lexer.runStreamFast_total (ops := SpanUseParser.stackOps) SpanUseParser.flat SpanUseParser.fuse SpanUseParser.termOf SpanUseLexer.cbyte
+ SpanUseLexer.fastActs SpanUseLexer.fastActs_agree_byte s (2 ^ k) with ⟨ts, hD, _⟩ | ⟨ts, e', hF, hr⟩
+ · exact hlex ts (Lexer.lexPosAux_of_denotes SpanUseLexer.cbyte s.toUTF8 _ _ _ ts hD)
+ · have htoks : ∀ t ∈ ts, t.val ≠ .EOF :=
+ Lexer.pullSource_fails_tokens SpanUseLexer.cbyte SpanUseLexer.fastActs SpanUseLexer.fastActs_agree_byte
+ (fun t => t ≠ .EOF) SpanUseLexer.noEofEmit s.toUTF8 _ ts e' hF
+ cases ts with
+ | nil =>
+ cases hF with
+ | err hn =>
+ rw [Lexer.runStreamFast_eq_runSrc (ops := SpanUseParser.stackOps) SpanUseParser.flat SpanUseParser.fuse SpanUseParser.termOf
+ SpanUseLexer.cbyte SpanUseLexer.fastActs SpanUseLexer.fastActs_agree_byte] at hok
+ unfold Runtime.Exec.runSrc at hok
+ rw [hn] at hok
+ cases hok
+ | cons t0 rest =>
+ rcases hr (List.replicate (2 ^ k + 1) t0) with h1 | h1
+ · rw [h1] at hok; cases hok
+ · rw [h1] at hok
+ obtain ⟨hin, hlen⟩ := no_eof_pad t0 rest htoks k
+ have related := parserRunRefines (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k
+ have hw : SpanUseParser.run (t0 :: rest ++ List.replicate (2 ^ k + 1) t0) k = .ok v := hok
+ rw [hw] at related
+ generalize hdep : Runtime.parse (⟨0, of_decide_eq_true rfl⟩ : InitState)
+ (Runtime.Refinement.listStream executableRefinement
+ (t0 :: rest ++ List.replicate (2 ^ k + 1) t0)) k = dep at related
+ cases related with
+ | parsed value stream =>
+ exact dependent_ne_parsed_of_no_eof _ k hin hlen value stream hdep
+
+/-- **End to end.** If `parseStr` accepts `s` with value `p`, then `tokenize` lexes `s` to
+ `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem parseStr_sound_tokenize (s : String) (k : Nat) (p : Nat)
+ (accepted : SpanUseParser.parseStr s k = some p) :
+ ∃ ts, SpanUseLexer.tokenize s = .ok ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ cases ht : SpanUseLexer.tokenize s with
+ | error e =>
+ rw [parseStr_eq_none_of_tokenize_error s k e ht] at accepted
+ cases accepted
+ | ok ts => exact ⟨ts, rfl, parseStr_sound s k ts ht p accepted⟩
+
+/-- **End to end, with the lexer specification.** If `parseStr` accepts `s` with value `p`,
+ then `s` has a maximal-munch tokenization (`Lexer.Tokenization`), the spec tokenizer
+ returns the token values of `ts = tokenize s`, and `ts` starts with the word of a parse
+ tree whose value is `p`. -/
+theorem parseStr_sound_tokenization (s : String) (k : Nat) (p : Nat)
+ (accepted : SpanUseParser.parseStr s k = some p) :
+ ∃ ts, SpanUseLexer.tokenize s = .ok ts ∧ Lexer.Tokenization SpanUseLexer.rules0 s.toList ∧
+ Lexer.tokenize SpanUseLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ obtain ⟨htok, hspec⟩ := SpanUseLexer.tokenize_sound ht
+ exact ⟨ts, ht, htok, hspec, hp⟩
+
+/-- **`tokenize` then `parse`.** If `tokenize` lexes `s` to `ts` and `parse` accepts `ts` with
+ value `p`, then `s` has a maximal-munch tokenization, the spec tokenizer returns the token
+ values of `ts`, and `ts` starts with the word of a parse tree whose value is `p`. -/
+theorem tokenize_parse_sound (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok)) (p : Nat)
+ (h : SpanUseLexer.tokenize s = .ok ts) (accepted : SpanUseParser.parse ts k = some p) :
+ Lexer.Tokenization SpanUseLexer.rules0 s.toList ∧ Lexer.tokenize SpanUseLexer.lexer s = .ok (ts.map (·.val)) ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨htok, hspec⟩ := SpanUseLexer.tokenize_sound h
+ exact ⟨htok, hspec, parser_sound ts k p accepted⟩
+
+/-- **Completeness.** If `tokenize` lexes `s` to `ts` and a parse tree of the start symbol
+ spans exactly `ts`, within the fuel, `parseStr` returns the tree's value. -/
+theorem parseStr_complete (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : SpanUseLexer.tokenize s = .ok ts) (tree : ParserStartTree ts)
+ (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ SpanUseParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ rw [parseStr_eq s k ts h]
+ exact parser_complete tree k fuel
+
+/-- **Completeness from a tokenization (value level).** A maximal-munch `Lexer.Lexing` of `s`
+ gives the tokens `ts` of `tokenize s`, whose values are the tokens of its steps, and
+ `parseStr` accepts every parse tree over `ts` within the fuel, with the tree's value. -/
+theorem parseStr_complete_lexing (s : String) (k : Nat) (steps : List (Nat × Nat))
+ (hsteps : Lexer.Lexing SpanUseLexer.rules0 s.toList steps) :
+ ∃ ts, SpanUseLexer.tokenize s = .ok ts ∧
+ ts.map (·.val) = Lexer.lexingTokens SpanUseLexer.lexer SpanUseLexer.lexer.start s.toList steps ∧
+ ∀ tree : ParserStartTree ts, Grammar.ptSize tree ≤ 2 ^ k →
+ SpanUseParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) := by
+ obtain ⟨ts, ht, hv⟩ := SpanUseLexer.tokenize_complete hsteps
+ exact ⟨ts, ht, hv, fun tree fuel => parseStr_complete s k ts ht tree fuel⟩
+
+/-- **Unambiguity (value level).** Two derivations of `s`, each the tokens `tokenize` returns
+ for `s` and a parse tree over them, have the same tokens and the same value. -/
+theorem parseStr_unambiguous (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : SpanUseLexer.tokenize s = .ok ts₁) (h₂ : SpanUseLexer.tokenize s = .ok ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ rw [h₁] at h₂
+ cases h₂
+ exact ⟨rfl, (parser_unambiguous tree₁ tree₂).2⟩
+
+/-- **Completeness over positioned tokens.** If `ts` is the positioned tokenization of `s`
+ (`SpanUseLexer.Lexes`) and a parse tree of the start symbol spans exactly `ts`, within the fuel,
+ `parseStr` returns the tree's value. -/
+theorem parseStr_complete_lexes (s : String) (k : Nat) (ts : List (Runtime.Positioned Tok))
+ (h : SpanUseLexer.Lexes s ts) (tree : ParserStartTree ts) (fuel : Grammar.ptSize tree ≤ 2 ^ k) :
+ SpanUseParser.parseStr s k = some (SpanGrammar.ptSem ⟨0⟩ tree) :=
+ parseStr_complete s k ts ((SpanUseLexer.tokenize_iff_lexes s ts).mpr h) tree fuel
+
+/-- **Unambiguity over positioned tokens.** Two derivations of `s`, each a positioned
+ tokenization and a parse tree over it, have the same tokens, and their trees have the
+ same span and value. -/
+theorem parseStr_unambiguous_lexes (s : String) {ts₁ ts₂ : List (Runtime.Positioned Tok)}
+ (h₁ : SpanUseLexer.Lexes s ts₁) (h₂ : SpanUseLexer.Lexes s ts₂)
+ (tree₁ : ParserStartTree ts₁) (tree₂ : ParserStartTree ts₂) :
+ ts₁ = ts₂ ∧ SpanGrammar.ptSpan ⟨0⟩ tree₁ = SpanGrammar.ptSpan ⟨0⟩ tree₂ ∧
+ SpanGrammar.ptSem ⟨0⟩ tree₁ = SpanGrammar.ptSem ⟨0⟩ tree₂ := by
+ have he := SpanUseLexer.lexes_unique h₁ h₂
+ subst he
+ exact ⟨rfl, parser_unambiguous tree₁ tree₂⟩
+
+/-- **Node spans as text of `s`.** In a parse tree over the positioned tokenization `ts` of
+ `s` (`SpanUseLexer.Lexes`), every leaf's span is `[a, b)` for positions `a ≤ b` of `s`, and a rule's
+ action emits the leaf's token from the lexeme `s.extract a b` (or the leaf is the
+ end-of-input token at the end of `s`). Every inner node's span is `[a, b)` for positions
+ `a ≤ b` of `s`; `b` is the end of the lexeme of the node's last token, and `a` is the start
+ of the lexeme of its first token or, when its word is empty or its leftmost children
+ derive the empty word, the end of the token before it (`Lexer.AllNodeText`). -/
+theorem parseStr_node_spans (s : String) (ts : List (Runtime.Positioned Tok)) (h : SpanUseLexer.Lexes s ts)
+ (tree : ParserStartTree ts) :
+ Lexer.AllNodeText (Lexer.modeAct SpanUseLexer.lexer SpanUseLexer.lexer.start) SpanUseLexer.lexer.eofToken s ⟨0⟩ tree :=
+ Lexer.PosLexing.allNodeText h tree
+
+/-- **End to end over positioned tokens.** If `parseStr` accepts `s` with value `p`, then
+ `s` has a positioned tokenization `ts` (`SpanUseLexer.Lexes`), and `ts` starts with the word of a
+ parse tree whose value is `p`. -/
+theorem parseStr_sound_lexes (s : String) (k : Nat) (p : Nat)
+ (accepted : SpanUseParser.parseStr s k = some p) :
+ ∃ ts, SpanUseLexer.Lexes s ts ∧
+ ∃ (word : List grammarInst.Token) (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token),
+ toStream ts = Runtime.NatStream.appList word rest ∧
+ SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, hp⟩ := parseStr_sound_tokenize s k p accepted
+ exact ⟨ts, (SpanUseLexer.tokenize_iff_lexes s ts).mp ht, hp⟩
+
+/-- The end marker `$` is the last symbol of every production of the start symbol, and no
+ other position of a right-hand side holds `$` or the start symbol. -/
+theorem endMarker_last : ∀ p : Production,
+ (prodLhs' p = startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ (prodRhsRev' p).head? = some (Symbol.T (⟨3, of_decide_eq_true rfl⟩ : Terminal)) ∧
+ ∀ x ∈ (prodRhsRev' p).tail, x ≠ Symbol.T (⟨3, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) ∧
+ (prodLhs' p ≠ startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState) →
+ ∀ x ∈ prodRhsRev' p, x ≠ Symbol.T (⟨3, of_decide_eq_true rfl⟩ : Terminal) ∧
+ x ≠ Symbol.NT (startNt' (⟨0, of_decide_eq_true rfl⟩ : InitState))) := by
+ native_decide
+
+/-- **The tree covers the tokens.** If `ts` is the positioned tokenization of `s`
+ (`SpanUseLexer.Lexes`), the word of a start tree that begins the stream of `ts` is `ts`: the lexer
+ emits `EOF` only as its last token (`SpanUseLexer.lexes_eof_last`), and a start tree's word ends
+ with its only `$` token (`endMarker_last`). -/
+theorem word_eq_of_lexes (s : String) (ts : List (Runtime.Positioned Tok)) (h : SpanUseLexer.Lexes s ts)
+ {word : List grammarInst.Token} (tree : ParserStartTree word)
+ (rest : Runtime.NatStream grammarInst.Token)
+ (hs : toStream ts = Runtime.NatStream.appList word rest) : word = ts := by
+ obtain ⟨ts0, rfl, hno⟩ := SpanUseLexer.lexes_eof_last h
+ exact Runtime.start_word_eq (G := grammarInst) (A := automatonInst) _ _ endMarker_last _ ts0 _
+ rfl (fun t ht he => hno t ht (tokenTerm_eq_end t.val he)) tree rest hs
+
+/-- **End to end, over the whole input.** If `parseStr` accepts `s` with value `p`, then
+ `tokenize` lexes `s` to `ts`, `ts` is the positioned tokenization of `s` (`SpanUseLexer.Lexes`),
+ and a parse tree over exactly `ts` has the value `p`. -/
+theorem parseStr_sound_exact (s : String) (k : Nat) (p : Nat)
+ (accepted : SpanUseParser.parseStr s k = some p) :
+ ∃ ts, SpanUseLexer.tokenize s = .ok ts ∧ SpanUseLexer.Lexes s ts ∧
+ ∃ tree : ParserStartTree ts, SpanGrammar.ptSem ⟨0⟩ tree = p := by
+ obtain ⟨ts, ht, word, tree, rest, hs, hp⟩ := parseStr_sound_tokenize s k p accepted
+ have hl := (SpanUseLexer.tokenize_iff_lexes s ts).mp ht
+ obtain rfl := word_eq_of_lexes s ts hl tree rest hs
+ exact ⟨word, ht, hl, tree, hp⟩
+
end SpanUseVerified