Propositional logic in Python
Propositional logic inference via compressed truth tables. Module
entail is presumably slower than your industrial-grade C inference algorithm, but logical statements are given as Python expressions, and entailment can be checked at the interactive prompt. This makes the module easy to use, and fun. (Source Code).

2 Comments:
Example usage
>>> S = AssumptionSet()
>>> S.assume('a => b')
>>> S.assume('b => c')
>>> S.assume('c => a')
>>> S.implies('a <=> b')
True
>>> S.implies('a')
False
>>> S.assume('a')
>>> S.implies('c')
True
See also my post "intelligent minesweeper" [1], based on this module.
Post a Comment
<< Home