lean4-htt/tests/lean/precissues.lean
Sebastian Ullrich 8a02dfec4f feat: subsume variables under variable
/cc @leodemoura
2021-01-22 14:36:05 +01:00

41 lines
692 B
Text

#check id fun x => x -- should work
#check 0
def f (x : Nat) (g : Nat → Nat) := g x
#check f 1 fun x => x -- should fail
#check 0
#check f 1 (fun x => x)
#check id have True from ⟨⟩; this -- should fail
#check id let x := 10; x
#check 1
#check id (have True from ⟨⟩; this)
#check 0 = have Nat from 1; this
#check 0 = let x := 0; x
variable (p q r : Prop)
macro_rules | `(¬ $p) => `(Not $p)
#check p ↔ ¬ q
#check True = ¬ False
#check p ∧ ¬q
#check ¬p ∧ q
#check ¬p ↔ q
#check ¬(p = q)
#check ¬ p = q
#check id ¬p
#check Nat → ∀ (a : Nat), a = a
macro "foo!" x:term : term => `($x + 1)
#check id foo! 10 -- error, `foo! x` precedence is leadPrec