eyereasoner / eye

Euler Yet another proof Engine
https://eyereasoner.github.io/eye/
MIT License
124 stars 17 forks source link

Variable incorrectly converted to blank node when `log:isImpliedBy` is used in a rule in a graph #77

Closed jeswr closed 1 year ago

jeswr commented 1 year ago

For the following data.n3

@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix : <http://example.org/> .

:s :p {
  { ?a :b1 :c1 } log:isImpliedBy { ?a :b :c } .
} .

{ :s :p ?O } => ?O .
:a :b :c .

{
  :a :b1 :c1 .
} => {
  :yay :a :result .
} .

We get (note the lack of :yay :a :result)

$ npx eyereasoner@latest --nope --quiet --pass-only-new ./data.n3 
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <http://example.org/>.

:s :p {{?U_1 :b1 :c1} log:isImpliedBy {?U_1 :b :c}}.
{_:sk_0 :b1 :c1} log:isImpliedBy {_:sk_0 :b :c}.

However if log:isImpliedBy is replaced with <= then we get

$ npx eyereasoner@latest --nope --quiet --pass-only-new ./badRule4.n3 
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix : <http://example.org/>.

:s :p {{?U_0 :b1 :c1} <= {?U_0 :b :c}}.
{?U_1 :b1 :c1} <= {?U_1 :b :c}.
:yay :a :result.
josd commented 1 year ago

With EYE v3.4.5 (like the sides of a Pythagorean right-angled triangle) it should now declare victory with :yay :a :result.

josd commented 1 year ago

Will add it later to the tests but first get some sleep :-)

josd commented 1 year ago

Added to the eye reasoner examples and test cases as example5 at https://github.com/eyereasoner/eye/tree/master/reasoning/bcrule