Start Code
BoolClass: AC.StructureClass ← NEW[AC.StructureClassRec ← [
category: lattice,
printName: ClassPrintName,
shortPrintName: ClassShortPrintName,
structureEqual: AC.defaultStructureEqualityTest,
isElementOf: AC.defaultElementOfProc,
legalFirstChar: ClassLegalFirstChar,
read: Read,
fromRope: FromRope,
toRope: ToRope,
write: Write,
toExpr: ClassToExpr,
add: Disjunct,
negate: Negate, -- hack,
multiply: Conjunct,
divide: Difference,
booleanAlgebra: TRUE,
complement: Negate,
equal: ClassEqual,
propList: NIL
] ];
Bools: PUBLIC AC.Structure ← NEW[AC.StructureRec ← [
class: BoolClass,
instanceData: NIL
] ];
BoolClass: Object ← AC.MakeClass["BoolClass", NIL, NIL];
Bools: PUBLIC Object ← AC.MakeStructure["Bools", BoolClass, NIL];
True: PUBLIC Object ← FromBOOL[TRUE];
False: PUBLIC Object ← FromBOOL[FALSE];
categoryMethod: Method ← AC.MakeMethod[Value, FALSE, NEW[AC.Category ← lattice], NIL, "category"];
groundStructureMethod: Method ← AC.MakeMethod[Value, FALSE, NIL, NIL, "groundStructure"];
shortPrintNameMethod: Method ← AC.MakeMethod[ToRopeOp, FALSE, NEW[AC.ToRopeOp ← ShortPrintName], NIL, "shortPrintName"];
recastMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Recast], NIL, "recast"];
canRecastMethod: Method ← AC.MakeMethod[BinaryPredicate, TRUE, NEW[AC.BinaryPredicate ← CanRecast], NIL, "canRecast"];
toExprMethod: Method ← AC.MakeMethod[ToExprOp, FALSE, NEW[AC.ToExprOp ← ToExpr], NEW[AC.UnaryToListOp ← AC.DefaultDesiredArgStructures], "toExpr"];
legalFirstCharMethod: Method ← AC.MakeMethod[LegalFirstCharOp, FALSE, NEW[AC.LegalFirstCharOp ← LegalFirstChar], NIL, "legalFirstChar"];
readMethod: Method ← AC.MakeMethod[ReadOp, FALSE, NEW[AC.ReadOp ← Read], NIL, "read"];
fromRopeMethod: Method ← AC.MakeMethod[FromRopeOp, TRUE, NEW[AC.FromRopeOp ← FromRope], NIL, "fromRope"];
toRopeMethod: Method ← AC.MakeMethod[ToRopeOp, FALSE, NEW[AC.ToRopeOp ← ToRope], NIL, "toRope"];
boolMethod: Method ← AC.MakeMethod[FromRopeOp, FALSE, NEW[AC.FromRopeOp ← FromRope], NIL, "bool"];
fromBOOLMethod: Method ← AC.MakeMethod[FromBOOLOp, FALSE, NEW[AC.FromBOOLOp ← FromBOOL], NIL, "fromBOOL"];
parenMethod: Method ← AC.MakeMethod[UnaryOp, FALSE, NEW[AC.UnaryOp ← Paren], NIL, "paren"];
orMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Disjunct], NEW[AC.UnaryToListOp ← AC.DefaultDesiredArgStructures], "or"];
notMethod: Method ← AC.MakeMethod[UnaryOp, TRUE, NEW[AC.UnaryOp ← Negate], NEW[AC.UnaryToListOp ← AC.DefaultDesiredArgStructures], "not"];
differenceMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Difference], NEW[AC.UnaryToListOp ← AC.DefaultDesiredArgStructures], "difference"];
andMethod: Method ← AC.MakeMethod[BinaryOp, TRUE, NEW[AC.BinaryOp ← Conjunct], NEW[AC.UnaryToListOp ← AC.DefaultDesiredArgStructures], "and"];
equalMethod: Method ← AC.MakeMethod[BinaryPredicate, TRUE, NEW[AC.BinaryPredicate ← Equal], NEW[AC.UnaryToListOp ← AC.DefaultDesiredArgStructures], "equals"];
AC.AddMethodToClass[$category, categoryMethod, BoolClass];
AC.AddMethodToClass[$groundStructure, categoryMethod, BoolClass];
AC.AddMethodToClass[$recast, recastMethod, BoolClass];
AC.AddMethodToClass[$shortPrintName, shortPrintNameMethod, BoolClass];
AC.AddMethodToClass[$canRecast, canRecastMethod, BoolClass];
AC.AddMethodToClass[$toExpr, toExprMethod, BoolClass];
AC.AddMethodToClass[$legalFirstChar, legalFirstCharMethod, BoolClass];
AC.AddMethodToClass[$read, readMethod, BoolClass];
AC.AddMethodToClass[$fromRope, fromRopeMethod, BoolClass];
AC.AddMethodToClass[$toRope, toRopeMethod, BoolClass];
AC.AddMethodToClass[$bool, boolMethod, BoolClass];
AC.AddMethodToClass[$fromBOOL, fromBOOLMethod, BoolClass];
AC.AddMethodToClass[$paren, parenMethod, BoolClass];
AC.AddMethodToClass[$or, orMethod, BoolClass];
AC.AddMethodToClass[$not, notMethod, BoolClass];
AC.AddMethodToClass[$difference, differenceMethod, BoolClass];
AC.AddMethodToClass[$and, andMethod, BoolClass];
AC.AddMethodToClass[$eqFormula, equalMethod, BoolClass];
AC.InstallStructure[Bools];