Towards Inverse Execution of Constraint Handling Rules.
Amira I. Zaki, Thom Frühwirth, Slim Abdennadher · Theory and Practice of Logic Programming · 2013
Inverse execution is a non-deterministic process of discovering the inputs to a program starting from its output. This paper deals with the inverse execution of Constraint Handling Rules (CHR). First a simple inversion technique is proposed, which produces a reverse program consisting of rules with exchanged left and right hand sides. The limitations of this method are presented and reveal the need for a different CHR execution strategy. Then an extension is provided to execute the inverse program whilst exploring all possible execution paths incrementally and exhaustively through different methods such as breadth-first traversal or random path choice. An on-line tool was implemented to transform any forward CHR program into its equivalent inverse; examples and results highlight the validity of this work.