Files
provable-parser/ProvableParser.lean
Greg Shuflin 667c0b7c96
Lean Action CI / build (push) Has been cancelled
Starting to noodle on Grammar type
2026-04-04 13:52:09 -07:00

10 lines
461 B
Lean4
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- This module serves as the root of the `ProvableParser` library.
-- Import modules here that should be built as part of the library.
import ProvableParser.Basic
inductive Grammar {α : Type} : (List α -> Prop) -> Type where
| epsilon : Grammar (· = [])
| char : (p: α -> Prop) -> Grammar (fun s => ∃ c, p c ∧ s = [c])
| seq : Grammar L₁ -> Grammar L₂ ->
Grammar (fun s => ∃ s₁ s₂ , s = s₁ ++ s₂ ∧ L₁ s₁ ∧ L₂ s₂ )