qlasskit
qlasskit copied to clipboard
py2bexp bool expressions exporter
Create a cli tool in the qlasskit/tools package called py2bexp that receives a python script (file or stdin) in input and outputs bool expressions. The python script should contain at least one qlassf function.
- If not specified by --input-file/-i, read from stdin (-).
- If not specified by --entrypoint/-e, func_name is the last qlassf defined.
- If not specified by --output/-o, output to stdout
- Add a parameter [-f/--form] for specifying the expression form (support all sympy: anf, cnf, dnf, nnf
- Add a parameter [-t/--format] for specifying the output format (default is sympy to_string, supports also dimacs format for cnf https://jix.github.io/varisat/manual/0.2.0/formats/dimacs.html)
py2bexp -i pyfile [-e func_name] -o file
Provide also:
-
-h\--helpfor usage -
-v\--versionfor qlasskit version
Requirements:- Code should be placed on qlasskit/tools
- Use
argparsefor argument parsing - Use
qlasskit.tools.utilsfor getting qlassfs from file / string - A test case must be provided in
test_tools.py - Keep an eye on issue #26
Please read CONTRIBUTING.md before contributing.