A Constraint-Based Mathematical Modeling Library in Prolog with Answer Constraint Semantics

被引:0
作者
Fages, Francois [1 ]
机构
[1] Inria Saclay, Palaiseau, France
来源
FUNCTIONAL AND LOGIC PROGRAMMING, FLOPS 2024 | 2024年 / 14659卷
关键词
constraint logic programming; algebraic modeling languages; answer constraints; MiniZinc; meta-predicates; constraint solving; constraint simplification; attributed variables; ISO-Prolog;
D O I
10.1007/978-981-97-2300-3_8
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Constraint logic programming emerged in the late 80's as a highly declarative class of programming languages based on first-order logic and theories with decidable constraint languages, thereby subsuming Prolog restricted to equality constraints over the Herbrand's term domain. This approach has proven extremely successful in solving combinatorial problems in the industry which quickly led to the development of a variety of constraint solving libraries in standard programming languages. Later came the design of a purely declarative front-end constraint-based modeling language, MiniZinc, independent of the constraint solvers, in order to compare their performances and create model benchmarks. Beyond that purpose, the use of a high-level modeling language such as MiniZinc to develop complete applications, or to teach constraint programming, is limited by the impossibility to program search strategies, or new constraint solvers, in a modeling language, as well as by the absence of an integrated development environment for both levels of constraint-based modeling and constraint solving. In this paper, we propose to solve those issues by taking Prolog with its constraint solving libraries, as a unified relation-based modeling and programming language. We present a Prolog library for high-level constraint-based mathematical modeling, inspired by MiniZinc, using subscripted variables (arrays) in addition to lists and terms, quantifiers and iterators in addition to recursion, together with a patch of constraint libraries in order to allow array functional notations in constraints. We show that this approach does not come with a significant computation time overhead, and presents several advantages in terms of the possibility of focussing on mathematical modeling, getting answer constraints in addition to ground solutions, programming search or constraint solvers if needed, and debugging models within a unique modeling and programming environment.
引用
收藏
页码:135 / 150
页数:16
相关论文
共 19 条
[1]  
Apt Krzysztof R., 2006, Constraint Logic Programming using ECLiPSe
[2]  
Carlsson M., 2012, Sicstus 4.2.3
[3]  
Coquery E, 2003, LECT NOTES COMPUT SC, V2914, P136
[4]   TCLP: Overloading, subtyping and parametric polymorphism made practical for CLP [J].
Coquery, E ;
Fages, F .
LOGICS PROGRAMMING, PROCEEDINGS, 2002, 2401 :480-480
[5]   CLPGUI: A generic graphical user interface for constraint logic programming [J].
Fages, F ;
Soliman, S ;
Coolen, R .
CONSTRAINTS, 2004, 9 (04) :241-262
[6]   Typing constraint logic programs [J].
Fages, F ;
Coquery, E .
THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2001, 1 :751-777
[7]  
Fruhwirth T., 2009, Constraint handling rules
[8]  
Harvey WD, 1995, INT JOINT CONF ARTIF, P607
[9]  
Jaffar J., 1987, Conference Record of the Fourteenth Annual ACM Symposium on Principles of Programming Languages, P111, DOI 10.1145/41625.41635
[10]  
Lassez J.-L., 1992, Journal of Automated Reasoning, V9, P373, DOI 10.1007/BF00245296