aboutsummaryrefslogtreecommitdiffhomepage
path: root/std/Logic.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2023-02-23 02:16:29 +0100
committerMarvin Borner2023-02-23 02:16:29 +0100
commit0cb2b27268b637f5f87c797ba3982f64ec4bbd4c (patch)
treeeae3d7b13dc1fdb77a14a4eaf0dccacae91447c4 /std/Logic.bruijn
parentba815db7870e9c5cc416ff485a1f3ceca90c2765 (diff)
Added more types
Diffstat (limited to 'std/Logic.bruijn')
-rw-r--r--std/Logic.bruijn24
1 files changed, 12 insertions, 12 deletions
diff --git a/std/Logic.bruijn b/std/Logic.bruijn
index 06a08eb..e6f205c 100644
--- a/std/Logic.bruijn
+++ b/std/Logic.bruijn
@@ -3,14 +3,14 @@
:import std/Combinator .
# true
-true k
+true k ⧗ Boolean
# false
-false ki
+false ki ⧗ Boolean
# inverts boolean value
# equivalent of [0 ⇒ false]
-not! [0 false true]
+not! [0 false true] ⧗ Boolean → Boolean
¬‣ not!
@@ -18,7 +18,7 @@ not! [0 false true]
:test (¬false) (true)
# true if both args are true
-and? [[1 0 false]]
+and? [[1 0 false]] ⧗ Boolean → Boolean → Boolean
…⋀?… and?
@@ -28,7 +28,7 @@ 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]] ⧗ Boolean → Boolean → Boolean
:test (nand? true true) (false)
:test (nand? true false) (true)
@@ -36,7 +36,7 @@ nand? [[1 0 1 false true]]
:test (nand? false false) (true)
# true if one of the args is true
-or? [[1 true 0]]
+or? [[1 true 0]] ⧗ Boolean → Boolean → Boolean
…⋁?… or?
@@ -46,7 +46,7 @@ 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]] ⧗ Boolean → Boolean → Boolean
:test (nor? true true) (false)
:test (nor? true false) (false)
@@ -54,7 +54,7 @@ nor? [[1 1 0 false true]]
:test (nor? false false) (true)
# true if args are not same bools
-xor? [[1 ¬0 0]]
+xor? [[1 ¬0 0]] ⧗ Boolean → Boolean → Boolean
:test (xor? true true) (false)
:test (xor? true false) (true)
@@ -62,7 +62,7 @@ xor? [[1 ¬0 0]]
:test (xor? false false) (false)
# true if both args are same bools
-xnor? [[1 0 ¬0]]
+xnor? [[1 0 ¬0]] ⧗ Boolean → Boolean → Boolean
:test (xnor? true true) (true)
:test (xnor? true false) (false)
@@ -72,7 +72,7 @@ xnor? [[1 0 ¬0]]
# if first arg is true, exec first exp; else second exp
# this function is generally redundant
# I personally just write (exp? case-T case-F) directly
-if [[[2 1 0]]]
+if [[[2 1 0]]] ⧗ Boolean → a → b → c
…?…:… if
@@ -82,7 +82,7 @@ if [[[2 1 0]]]
:test (false ? true : false) (false)
# mathematical implies definition
-implies [[¬1 ⋁? 0]]
+implies [[¬1 ⋁? 0]] ⧗ Boolean → Boolean → Boolean
…⇒?… implies
@@ -92,7 +92,7 @@ implies [[¬1 ⋁? 0]]
:test (false ⇒? false) (true)
# mathematical iff (if and only if) definition
-iff [[(1 ⇒? 0) ⋀? (0 ⇒? 1)]]
+iff [[(1 ⇒? 0) ⋀? (0 ⇒? 1)]] ⧗ Boolean → Boolean → Boolean
…⇔?… iff