| 1 |
** -*- Mode:CafeOBJ -*- |
| 2 |
** system: Chaos |
| 3 |
** module: library |
| 4 |
** file: bool-af.mod |
| 5 |
** ------------------------------------------------------------- |
| 6 |
-- modified by KF101227 |
| 7 |
|
| 8 |
** |
| 9 |
** modified by T.SWD 20120828, adapting to new feature 'set BOOL = xxx' |
| 10 |
** |
| 11 |
** "set BOOL = <path to this file>" |
| 12 |
** will make system to load this definition of BOOL instead of builtin BOOL. |
| 13 |
|
| 14 |
** ------------------------------------------------------------- |
| 15 |
** MODULE BOOL |
| 16 |
** |
| 17 |
mod! BOOL |
| 18 |
principal-sort Bool |
| 19 |
{ |
| 20 |
-- we must import system provided BOOL signature |
| 21 |
|
| 22 |
including(BASE-BOOL) |
| 23 |
|
| 24 |
** NOTE: |
| 25 |
-- we can also introduce additional new Boolean operators here. |
| 26 |
-- but they will not be supported by TRAM or PigNose. |
| 27 |
|
| 28 |
-- the followings are |
| 29 |
|
| 30 |
vars P Q R : Bool |
| 31 |
|
| 32 |
eq[notT]: not true = false . |
| 33 |
eq[notF]: not false = true . |
| 34 |
eq[not2]: not not P = P . |
| 35 |
|
| 36 |
eq[andT]: P and true = P . |
| 37 |
eq[andF]: P and false = false . |
| 38 |
eq[and2]: P and P = P . |
| 39 |
|
| 40 |
eq[orT]: P or true = true . |
| 41 |
eq[orT]: P or false = P . |
| 42 |
eq[or2]: P or P = P . |
| 43 |
|
| 44 |
eq[Taa']: (true and-also Q) = Q . |
| 45 |
eq[Faa']: (false and-also Q) = false . |
| 46 |
eq[aaT']: (P and-also true) = P . |
| 47 |
eq[aaF']: (P and-also false) = false . |
| 48 |
|
| 49 |
eq[Toe']: (true or-else Q) = true . |
| 50 |
eq[Foe']: (false or-else Q) = Q . |
| 51 |
eq[oeT']: (P or-else true) = true . |
| 52 |
eq[oeF']: (P or-else false) = P . |
| 53 |
|
| 54 |
eq[Timp']: (true implies Q) = Q . |
| 55 |
eq[Fimp']: (false implies Q) = true . |
| 56 |
eq[impT']: (P implies true) = true . |
| 57 |
eq[impF']: (P implies false) = not P . |
| 58 |
|
| 59 |
eq[xorF]: P xor false = P . |
| 60 |
eq[xor2]: P xor P = false . |
| 61 |
|
| 62 |
eq[iffT]: P iff true = P . |
| 63 |
eq[iff2]: P iff P = true . |
| 64 |
|
| 65 |
-- specific to AF |
| 66 |
eq[notIFF]: not P = P iff false . |
| 67 |
eq[orAF]: P or Q = P iff Q iff (P and Q) . |
| 68 |
eq[impAF']: P implies Q = (P and Q) iff P . |
| 69 |
eq[xorNF]: P xor Q = not(P iff Q) . |
| 70 |
eq[distAF]: P and (Q iff R) = (P and Q) iff (P and R) iff P . |
| 71 |
|
| 72 |
} |
| 73 |
|
| 74 |
eof |