We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70859cd commit b7c22e8Copy full SHA for b7c22e8
1 file changed
Inhabit/Logic/Prop.lean
@@ -0,0 +1,18 @@
1
+-- Syntax
2
+inductive PropLang where
3
+ | Var (name : String)
4
+ | Not (a : PropLang)
5
+ | And (a b : PropLang)
6
+ | Or (a b : PropLang)
7
+
8
+-- Semantics
9
+abbrev PropInterp := String → Bool
10
11
+def List.interp (l : List String) : PropInterp := l.contains
12
13
+def prop_eval (f : PropLang) (i : PropInterp) : Bool :=
14
+ match f with
15
+ | .Var name => i name
16
+ | .Not a => not (prop_eval a i)
17
+ | .And a b => and (prop_eval a i) (prop_eval b i)
18
+ | .Or a b => or (prop_eval a i) (prop_eval b i)
0 commit comments