You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are finding ourselves in situations where we have facts and rules with the same structure but querying them seems to be different. In particular we start out with concrete facts and abstract them into rules. We would like to be able to query a space for both facts an rules transparently -- what's the best way to do this?
Would expect [[john]] for all, but I suppose the last one is empty because the let evaluates (father sally $x) to (child $x sally) which is not in the space.
As expected the second one is empty now, but the last one produces [[john]] because in the absence of a (father ...) rule the expression remains unevaluated and is passed as such to match.
Is my reasoning correct?
The text was updated successfully, but these errors were encountered:
Yes, your reasoning is correct. In the expression (let $q (father billy $x) (match &self $q $x)), $q will always be reduced to (child $x billy), because you have the corresponding equality (= (father $a $b) (child $b $a)), and thus (child $x billy) will be used for querying. In the expression, (match &self (father sally $x) $x), (father sally $x) will not be reduced, because match doesn't reduce its argument (pattern), because it is declared as having the Atom type.
There are different ways to mitigate this issue. Generally speaking, it's not a good idea to mix up functional and triplet representations. You may either have both declarative with additional inference rules, or both functional. In the latter case, you can write something like this:
We are finding ourselves in situations where we have facts and rules with the same structure but querying them seems to be different. In particular we start out with concrete facts and abstract them into rules. We would like to be able to query a space for both facts an rules transparently -- what's the best way to do this?
Some examples
Would expect
[[john]]
for all, but I suppose the last one is empty because thelet
evaluates(father sally $x)
to(child $x sally)
which is not in the space.As expected the second one is empty now, but the last one produces
[[john]]
because in the absence of a(father ...)
rule the expression remains unevaluated and is passed as such tomatch
.Is my reasoning correct?
The text was updated successfully, but these errors were encountered: