calling `consult` several times
See original GitHub issueCan you explain what happens when we call consult several times on the same session? Are the rules from the first call erased or not?
Let me illustrate my question by a code example:
session = pl.create()
session.consult(`p(a).`);
session.query(`p(X).`);session.answers(x=>console.log(pl.format_answer(x)), 5);
// X = a ;
Now I am creating rule q(a)
, and the p(a)
rule is still there.:
session.consult(`q(a).`);
session.query(`p(X).`);session.answers(x=>console.log(pl.format_answer(x)), 5);
// X = a ;
But when I create the rule p(b)
, the rule p(a)
is not there any more:
session.consult(`p(b).`);
session.query(`p(X).`);session.answers(x=>console.log(pl.format_answer(x)), 5);
// X = b ;
The question is: why when I am adding p(b)
it erases p(a)
but not when I am adding q(b)
?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
The Fine Art of Calling a Consult - BoardVitals Blog
Always match up the urgency (see above) of the consult with the time of day. This means if the consult is urgent, call...
Read more >How to Call a Consult - REBEL EM - Emergency Medicine Blog
1. Caller is not ready · 2. No clear question · 3. No previous contact · 4. System is overloaded · 5. Known...
Read more >A CONSULT Card and Training to Improve Resident Consults
Trainees believe that consult interactions impact patient care, but important components of the consult call are often missing. Our training and CONSULT card...
Read more >Calling consults | Student Doctor Network
A safe rule of consults is have a quick one sentence question that you are hoping the consult will answer. If the consult...
Read more >Calling a consult: Disrespect from specialists hurts patients
There are a few important things that must occur for a consult to be productive. The person calling the consult: Must carefully select...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
But now I have a different problem. The rules are now duplicated.
I’m not sure that what I am asking makes sense but what I’d like is to keep old rules and to add new rules only when the exact same rule doesn’t exist yet.
The context of all my questions is for the integration of Tau Prolog into Klipse as it is demonstated here.
Each code snippets is pass to a
pl.consult()
call. I want to allow the blog writer to spread the rules among different code snippets.Does it make sense @jariazavalverde ?
In the past, Prolog systems provided both
consult/1
andreconsult/1
predicates with semantics close to what you discussed and implemented here. But the distinction was lost and several systems today implementconsult/1
withreconsult/1
semantics. ISO never standardized a consult predicate, unfortunately.