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

Unintuitive wellformedness warnings for fact usage #597

Open
kevinmorio opened this issue Sep 27, 2023 · 2 comments
Open

Unintuitive wellformedness warnings for fact usage #597

kevinmorio opened this issue Sep 27, 2023 · 2 comments

Comments

@kevinmorio
Copy link
Contributor

When checking the fact usage (capitalization, arity, multiplicity) facts in the LHS and RHS of rules as well as action facts are included leading to unintuitive wellformedness warnings.

For example, the theory

theory FactUsage
begin

rule Init:
  [] --[ Init() ]-> [ !Init() ]

end

produces the warning:

/*
WARNING: the following wellformedness checks failed!

Fact usage
==========

Possible reasons: 
1. Fact names are case-sensitive, different capitalizations are considered as different facts, i.e., Fact() is different from FAct(). Check the capitalization of your fact names.
2. Same fact is used with different arities, i.e., Fact('A','B') is different from Fact('A'). Check the arguments of your facts.
 
  
Fact `init':

  1. Rule `Init', capitalization  "Init", 0, Persistent
       !Init( )
  
  2. Rule `Init', capitalization  "Init", 0, Linear
       Init( )
*/

Intuitively, action facts and facts on the LHS and RHS should be compared separately as they are independent from each other.
Moreover, reason 1 above can be ruled out as the capitalization is the same.

@jdreier
Copy link
Member

jdreier commented Sep 28, 2023

I think there are two points here:

  1. The warning messages could be more precise: at least, a add remark that this check also checks for persistence, or even, for each issue, give the exact warning, rather then the current generic message ("possible reasons") followed by a list of all issues
  2. Should we treat action facts differently, or not?

@rsasse
Copy link
Member

rsasse commented Oct 8, 2023

On 2: semantically they are of course different, however I have seen many novice users confuse themselves when using the same fact name for actions and state facts. This warning does not help them though, so I am undecided on changing.

Being more precise in the actual warning given, when capitalization is identical, would be good. It will still be a problem when there are three instances, two are capitalized the same, but third is not, then it must be shown and has the same downside about not being relevant for all.

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

3 participants