aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bool.toytt28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/bool.toytt b/test/bool.toytt
new file mode 100644
index 0000000..c8e62fd
--- /dev/null
+++ b/test/bool.toytt
@@ -0,0 +1,28 @@
+def not : bool -> bool :=
+ \x -> bool-elim x at _ -> bool [
+ true => false,
+ false => true
+ ]
+
+def and : bool -> bool -> bool :=
+ \x -> \y -> bool-elim x at _ -> bool [
+ true => bool-elim y at _ -> bool [
+ true => true,
+ false => false
+ ],
+ false => false
+ ]
+
+def or : bool -> bool -> bool :=
+ \x -> \y -> bool-elim x at _ -> bool [
+ true => true,
+ false => bool-elim y at _ -> bool [
+ true => true,
+ false => false
+ ]
+ ]
+
+def xor : bool -> bool -> bool :=
+ \x -> \y -> or
+ (and x (not y))
+ (and (not x) y)