-
Notifications
You must be signed in to change notification settings - Fork 18
Some built-in predicates such as log:conclusion
transform backward rules into forward during output binding
#134
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
Comments
Logically speaking there is nothing broken when converting a backward rule into a forward rule, but it is indeed messy. For the moment I have simplified
|
Thank you for your effort! And can the An interesting use case: I managed to implement the operation of importing other files in N3:
Place these three files in the same directory, then executing This is just one example, but implementing this would be useful in many places. |
Should be fixed and now we get
|
Appreciate your help in solving this! |
I found In the newest version (v11.7.5), the output of my first test case has changed again:
The output of second test case (import_demo1/2/3.n3) has also changed back. Reinstalling version 11.6.0 find it works fine, not sure which update in between broke this fix. And I also noticed although v11.6.3 made
|
Let me explain what I want to do: I want to perform reasoning inside a graph, also called inline inference. Specifically, I want to create a predicate similar to
eye —pass-only-new
command, receive a graph as subject, and outputs (binding to object) only the new conclusions asserted after reasoning within the graph.Here's my first try:
The expected output is:
The actual output is:
Besides the strange sentences of the form
true => {...}
, there is also{ ?U_1 math:greaterThan 0. } => { ?U_1 a :PostiveNum. }
, which is outside of my expectation .So, I did some test, and found that
log:conclusion
andlog:inference
incorrectly convert backward rules into forward form in their output (i.e., the bound object ), which causes subsequent processing issues. Nevertheless, they somehow correctly executed the logic of the backward rule, producing:test2 a :succeed
.Namely:
in my context would yield:
I also attempted to remove sentences of the form
true => {...}
, leading to my second version:But this does not work because elements in
?list
are appears in the form?sth <= true
, rather than the expectedtrue => ?sth
. This is another bug.Through some experiments, I have found that many built-in predicates have similar problems with backward rules:
log:semantics
, when reading other files, transforms backward rules into forward ones. Interestingly, this does not happen when it reads itself (<> log:semantics ?x
).log:parsedAsN3
has the same issue.e:findall
, as mentioned above, turned forward rules of only the formtrue => {:s :p :o}
into backward. Compared to the previous problem this is a minor issue.On the other hand,
log:include
ande:graphMember
able to distinguish between forward and backward rules correctly (even syntactically incorrect forms like:g1 => :g2
and:g1 <= true
), seems treating them as ordinary triples, which is my expectation. Here is a simple example:output:
The text was updated successfully, but these errors were encountered: