Skip to content
trans edited this page Feb 8, 2013 · 2 revisions

Set Logic

Fire uses a special kind of logic which is essentially set logic, but slightly modified to also handle Boolean values. It does this by converting false to empty set, i.e. [], and extending true to be a permissive set --that is to say, it always defers to the set to which it is being compared. (Note: If it proves problematic to extend TrueClass in this way, we will create a new special class for the purpose instead.)

The following is a series of logic examples along with the key on how to interpret the symbols.

Key

t = true        a = ['foo']
f = []          b = ['bar']

Operators

AND (&)

t & t -> t
t & f -> f
f & t -> f
f & f -> f

t & a -> a
a & t -> a

f & a -> f
a & f -> f

a & a -> a
a & b -> f
b & a -> f

OR (|)

t | t -> t
t | f -> t
f | t -> t
f | f -> f

t | a -> a
a | t -> a

f | a -> a
a | f -> a

a | a -> a
a | b -> [*a,*b]
a | a -> [*b,*a]
Clone this wiki locally