aboutsummaryrefslogtreecommitdiffhomepage
path: root/std/Logic.bruijn
diff options
context:
space:
mode:
Diffstat (limited to 'std/Logic.bruijn')
-rw-r--r--std/Logic.bruijn56
1 files changed, 28 insertions, 28 deletions
diff --git a/std/Logic.bruijn b/std/Logic.bruijn
index 4174712..94e737d 100644
--- a/std/Logic.bruijn
+++ b/std/Logic.bruijn
@@ -9,17 +9,17 @@ true K
false KI
# inverts boolean value
-not [0 false true]
+not! [0 false true]
-!( not
+!( not!
:test (!true) (false)
:test (!false) (true)
# true if both args are true
-and [[1 0 false]]
+and? [[1 0 false]]
-(&&) and
+(&&) and?
:test (true && true) (true)
:test (true && false) (false)
@@ -27,17 +27,17 @@ and [[1 0 false]]
:test (false && false) (false)
# true if not both args are true
-nand [[1 0 1 false true]]
+nand? [[1 0 1 false true]]
-:test (nand true true) (false)
-:test (nand true false) (true)
-:test (nand false true) (true)
-:test (nand false false) (true)
+:test (nand? true true) (false)
+:test (nand? true false) (true)
+:test (nand? false true) (true)
+:test (nand? false false) (true)
# true if one of the args is true
-or [[1 true 0]]
+or? [[1 true 0]]
-(||) or
+(||) or?
:test (true || true) (true)
:test (true || false) (true)
@@ -45,28 +45,28 @@ or [[1 true 0]]
:test (false || false) (false)
# true if both args are false
-nor [[1 1 0 false true]]
+nor? [[1 1 0 false true]]
-:test (nor true true) (false)
-:test (nor true false) (false)
-:test (nor false true) (false)
-:test (nor false false) (true)
+:test (nor? true true) (false)
+:test (nor? true false) (false)
+:test (nor? false true) (false)
+:test (nor? false false) (true)
# true if args are not same bools
-xor [[1 (not 0) 0]]
+xor? [[1 !0 0]]
-:test (xor true true) (false)
-:test (xor true false) (true)
-:test (xor false true) (true)
-:test (xor false false) (false)
+:test (xor? true true) (false)
+:test (xor? true false) (true)
+:test (xor? false true) (true)
+:test (xor? false false) (false)
# true if both args are same bools
-xnor [[1 0 (not 0)]]
+xnor? [[1 0 !0]]
-:test (xnor true true) (true)
-:test (xnor true false) (false)
-:test (xnor false true) (false)
-:test (xnor false false) (true)
+:test (xnor? true true) (true)
+:test (xnor? true false) (false)
+:test (xnor? false true) (false)
+:test (xnor? false false) (true)
# if first arg is true, exec first exp; else second exp
# this function is generally redundant
@@ -81,7 +81,7 @@ if [[[2 1 0]]]
:test ((false ?! true) false) (false)
# mathematical implies definition
-implies [[or (not 1) 0]]
+implies [[!1 || 0]]
(=>?) implies
@@ -91,7 +91,7 @@ implies [[or (not 1) 0]]
:test (false =>? false) (true)
# mathematical iff (if and only if) definition
-iff [[and (implies 1 0) (implies 0 1)]]
+iff [[(1 =>? 0) && (0 =>? 1)]]
(<=>?) iff