Using grammar, FSM, syntactic tree and DAG for answer to a simple question. There is better ways ; one of them is to code it in lisp.
See gbr.py file for details and explanations.
See interf_data.py file for example of usage for computing a large set of test cases and retrieve their solutions.
usage:
make gbr # run the gbr module
make dat # run the interf_data module
make test # run the unit tests
licence: WTFPL