Explicit negation in boolean methods?

1 view
Skip to first unread message

Robert Goldman

unread,
Dec 10, 2025, 9:22:29 PM (4 days ago) Dec 10
to ErgoAI and XSB Users Forum
For boolean methods, is there any way to state that a frame's boolean method has the value false?  Earlier, Michael gave an example of a boolean method returning false (https://groups.google.com/a/coherentknowledge.com/g/ergoai-xsb-forum/c/8WogOXeURKE/m/bi0VW7RsCQAJ), but it appears to rely on negation as failure. Is there a way to explicitly state that a boolean method (property) returns false, without using NAF?

This is a question of interest, rather than being urgent...  A question raised by reading the manual chapter (12) on boolean methods.

Michael Kifer

unread,
Dec 10, 2025, 11:38:48 PM (4 days ago) Dec 10
to ErgoAI-X...@coherentknowledge.com

A Boolean method in Ergo is either true or false, like a predicate is true or false.   It returns no value per se.

What you probably want to do is to define a method of type  YourMeth(...)  =>  Boolean and define 

?x:Boolean :-  isboolean{?x}.

If you want th type of that method to be checked, you can do it by setting up  type constraint  checks.

On 12/10/25 21:22, Robert Goldman wrote:
For boolean methods, is there any way to state that a frame's boolean method has the value false?  Earlier, Michael gave an example of a boolean method returning false (https://groups.google.com/a/coherentknowledge.com/g/ergoai-xsb-forum/c/8WogOXeURKE/m/bi0VW7RsCQAJ), but it appears to rely on negation as failure. Is there a way to explicitly state that a boolean method (property) returns false, without using NAF?

This is a question of interest, rather than being urgent...  A question raised by reading the manual chapter (12) on boolean methods.
--
You received this message because you are subscribed to the Google Groups "ErgoAI and XSB Users Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ErgoAI-XSB-for...@coherentknowledge.com.
To view this discussion visit https://groups.google.com/a/coherentknowledge.com/d/msgid/ErgoAI-XSB-forum/4963cbac-f8e8-4197-a75c-6748e6f75fden%40coherentknowledge.com.

Robert Goldman

unread,
Dec 11, 2025, 1:57:20 PM (3 days ago) Dec 11
to ErgoAI and XSB Users Forum, Michael Kifer
I think I wasn't clear enough.  The manual gives this example:

John[is_tall].

as a way of saying "John is tall."  How do I say that "Bill is not tall"?  Is not saying "Bill is tall" (NAF) the only way to do that?

Thanks,
R

Michael Kifer

unread,
Dec 12, 2025, 3:10:49 AM (3 days ago) Dec 12
to Robert Goldman, ErgoAI and XSB Users Forum

you can state

\neg John[is_tall].

or even  

John[\neg is_tall].

But the method is_tall doesn't have any  values (truth values or other)  by itself. Rather, the statement  John[is_tall]  may be true, false, or undefined. So, you can use Boolean methods or methods that return actual values, like

John[is_tall -> yes].

Here is_tall does have a value AND the statement   John[is_tall -> yes] might be true, false or undefined.

Or you can use

John[is_tall-> \true]  (or \false) and there are thousands of other suitable alternatives. You need to choose what suits you best  in each concrete modeling situation and commit to that style.

-- michael

Robert Goldman

unread,
Dec 12, 2025, 9:04:20 AM (3 days ago) Dec 12
to Michael Kifer, ErgoAI and XSB Users Forum
Thank you, Michael! The negated statements were something I had not thought of. Would you consider adding these examples to the manual?
Reply all
Reply to author
Forward
0 new messages