thahmann / macleod

Ontology development environment for Common Logic (CL)
Other
23 stars 9 forks source link

Consolidate distinction between constants and variables #21

Closed thahmann closed 6 years ago

thahmann commented 6 years ago

in the editor, use the functionality for finding constants from the "ontology object" in the object structure (implemented by @Fxhnd in the DL branch)

evanmrsampson commented 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!

thahmann commented 6 years ago

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 .

Fxhnd commented 6 years ago

@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.

evanmrsampson commented 6 years ago

Added in commit 1183c64d5d59a140358154ed72e7be9a275083c8