Constraint Handling Rules: Difference between revisions

Content deleted Content added
adding another inline citation
Language overview: ''Simpagation''
Line 23:
* Simplification rules have the form <math>h_1, \dots, h_n \,|\, g_1, \dots, g_m \Longleftrightarrow b_1, \dots, b_o</math>. When they match the ''heads'' <math>h_1, \dots, h_n</math> and the ''guards'' <math>g_1, \dots, g_m</math> hold, simplification rules may rewrite the heads into the ''body'' <math>b_1, \dots, b_o</math>.
* Propagation rules have the form <math>h_1, \dots, h_n \,|\, g_1, \dots, g_m \Longrightarrow b_1, \dots, b_o</math>. These rules add the constraints in the body to the store, without removing the heads.
* ''Simpagation'' rules combine simplification and propagation. They are written <math>h_1, \dots, h_\ell \,\backslash\, h_{\ell+1}, \dots, h_n \,|\, g_1, \dots, g_m \Longleftrightarrow b_1, \dots, b_o</math>. For a simpagation rule to fire, the constraint store must match all the rules in the head and the guards must hold true. The <math>\ell</math> constraints before the <math>\backslash</math> are kept, as a in a propagation rule; the remaining <math>n - \ell</math> constraints are removed.
 
Since simpagation rules subsume simplification and propagation, all CHR rules follow the format