|
|
Wahrheitsfunktionen
Definition der Funktion pbv ("PrintBooleanValue"):
> |
pbv:= proc (p):
if p = true then "T" else "F" fi
end: |
Die Boole'schen Operatoren not, and, or, xor und implies:
> |
Not:= proc (p) not p end:
And:= proc (p, q) p and q end:
Or:= proc (p, q) p or q end:
Xor:= proc (p, q) p xor q end:
Imp:= proc (p, q) p implies q end:
Aeq:= proc (p, q) (p implies q) and (q implies p) end: |
Definition der Struktur einer Wahrheitstabelle:
> |
fst:= " %s %s %s\n": # Formatstring
Tabelle:= proc (bool, wf) local p, q:
printf (" p q p %s q\n\n", bool);
for p in [true, false] do
for q in [true, false] do
printf (fst, pbv(p), pbv(q), pbv(wf(p, q)));
od
od
end: |
Die Konjunktion zweier Aussagen p und
q (Verknüpfung mit and: "p und q"):
| |
p |
q |
p and q |
| |
|
|
|
| |
T |
T |
T |
| |
T |
F |
F |
| |
F |
T |
F |
| |
F |
F |
F |
Die Alternation zweier Aussagen p und q
(Verknüpfung mit or: "p oder q" ):
| |
p |
q |
p or q |
| |
|
|
|
| |
T |
T |
T |
| |
T |
F |
T |
| |
F |
T |
T |
| |
F |
F |
F |
Das Konditional der Aussagen p und q
(Verknüpfung mit implies: "wenn p, dann q"):
> |
Tabelle ("implies", Imp); |
| |
p |
q |
p implies q |
| |
|
|
|
| |
T |
T |
T |
| |
T |
F |
F |
| |
F |
T |
T |
| |
F |
F |
T |
Das Bi-Konditional der Aussagen p und q ("p ist äquivalent zu q"):
| |
p |
q |
p
aequ q |
| |
|
|
|
| |
T |
T |
T |
| |
T |
F |
F |
| |
F |
T |
F |
| |
F |
F |
T |
|