CHR # operator

52 views
Skip to first unread message

Anne Ogborn

unread,
Jan 10, 2019, 9:50:20 PM1/10/19
to SWI-Prolog Mailing List
Can anybody explain the # operator in CHR in SWI-Prolog?

Falco Nogatz

unread,
Jan 14, 2019, 11:46:51 AM1/14/19
to SWI-Prolog
Hi Anne,

where have you stumbled over the # operator in CHR?

Best,
Falco

Anne Ogborn

unread,
Jan 14, 2019, 5:07:53 PM1/14/19
to Falco Nogatz, SWI-Prolog
In the sources, it's defined as an operator.


On this page

http://www.swi-prolog.org/pldoc/man?section=SyntaxAndSemantics

apparently they're somehow associated with rule id's. And it's unclear
what the rule id's do at all

See also the passive pragma, which refers to it.


::Annie is here, playing nicely. She's reading the CHR sources to her dolly..::

Alan Baljeu

unread,
Jan 29, 2019, 7:04:50 PM1/29/19
to Anne Ogborn, Falco Nogatz, SWI-Prolog
Rule IDs do absolutely nothing in the SWI implementation.  I think the only use I've had for # is the passive operator, which is a little like a ! cut in SWI.  If used correctly it makes the program more efficient.  If used wrongly, it makes the program misbehave.

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages