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

Variables not correctly recognized as functions #72

Open
Regermeister opened this issue Nov 9, 2021 · 5 comments
Open

Variables not correctly recognized as functions #72

Regermeister opened this issue Nov 9, 2021 · 5 comments

Comments

@Regermeister
Copy link

Consider the following two formulas from Merge.kif:

(=>
  (and
    (instance ?FUNCTION UnitOfMeasureMultiplier)
    (instance ?UNIT CompositeUnitOfMeasure))
  (instance (?FUNCTION ?UNIT) CompositeUnitOfMeasure))

(=>
  (and
    (instance ?FUNCTION UnitOfMeasureMultiplier)
    (instance ?UNIT NonCompositeUnitOfMeasure))
  (instance (?FUNCTION ?UNIT) NonCompositeUnitOfMeasure))

From what I can tell, kb.isFunctional does explicitly consider the case of a variable in the car position, but the context of the variable's typing gets lost when formulas are examined recursively, which is why calling isFunctional on the (?FUNCTION ?UNIT) part will always return false. (At least I think that's what's happening here.)

This affects (probably among other things) the translation to TPTP when holdsPrefix is turned on, where said sub-formula is translated to s__holds_2__(V__FUNCTION,V__UNIT) as opposed to s__apply_2__(V__FUNCTION,V__UNIT).

From what I can tell, these 2 formulas are the only one affected.

@apease
Copy link
Contributor

apease commented Nov 9, 2021

holdsPrefixing is deprecated, since predicate variable substitution is a much higher performance solution in inference. I recommend running with , but, that said, you're right that isFunction() doesn't check for a Function variable and that would be a good special case to check. I'll see if I can do that. Very good catch!

@Regermeister
Copy link
Author

holdsPrefixing is deprecated, since predicate variable substitution is a much higher performance solution in inference.

I see. For future reference, is there somewhere I can check for settings being deprecated?

I recommend running with ,

Did you mean to type "running with predicate variable substitution" or is there something else?

@apease
Copy link
Contributor

apease commented Nov 9, 2021

oops GitHub removed the XML I included

<preference name="holdsPrefix" value="no" />

I talk about holds prefixing in my book and papers but don't think I have a warning message for it. I'll add that

@Regermeister
Copy link
Author

I see. Thank you

@apease
Copy link
Contributor

apease commented Nov 9, 2021

pushed a fix that now prints a warning of holdsPrefix is set to "yes"

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

2 participants