Closed thahmann closed 6 years ago
@Fxhnd how is a constant stored? Basically right now to get variables I'm doing a dfs, and getting the variables from the predicates and functions. Those are just stored as strings though, so I'm not sure how to differentiate easily.
The solution I thought of was to look at the quantified variables in the axiom. If the variable is not in the list of quantified variables, it must be a constant.
Let me know what you think!
If I'm not mistaken, Rob already added constants to the functions. They are just 0-ary functions. I just don't want to have to places that calculate the constants.
On Mon, Apr 9, 2018, 3:01 PM Evan M. R. Sampson notifications@github.com wrote:
@Fxhnd https://github.com/Fxhnd how is a constant stored? Basically right now to get variables I'm doing a dfs, and getting the variables from the predicates and functions. Those are just stored as strings though, so I'm not sure how to differentiate easily.
The solution I thought of was to look at the quantified variables in the axiom. If the variable is not in the list of quantified variables, it must be a constant.
Let me know what you think!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thahmann/macleod/issues/21#issuecomment-379858380, or mute the thread https://github.com/notifications/unsubscribe-auth/ADm56sgqa2Cd6owmMm7URG8UwHXmYxDzks5tm6--gaJpZM4TCE4J .
@evanmrsampson your method of finding constants is correct. I added a bunch of utility methods to the Axiom class, one of which is the .constants()
method which return the list of constants. There are similar methods for getting quantifiers, predicates, functions, and etc.
They can be found in the commit here.
Added in commit 1183c64d5d59a140358154ed72e7be9a275083c8
in the editor, use the functionality for finding constants from the "ontology object" in the object structure (implemented by @Fxhnd in the DL branch)