一种基于约束的Prolog数学建模库,具有答案约束语义
A Constraint-based Mathematical Modeling Library in Prolog with Answer Constraint Semantics
AI总结:
本文提出将Prolog及其约束求解库作为统一的基于关系的建模和编程语言,并实现了一个受MiniZinc启发的Prolog数学建模库,在无明显计算开销的情况下支持数组、量词和迭代器,同时获得答案约束、可编程搜索与求解器以及统一调试环境。
摘要:
约束逻辑编程出现于80年代末,是一类基于一阶逻辑和具有可判定约束语言的理论的高度声明式编程语言,从而将Prolog纳入其中,但仅限于Herbrand项域上的等式约束。该方法在解决工业中的组合问题方面已被证明极为成功,这迅速推动了标准编程语言中各种约束求解库的发展。后来出现了纯声明式的前端基于约束的建模语言MiniZinc的设计,它独立于约束求解器,以便比较它们的性能并创建模型基准。除了这一目的之外,使用像MiniZinc这样的高级建模语言来开发完整应用程序,或教授约束编程,受到以下限制:无法在建模语言中编写搜索策略或新的约束求解器,以及缺乏同时支持基于约束的建模和约束求解两个层次的集成开发环境。在本文中,我们提出通过将Prolog及其约束求解库作为一种统一的基于关系的建模和编程语言来解决这些问题。我们提出了一个用于高级基于约束的数学建模的Prolog库,其灵感来自MiniZinc,除了列表和项之外还使用下标变量(数组),除了递归之外还使用量词和迭代器,同时对约束库进行了补丁,以便在约束中支持数组函数式记法。我们表明,这种方法不会带来显著的计算时间开销,并且在以下方面具有若干优势:可以专注于数学建模,除了基础解之外还能获得答案约束,在需要时编写搜索或约束求解器,以及在统一的建模和编程环境中调试模型。
英文摘要:
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 successfull 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。