Python Propositions

This is a small package for propositional logic --- it provides a few tools for representing and playing around with propositional logic objects. For now, it contains a parser to build AST trees out of most propositional phrases:

    >>> import parser
    >>> print parser.parse('jack and jill and bill or ted')
    or[and[and[jack, jill], bill], ted]
as well as a silly algorithm for turning propositions into a set of states:
    >>> import algorithm
    >>> algorithm.getTrueStates(
    ...     parser.parse('2b or not 2b implies question'))
    [{'2b': 'T', 'question': 'T'}, {'2b': 'F', 'question': 'T'}]
As you might guess, it's nowhere near done yet. Still, it might be useful for someone, so I'm putting up my work up before I forget.

The README in the package has more details about this. I must learn how to properly document Python packages with the doc-sig tools...


Back to Python.