Unsafe variable warning in ErgoAI

4 views
Skip to first unread message

Robert Goldman

unread,
Aug 5, 2025, 3:39:12 PMAug 5
to ErgoAI and XSB Users Forum
What does this warning mean?  I know what it means to get a singleton variable warning, but what makes a variable unsafe in Ergo?
Thanks

Michael Kifer

unread,
Aug 5, 2025, 4:41:50 PMAug 5
to Robert Goldman, ErgoAI and XSB Users Forum
An unsafe var in LP and DBs is one that appears in a rule head, but not in the body of the corresponding rule.
The semantics of such rules is iffy especially when one starts  applying  negation to subgoals  that have such variables.

Aug 5, 2025 15:39:14 Robert Goldman <rpgo...@gmail.com>:

What does this warning mean?  I know what it means to get a singleton variable warning, but what makes a variable unsafe in Ergo?
Thanks

--
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/499d1a06-9e61-4c9f-aca7-6d764bcdf840n%40coherentknowledge.com.

Robert Goldman

unread,
Aug 6, 2025, 12:33:45 PMAug 6
to ErgoAI and XSB Users Forum, Michael Kifer, ErgoAI and XSB Users Forum, Robert Goldman
Thank you, Michael.  Perhaps surprisingly "unsafe variable logic programming" and related are not good search terms. No matter what I tried, I could only get back discussions of singleton variable warnings.

I had never seen a warning like this before, and only saw it now because I had automatically-generated rules (from an ILP system).  And it was hard for me to diagnose, because the rules were injected into Ergo through pyergo, so had no line numbers to identify them.

This might be good to put in the FAQ.  Maybe an entry on "What do Ergo warning messages mean?"  You could pretty much cut and paste your email explanation in there for unsafe variables; it's very clear.

Best,
R

Michael Kifer

unread,
Aug 6, 2025, 2:24:05 PMAug 6
to Robert Goldman, ErgoAI and XSB Users Forum
Yes, it is better recognized in the area of deductive databases and usually comes as part the notion of safe rules.
In LP, the safety check is underappreciated because the most famous example - append/3 - relies on unsafe variables.

Michael

Aug 6, 2025 12:33:46 Robert Goldman <rpgo...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages