Engine

7.11. Statements of Grammar🔗

The exact statements behind the claims on the page Grammar.

theorem text_has_at_most_one_meaning {s : String} {a b : CondExpr} (ha : parseCondExpr s = some a) (hb : parseCondExpr s = some b) : a = b

proof: spec/Spec/GrammarFacts.lean:40

theorem printing_a_selector_gives_a_text_that_parses_back_to_it (s : Selector) (h : s.ok = true) : parseSelector (printSelector s) = some s

proof: spec/Spec/RoundTrip.lean:891

theorem printing_a_condition_gives_a_text_that_parses_back_to_it (c : CondExpr) (h : c.ok = true) : parseCondExpr (printCondExpr c) = some c

proof: spec/Spec/RoundTrip.lean:895

theorem printing_a_value_gives_a_text_that_parses_back_to_it (v : ValueExpr) (h : v.ok = true) : parseValueExpr (printValueExpr v) = some v

proof: spec/Spec/RoundTrip.lean:899

theorem printing_a_per_entry_gives_a_text_that_parses_back_to_it (p : Per) (h : p.ok = true) : parsePer (printPer p) = some p

proof: spec/Spec/RoundTrip.lean:903

theorem printing_a_quantity_gives_a_text_that_parses_back_to_it (q : Quantity) : parseQuantity (printQuantity q) = some q

proof: spec/Spec/RoundTrip.lean:921

theorem suffixes_bind_tighter_than_except : SameReading parseSelector "A except B within 1 hour" "A except (B within 1 hour)" ∧ SameReading parseSelector "A where x = 1 except B" "(A where x = 1) except B"

proof: spec/Spec/Readable.lean:111

theorem where_takes_one_test_and_and_or_end_it : SameReading parseCondExpr "never A where x = 1 and ever B" "(never A where x = 1) and ever B"

proof: spec/Spec/Readable.lean:105

theorem not_binds_tighter_than_and_and_and_tighter_than_or : SameReading parseCondExpr "not ever A and ever B or ever C" "((not ever A) and ever B) or ever C"

proof: spec/Spec/Readable.lean:128

theorem multiplication_and_division_bind_tighter_than_addition_and_subtraction : SameReading parseValueExpr "a + b * c - d / e" "((a + (b * c)) - (d / e))"

proof: spec/Spec/Readable.lean:134

theorem a_paren_opens_a_value_when_an_operator_follows_else_a_condition : SameReading parseCondExpr "(a + 1) > 2" "a + 1 > 2" ∧ SameReading parseCondExpr "(ever A) and ever B" "ever A and ever B" ∧ (parseCondExpr "(last of A).x is null").isSome

proof: spec/Spec/Readable.lean:141

theorem a_quote_inside_a_text_is_written_twice : parseValueExpr "'it''s'" = some (.lit (.str "it's"))

proof: spec/Spec/GrammarFacts.lean:88

theorem minus_5_is_a_number_but_minus_x_is_not_a_value : (parseValueExpr "-5").isSome ∧ parseValueExpr "-x" = none ∧ (parseValueExpr "0 - x").isSome

proof: spec/Spec/Readable.lean:151