CHR # operator

Skip to first unread message

Anne Ogborn

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

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

where have you stumbled over the # operator in CHR?


Anne Ogborn

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

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

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
Visit this group at
For more options, visit
Reply all
Reply to author
0 new messages