Just in case you want generate a random tautology, you can find python code to do so at: http://pastie.org/933675. It’s actually pretty sweet – it won’t generate all true statements, but it will generate all tautologies of a given depth. Also, it has some clever hacks that allow it to be random (instead of true) if it can get away with it. Consider the case of true OR b. In that case, it is totally okay for b to be false, and the algorithm respects that. The true tautology I generated (and am using for a tree visualization library) is: (and (not (and (not (or (or 1 1) (not 1))) (or (and (not 1) (and 0 0)) (or (or 1 1) (or 1 0))))) (not (and (and (or (not 1) (and 0 1)) (and (or 0 0) (or 1 1))) (or (or (and 1 0) (and 0 1)) (or (and 1 1) (or 0 0)))))), which I am very glad I did not have to come up with by hand.

Fun question for others to answer: Will this alternative generator also generate all possible trees of a given depth?