Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyze_logicals in Axiom.py crashes the parser when dealing w/ functions #26

Open
evanmrsampson opened this issue Apr 23, 2018 · 1 comment
Assignees

Comments

@evanmrsampson
Copy link
Collaborator

@Fxhnd I pulled the DL changes into the master branch so that I could take advantage of the constants distinction. However, I found that the analyze_logicals method will crash when the axiom has a function in it.

At the moment, I commented out the call to analyze_logicals and left a TODO note above it. At the moment, the editor doesn't know the difference between constants and variables until this works

@carmenchui
Copy link

Just wondering if functions will be supported soon, there are some theories I'm working with that have functions so it'd be preferable if the translation for functions is operational.

Traceback of the current error when trying to do consistency check and translation:

Traceback (most recent call last): File "macleod/gui/gui_beta/gui_main.py", line 260, in check_consistency_command (return_value, fastest_reasoner) = ontology.check_consistency(resolve=True) File "/Users/cchui/Documents/GitHub/macleod/macleod/Ontology.py", line 217, in check_consistency reasoners.constructAllCommands(self) File "/Users/cchui/Documents/GitHub/macleod/macleod/ReasonerSet.py", line 38, in constructAllCommands r.constructCommand(ontology) File "/Users/cchui/Documents/GitHub/macleod/macleod/Reasoner.py", line 65, in constructCommand self.args = commands.get_system_command(self.name, ontology) File "/Users/cchui/Documents/GitHub/macleod/macleod/Commands.py", line 26, in get_system_command return handlers.get(system_name, get_empty_cmd)(ontology) File "/Users/cchui/Documents/GitHub/macleod/macleod/Commands.py", line 39, in get_p9_cmd args.append(clif_converter.convert_single_clif_file(ontology,clif_converter.ladr_output,True)) File "/Users/cchui/Documents/GitHub/macleod/bin/clif_converter.py", line 32, in convert_single_clif_file results = ontology.to_ladr(resolve) File "/Users/cchui/Documents/GitHub/macleod/macleod/Ontology.py", line 204, in to_ladr ladr_output.append(axiom.to_ladr()) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 433, in to_ladr return "{}.".format(ladr_logical(self.sentence)) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 427, in ladr_logical return "({} {})".format(("all {} " * len(logical.variables)).format(*logical.variables), ladr_logical(logical.terms[0])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 423, in ladr_logical return "({})".format(" & ".join([ladr_logical(t) for t in logical.terms])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 423, in <listcomp> return "({})".format(" & ".join([ladr_logical(t) for t in logical.terms])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 425, in ladr_logical return "({})".format(" | ".join([ladr_logical(t) for t in logical.terms])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 425, in <listcomp> return "({})".format(" | ".join([ladr_logical(t) for t in logical.terms])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 410, in ladr_logical return "{}({})".format(logical.name, ",".join([ladr_logical(t) for t in logical.variables])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 410, in <listcomp> return "{}({})".format(logical.name, ",".join([ladr_logical(t) for t in logical.variables])) File "/Users/cchui/Documents/GitHub/macleod/macleod/logical/Axiom.py", line 412, in ladr_logical return "{}({})".format(logical.name, ",".join(logical.variables)) TypeError: sequence item 0: expected str instance, Function found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants