| 1 |
project('logicopts') |
| 2 |
|
| 3 |
t = true |
| 4 |
f = false |
| 5 |
|
| 6 |
if (true) |
| 7 |
message('Ok.') |
| 8 |
else |
| 9 |
error('Not ok.') |
| 10 |
endif |
| 11 |
|
| 12 |
if (false) |
| 13 |
error('Not ok.') |
| 14 |
else |
| 15 |
message('Ok.') |
| 16 |
endif |
| 17 |
|
| 18 |
if (f) |
| 19 |
error('Not ok.') |
| 20 |
else |
| 21 |
message('Ok.') |
| 22 |
endif |
| 23 |
|
| 24 |
if (t) |
| 25 |
message('Ok.') |
| 26 |
else |
| 27 |
error('Not ok.') |
| 28 |
endif |
| 29 |
|
| 30 |
if true and t |
| 31 |
message('Ok.') |
| 32 |
else |
| 33 |
error('Not ok.') |
| 34 |
endif |
| 35 |
|
| 36 |
if t and false |
| 37 |
error('Not ok.') |
| 38 |
else |
| 39 |
message('Ok.') |
| 40 |
endif |
| 41 |
|
| 42 |
if f and t |
| 43 |
error('Not ok.') |
| 44 |
else |
| 45 |
message('Ok.') |
| 46 |
endif |
| 47 |
|
| 48 |
if f or false |
| 49 |
error('Not ok.') |
| 50 |
else |
| 51 |
message('Ok.') |
| 52 |
endif |
| 53 |
|
| 54 |
if true or f |
| 55 |
message('Ok.') |
| 56 |
else |
| 57 |
error('Not ok.') |
| 58 |
endif |
| 59 |
|
| 60 |
if t or true |
| 61 |
message('Ok.') |
| 62 |
else |
| 63 |
error('Not ok.') |
| 64 |
endif |
| 65 |
|
| 66 |
if not true |
| 67 |
error('Negation failed.') |
| 68 |
else |
| 69 |
message('Ok.') |
| 70 |
endif |
| 71 |
|
| 72 |
if not f |
| 73 |
message('Ok.') |
| 74 |
else |
| 75 |
error('Negation failed.') |
| 76 |
endif |
| 77 |
|
| 78 |
|
| 79 |
if f or f or f or f or f or f or f or f or t |
| 80 |
message('Ok.') |
| 81 |
else |
| 82 |
error('Chain of ors failed.') |
| 83 |
endif |
| 84 |
|
| 85 |
if t and t and t and t and t and t and t and t and f |
| 86 |
error('Chain of ands failed.') |
| 87 |
else |
| 88 |
message('Ok.') |
| 89 |
endif |
| 90 |
|
| 91 |
if t and t or t |
| 92 |
message('Ok.') |
| 93 |
else |
| 94 |
error('Combination of and-or failed.') |
| 95 |
endif |