BOOLEAN.LOG 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % Test series for the boolean package.
  3. boolean true;
  4. 1
  5. boolean false;
  6. 0
  7. boolean (true and false);
  8. 0
  9. boolean (true or false);
  10. 1
  11. boolean (x and true);
  12. x
  13. boolean (x and false);
  14. 0
  15. boolean (x or true);
  16. 1
  17. boolean (x or false);
  18. x
  19. boolean (not(x and y));
  20. boolean(not(x) \/ not(y))
  21. boolean (not(x or y));
  22. boolean(not(x)/\not(y))
  23. boolean (x or y or(x and y));
  24. boolean(x \/ y)
  25. boolean (x and y and (x or y));
  26. boolean(x/\y)
  27. boolean (x or (not x));
  28. 1
  29. boolean (x and (not x));
  30. 0
  31. boolean (x and y or not x);
  32. boolean(not(x) \/ y)
  33. boolean (a and b implies c and d);
  34. boolean(not(a) \/ not(b) \/ c/\d)
  35. boolean (a and b implies c and d, and);
  36. boolean((not(a) \/ not(b) \/ c)/\(not(a) \/ not(b) \/ d))
  37. boolean (a or b implies c or d);
  38. boolean(not(a)/\not(b) \/ c \/ d)
  39. boolean (a or b implies c or d, and,full);
  40. boolean((a \/ not(b) \/ c \/ d)/\(not(a) \/ b \/ c \/ d)
  41. /\(not(a) \/ not(b) \/ c \/ d))
  42. operator >;
  43. fm:=boolean(x>v or not (u>v));
  44. fm := boolean(not(u>v) \/ x>v)
  45. v:=10;
  46. v := 10
  47. testbool fm;
  48. ***** u - 10 invalid as number
  49. ***** x - 10 invalid as number
  50. boolean(not(u>10) \/ x>10)
  51. x:=3;
  52. x := 3
  53. testbool fm;
  54. ***** u - 10 invalid as number
  55. boolean(not(u>10))
  56. clear x;
  57. x:=17;
  58. x := 17
  59. testbool fm;
  60. ***** u - 10 invalid as number
  61. 1
  62. clear v,x;
  63. end;
  64. (TIME: boolean 300 300)