computation.spad line 1631 [edit on github]
This domain implements SKI combinators. Ski combinators were introduced by Moses Schoenfinkel and Haskell Curry with the aim of eliminating the need for variables in mathematical logic. It is equivalent to lambda calculus but it can be used for doing, without variables, anything that would require variables in other systems.
return true
if equal (deep search) that is: all terms at all levels in tree must be equal to return true
all terms must be exactly equal, not just equivalent, that is SKK=I will return false
even though 'SKK' and 'I' have the same effect
Constructs a I
combinator
Constructs a K
combinator
Constructs a S
combinator
returns true
if this is an atom, that is a leaf node otherwise return false
if this is a compound term
the variable indicated by 's'
is free if it does not appear in node 'n'
or any of its subnodes.
returns child nodes if this is a compound term otherwise returns []
returns the variable, if this is not a variable then return I
returns true
if this is an I
combinator node
returns true
if this is a K
combinator node
returns true
if this is a S
combinator node
Constructs combinators from a string
parseTerm is used by parseSki. It would rarely be called externally but it is here to allow it to call parseSki that is to allow circular calls
weak reduction - apply this combinator to rearrange its subnodes then apply recursively to its subnodes.
Constructs a node combinator over combinators
Constructs variable combinator
output
returns true
if this is an variable