Clause

0 views
Skip to first unread message

Rangarajan Krishnamoorthy

unread,
Nov 19, 2018, 5:46:01 AM11/19/18
to ErgoAI, Flora-2, and XSB Users Forum
Hi,
I am trying to understand the "clause{}" construct.

Here is my code:
X [| value -> 10 |].
Y [| value -> 100 |].

\udf valueOf(?a^^X) := ?result \if ?result \is ?a.value + 1.

\udf valueOf(?a^^Y) := ?result \if ?result \is ?a.value + 2.

The query:
clause{@!{?id[type -> udf]} ?h, ?b}. // (1)
returns both UDF objects as expected.

But the query:
clause{@!{?id[type -> udf]} (valueOf(?a) := ?), ?}. // (2)
returns just the first UDF, while
clause{@!{?id[type -> udf]} (valueOf(?a^^X) := ?), ?}. // - (3)
returns none (fails with 'No').

Can you explain the difference in behavior?

Regards,
Rangarajan

Michael Kifer

unread,
Nov 19, 2018, 5:20:40 PM11/19/18
to ErgoAI, Flora-2, and XSB Users Forum
The issue with query 2 (not returning the second answer) is a bug that will be fixed soon.

The issue with query 3 is harder to fix 100%. Most likely we'll just ignore the ^^X part and #3 will behave like #2 (after fixing #2).
Reply all
Reply to author
Forward
0 new messages