Question about unsafe variables warning

15 views
Skip to first unread message

Robert Goldman

unread,
Aug 5, 2026, 12:23:27 PM (11 days ago) Aug 5
to ErgoAI and XSB Users Forum
Is there anything available about handling unsafe variables warnings in ErgoAI?

I get these warnings, it seems, for just about every rule that contains \naf.

I'm not sure what is the right way to address them.  I don't see an obvious way to indicate when a rule's parameters must/must not/may be bound, which seems necessary for Ergo to determine when a variable is likely to be bound.  Similarly, can the compiler reason about whether or not a conjunct appearing before a \naf conjunct is guaranteed to bind a variable before the negated predicate is invoked? And, even if so, how does that interact with Ergo's freedom to reorder conjuncts?

Theresa Swift

unread,
Aug 7, 2026, 9:34:53 AM (9 days ago) Aug 7
to Robert Goldman, ErgoAI and XSB Users Forum
I'm not sure of all the details of the ErgoAI compiler, but there are several kinds of unsafe variable warnings, including unbound variables in the head of a rule (which can be easily fixed using an underscore) as well as \naf.  My understanding is that the ErgoAI warning for \naf should occur only if a variable within the \naf has its first occurrence in a clause.  Even in that case, the \naf will be delayed during execution until it is ground, and the truth value will become undefined if it never becomes ground.  

I don't know if you've seen the TPLP version of our ErgoAI paper which can be found on ArXiv.  We explain some of the actions on nonground negation in one of the later chapters -- if you're interested.

Theresa

--
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/679a604c-502b-493d-bcae-2571c8d1c055n%40coherentknowledge.com.
Reply all
Reply to author
Forward
0 new messages