PrettyCLP: a Light Java Implementation for Teaching CLP

Recursion is nowadays taught to students since their first programming days in order to embed it deeply in their brains. However, students’ first impact on Prolog programs execution sometimes weakens their faith in recursive programming thus invalidating our initial efforts. The selection and computation rules implemented by all Prolog systems, although clearly explained in textbooks, are hard to be interiorized by students also due to the poor system debugging primitives. Problems increase in Constraint Logic Programming when unification is replaced by constraint simplification in a suitable constraint domain. In this paper, we extend PrettyProlog, a light-weight Prolog interpreter written in Java capable of system primitives for SLD tree visualization, to deal with Constraint Logic Programming over Finite Domains. The user, in particular, can select the propagation strategies (e.g. arc consistency vs bound consistency) and can view the (usually hidden) details of the constraint propagation stage.

[1]  Marco Gavanelli,et al.  SLDNF-Draw: a Visualisation Tool of Prolog Operational Semantics , 2007 .

[2]  Abraham Kandel,et al.  A visual debugger for pure Prolog , 1995 .

[3]  H. Shinomi Graphical representation and execution animation for Prolog programs , 1989, International Workshop on Industrial Applications of Machine Intelligence and Vision,.

[4]  Mats Carlsson,et al.  Tracing and Explaining Execution of CLP(FD) Programs , 2002, WLPE.

[5]  Peter J. Stuckey,et al.  Finite Domain Bounds Consistency Revisited , 2004, Australian Conference on Artificial Intelligence.

[6]  Pieter H. Hartel,et al.  Programming Languages: Implementations, Logics, and Programs , 1996, Lecture Notes in Computer Science.

[7]  Manuel V. Hermenegildo,et al.  Tools for Search-Tree Visualisation: The APT Tool , 2000, Analysis and Visualization Tools for Constraint Programming.

[8]  Christian Schulte Using the Oz Explorer for the Development of Constraint Programs , 1997, LPE.

[9]  Manuel V. Hermenegildo,et al.  Tools for Constraint Visualisation: The VIFID/TRIFID Tool , 2000, Analysis and Visualization Tools for Constraint Programming.

[10]  François Fages,et al.  CLPGUI: A Generic Graphical User Interface for Constraint Logic Programming , 2004, Constraints.

[11]  Mats Carlsson,et al.  An Open-Ended Finite Domain Constraint Solver , 1997, PLILP.

[12]  Peter Norvig,et al.  Artificial Intelligence: A Modern Approach , 1995 .

[13]  Marc Eisenstadt,et al.  A fine-grained account of Prolog execution for teaching and debugging , 1990 .

[14]  Mireille Ducassé,et al.  Tracing Prolog without a Tracer (Poster Abstract) , 1996, JICSLP.

[15]  Francesca Rossi,et al.  Constraint Logic Programming , 2010, 25 Years GULP.