package lambdaKit.model.util; import lambdaKit.model.term.Abstraction; import lambdaKit.model.term.Pair; import lambdaKit.model.term.Term; /* * The StructureBuilder proposes the building of terms. */ public interface StructureBuilder { /* * Returns a Pair. */ public Pair newPair(Term left, Term rigth); /* * Returns a triplet. */ public Pair newTriplet(Term t1, Term t2, Term t3); /* * Returns an Identity combinator. */ public Abstraction newIdentity(); /* * Returns a boolean combinator that represents the given Boolean values. */ public Abstraction newBoolean(boolean value); /* * K == λxy.x == λ λ 2 */ public Abstraction newTrue(); /* * F == λxy.y == λ λ 1 */ public Abstraction newFalse(); /* * λxyz.xyz */ public Abstraction newIfThenElse(); /* * λxyz.xzy */ public Abstraction newNot(); /* * λxy.x (not y) y */ public Abstraction newXor(); /* * not xor */ public Abstraction newNotXor(); /* * Returns a Church numeral combinator with the given value. * Zero is F. */ public Abstraction newNumeral(int n); /* * Returns a Church numeral which represents the number one. */ public Abstraction newOne(); /* * Returns a Church numeral which represents the number two. */ public Abstraction newTwo(); /* * Returns a Church numeral which represents the number three. */ public Abstraction newThree(); /* * λnfx.f(nfx) */ public Abstraction newIncr(); /* * λmnfx.mf(nfx) */ public Abstraction newAdd(); /* * λmnfx.m(nf)x */ public Abstraction newMult(); /* * λxyz.zxy */ public Abstraction newCouple(); /* * λp.pK */ public Abstraction newFirst(); /* * λp.p(KI) */ public Abstraction newSecond(); /* * λx.fst(x(λp.pair(snd p)(incr(snd p)))(pair 0 0)) */ public Abstraction newDecr(); /* * λxy.y decr x */ public Abstraction newSub(); /* * λx.x (K F) K */ public Abstraction newEq0(); /* * eq0 (sub value1 value2) */ public Abstraction newLessOrEqual(); /* * [n, false] -> [n, true] * [n, true] -> [n + 1, false] */ public Abstraction newAlternance(); /* * Divides by two. */ public Abstraction newDivByTwo(); /* * n -> isOdd(n). */ public Abstraction newOdd(); }