Aufgabe:
Tautologien sind immer wahr!
Man zeige: „Be or not to be“ ist eine Tautologie!
http://de.wikipedia.org/wiki/Sein_oder_Nichtsein,_das_ist_hier_die_Frage
Programmcode:
Version 1
n(u):= not u; o(x,y):=x or y; bnb(x):=o(x,n(x)); S:[true,false]; map(bnb,S);
Version 2
n(u):=1-u; o(u,v):=u+v-u*v; bnb(x):=o(x[1],n(x[1])); W:{1,0}; WT:reverse(listify(cartesian_product(W,W))); Result:map(bnb,WT); [transpose(WT),transpose(Result)];
Version 3
n(u):=not u; o(u,v):=u or v; bnb(x):=o(x[1],n(x[1])); W:{true,false}; WT:reverse(listify(cartesian_product(W,W))); Result:map(bnb,WT); [transpose(WT),transpose(Result)];
Maxima-Online: http://maxima-online.org/?inc=r-202349713
Verbesserter Algorithmus: http://maxima-online.org/?inc=r-1341626167
Mit Boolescher Algebra: http://maxima-online.org/?inc=r-197911884