Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate clauses of which #43

Open
vale1410 opened this issue Mar 8, 2022 · 1 comment
Open

Generate clauses of which #43

vale1410 opened this issue Mar 8, 2022 · 1 comment

Comments

@vale1410
Copy link
Owner

vale1410 commented Mar 8, 2022

The following program should not generate any unit clauses:

#ground f[1],f[2],f[3]. 
f[X] :: var(X). 

Bule grounds this to:

Warning. Undeclared variables: var(1) var(2) var(3)

 var(1).
 var(2).
 var(3).

It's good that it notifies that clauses are generated of which no variables are introduced.
In my opinion it should not generate the clauses at all.

For example:

#ground f[1],f[2].     
f[X] :: #exists[0] foo(X).  
f[X] :: bar(X) | foo(X). 

In my opinion it should not generate the clauses.

Alternative option: it generates the clauses with the atoms that have been introduced.

@AbdallahS
Copy link
Collaborator

I like the current approach with a warning and printing the clauses anyway because seeing what is being generated can help one see in which clause type the undeclared variable is being used. If it just printed "undeclared variable xyz" then the user would need to mentally perform the grounding to identify the offending rule.

Furthermore, some debugging techniques, like adding a debug literal, would be made heavier if the user also had to declare the debug variable each time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants