v td m
As we've seen that x is true for any x, we can cancel out such tautologies.
For this, we reformat the expression to a list of values of type x or
!x:
}
proc lf'cancel expression {
set e2 [string map {"< " ! "> " ""} [split $expression ""]]
foreach term $e2 {if {$term ne ""} {set a($term) ""}}
set vars [array names a ?]
foreach var $vars {
if [info exists a(!$var)] {
set expression [string map [list <$var> "" $var ""] $expression]
}
}
set expression
}
puts [lf'cancel {c p a n k h v td m}]
if 0 {
which results in:
a
translated back: "I avoid it, or it's not a kangaroo", or, reordered,
" a" which by (4) means, "All kangaroos are avoided by me".
----
Afterthought: See also [NAND] for how all Boolean operations can be constructed out of the single NAND ("not-and") operator.
----
See also http://www.lawsofform.org/ and whatever Google brings up for "Spencer-Brown laws form"
----
[Arts and crafts of Tcl-Tk programming]
}