• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

9.6 CHR compatibility
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • CHR: Constraint Handling Rules
        • CHR compatibility
          • The Old SICStus CHR implementation
          • The Old ECLiPSe CHR implementation
    • Packages

9.6.2 The Old ECLiPSe CHR implementation

The old ECLiPSe CHR implementation features a label_with/1 construct for labeling variables in CHR constraints. This feature has long since been abandoned. However, a simple transformation is all that is required to port the functionality.

label_with Constraint1 if Condition1.
...
label_with ConstraintN if ConditionN.
Constraint1 :- Body1.
...
ConstraintN :- BodyN.

is transformed into

:- chr_constraint my_labeling/0.

my_labeling \ Constraint1 <=> Condition1 | Body1.
...
my_labeling \ ConstraintN <=> ConditionN | BodyN.
my_labeling <=> true.

Be sure to put this code after all other rules in your program! With my_labeling/0 (or another predicate name of your choosing) the labeling is initiated, rather than ECLiPSe's chr_labeling/0 .

ClioPatria (version V3.1.1-51-ga0b30a5)