from Part II - The CHR language
Published online by Cambridge University Press: 10 February 2010
One advantage of a declarative programming language is the ease of formally sound program analysis. Properties like confluence and program equivalence have been investigated for CHR. These properties are decidable for terminating programs.
Since CHR is Turing-complete, termination is undecidable. Still, establishing termination for CHR programs can be straight forward, if simplification and propagation rules occur by themselves mainly.
Confluence means that it does not matter for the result which of the applicable rules are applied in a computation. The result will always be the same. Even if the computation itself is nondeterministic, in confluent programs, the relation between initial and final state, between query and answer, is a function and thus deterministic. For terminating CHR programs, there is a decidable, sufficient, and necessary test for confluence. Confluence implies consistency of the logical reading of the program. It improves the soundness and completeness results between the operational and declarative semantics. We have already discussed that confluent programs enjoy declarative concurrency and logical parallelism. So confluent programs can be run in parallel without change (cf. Section 4.3).
There is also a decidable, sufficient, and necessary test for operational equivalence of CHR programs. We do not know of any other programming language in practical use that admits such a test.
Unless otherwise noted, we use the very abstract semantics in this chapter to avoid clutter and technicalities of the abstract semantics. Not all results carry over to the refined semantics.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.