Usage of the extra bias for specifing the clause
Closed this issue · 2 comments
yangdinglou commented
Hello. I want to define some more specific properties in the bias file. I learned from the file alan.pl, but things don't work as I guess. For instance, I want to make sure that
- Two clauses.
- Only one of them contains the predicate q in the body.
So I write the following things in the bias.pl.
:-
not clause(1).
:-
head_literal(1,_,_,_), %%allowing the 0 clause to contain q.
body_literal(_,q,_,_).
But the result seems to show that neither of them contains q predicate. Obviously, the second clause I write makes it failed, but what is the reason? And is there a way to express what I want to restrict?
Thank you.
andrewcropper commented
• Only one of them contains the predicate q in the body.
This constraint should work:
:-
body_literal(Rule1,q,_,_),
body_literal(Rule2,q,_,_),
Rule1 != Rule2.
This constraint prohibits two different rules from having the body literal q.
Does that help?
… On 16 Feb 2022, at 11:44, yangdinglou ***@***.***> wrote:
Hello. I want to define some more specific properties in the bias file. I learned from the file alan.pl, but things don't work as I guess. For instance, I want to make sure that
• Two clauses.
• Only one of them contains the predicate q in the body.
So I write the following things in the bias.pl.
:-
not clause(1).
:-
head_literal(1,_,_,_), %%allowing the 0 clause to contain q.
body_literal(_,q,_,_).
But the result seems to show that neither of them contains q predicate. Obviously, the second clause I write makes it failed, but what is the reason? And is there a way to express what I want to restrict?
Thank you.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
yangdinglou commented
Thanks, it helps a lot. I got the reason.