Table of Contents
Fetching ...

A Refined Operational Semantics for FreeCHR

Sascha Rechenberger, Thom Frühwirth

TL;DR

This paper presents a translation of the refined operational semantics for FreeCHR and proves it to be both a valid concretization of the very abstract semantics of FreeCHR, and an equivalent representation of the refined semantics of CHR.

Abstract

Constraint Handling Rules (CHR) is a rule-based programming language which is typically embedded into a general-purpose language. There exists a plethora of implementations for numerous host languages. However, the existing implementations often re-invent the way to embed CHR, which impedes maintenance and weakens assertions of correctness. To formalize and thereby standardize the embedding into arbitrary host languages, we introduced the framework FreeCHR and proved it to be a valid representation of classical ground CHR. Until now, this framework only includes a translation of the very abstract operational semantics which, due to its abstract nature, is not a sufficient base for practical implementations. In this paper we present a translation of the refined operational semantics for FreeCHR and prove it to be both a valid concretization of the very abstract semantics of FreeCHR, and an equivalent representation of the refined semantics of CHR. This will establish implementations of FreeCHR as equivalent in behavior and expressiveness to existing implementations of CHR.

A Refined Operational Semantics for FreeCHR

TL;DR

This paper presents a translation of the refined operational semantics for FreeCHR and proves it to be both a valid concretization of the very abstract semantics of FreeCHR, and an equivalent representation of the refined semantics of CHR.

Abstract

Constraint Handling Rules (CHR) is a rule-based programming language which is typically embedded into a general-purpose language. There exists a plethora of implementations for numerous host languages. However, the existing implementations often re-invent the way to embed CHR, which impedes maintenance and weakens assertions of correctness. To formalize and thereby standardize the embedding into arbitrary host languages, we introduced the framework FreeCHR and proved it to be a valid representation of classical ground CHR. Until now, this framework only includes a translation of the very abstract operational semantics which, due to its abstract nature, is not a sufficient base for practical implementations. In this paper we present a translation of the refined operational semantics for FreeCHR and prove it to be both a valid concretization of the very abstract semantics of FreeCHR, and an equivalent representation of the refined semantics of CHR. This will establish implementations of FreeCHR as equivalent in behavior and expressiveness to existing implementations of CHR.

Paper Structure

This paper contains 11 sections, 3 theorems, 110 equations, 4 figures.

Key Result

theorem 1

The refined operational semantics of FreeCHR $\omstarr$ is $(\abstractr, \mathit{unenum})$-sound the very abstract operational semantics $\omstara$.

Figures (4)

  • Figure 1: Execution of the Euclidean algorithm gcd implemented in CHR with initial query $[6,9]$
  • Figure 2: Demonstration of the effect of the propagation history.
  • Figure 3: Inference Rules for the very abstract operational semantics of FreeCHR $\omstara$
  • Figure 4: Inference Rules for the refined operational semantics of FreeCHR $\omstarr$

Theorems & Definitions (17)

  • definition 1: Data types
  • definition 2: Host environment
  • definition 3: Non-Herbrand ground CHR programs
  • definition 4: $C$-groundings & instances of rules
  • definition 5: States
  • definition 6: Refined operational semantics for non-Herbrand ground CHR
  • definition 7: Syntax of FreeCHR programs
  • definition 8: Very abstract operational semantics $\omstara$
  • definition 9: Refined operational semantics $\omstarr$
  • definition 10: Abstraction function
  • ...and 7 more