Constraint Handling Rules (CHR) was first proposed to eliminate the black box approach when it comes to constraint solvers. Over the years, CHR has however, developed into a general purpose language. CHR was used in various types of problems and algorithms such as graph algorithms, sorting algorithms, tree algorithms … etc. It allows users to state their own rules. It has different implementations including Java, Prolog and C implementations.

Research Topics & Projects

Source-to-Source Transformation for Constraint Handling Rules

There have been various attempts to use source-to-source transformation with CHR due to its benefits and advantages. The project aims at extending CHR with various extensions using source-to-source transformation system. The transformations had different aims. Each goal was explored in a project as discussed below:

Embedding visualization features into CHR: in order to be able to animate the execution of different CHR programs. The project also explored the possibility of adding actions into CHR programs.

Implementing Different CHR operational semantics: in order to be able to run CHR programs under different operational semantics without having to modify the compiler in any way.

Exhaustive Execution of CHR : in order to allow for exploring the full search space of the execution of any CHR program.

Inverse Execution of CHR

The aim of the project is to apply inverse execution on CHR programs. Some Inversions of programs formulate common pairs such encryption/decryption, compression/decompression, inverting arithmetic functions, insert/delete operations on data structures, and roll-back transactions The goal of inverse execution is to discover the inputs of a program from its output. This process is a non-deterministic one. An extension was provided in order to execute the inverse program and explore all the possible execution paths through different techniques. Inverse execution of CHR also unfolds various research possibilities, such as abductive reasoning in addition to being able to compute with bidirectional rules in both directions bringing CHR closer to its most abstract first-order logic semantics.


Ahmed Elsawy, Amira Zaki, Slim Abdennadher:CHR Exhaustive Execution - Revisited. ICLP (Technical Communications) 2015
Nada Sharaf, Slim Abdennadher, Thom W. Frühwirth: DiagrammaticCHR: A Diagrammatic Representation of CHR Programs. IV 2015: 121-126
Arwa Ismail, Nada Sharaf, and Slim Abdennadher :CHR in Action , 25th International Symposium on Logic-Based Program Synthesis and Transformation LOPSTR 2015, 2015.
Amira Zaki, Slim Abdennadher, Thom W. Frühwirth: Combining Forward and Backward Propagation. FroCos 2015: 307-322
Nada Sharaf, Slim Abdennadher, Thom W. Frühwirth: CHRAnimation: An Animation Tool for Constraint Handling Rules. LOPSTR 2014: 92-110
Ahmed Elsawy, Amira Zaki, Slim Abdennadher: Exhaustive Execution of CHR Through Source-to-Source Transformation. LOPSTR 2014: 59-73
Nada Sharaf, Slim Abdennadher, Thom Fruehwirth : Visualization of Constraint Handling Rules , Doctoral Consortium of the 30th International Conference on Logic Programming (ICLP 2014), 2014.
Ghada Fakhry, Nada Sharaf, Slim Abdennadher: Towards the Implementation of a Source-to-Source Transformation Tool for CHR Operational Semantics. LOPSTR 2013: 145-163
Amira Zaki, Thom W. Frühwirth, Slim Abdennadher: Towards Inverse Execution of Constraint Handling Rules. TPLP 13(4-5-Online-Supplement) (2013)
Slim Abdennadher, Ghada Fakhry, and Nada Sharaf : Implementation of the Operational Semantics for CHR with User-defined Rule Priorities , 10th Workshop on Constraint Handling Rules, pages 1-12, July 2013. K.U.Leuven, Department of Computer Science, Technical report CW 641, 2013.
Slim Abdennadher, Nada Sharaf: Visualization of CHR through Source-to-Source Transformation. ICLP (Technical Communications) 2012: 109-118