Using prolog for constructing geometric objects defined by constraints
Efficient algorithmic solutions are known for many problems in geometric modeling. Most algorithms are best implemented in a procedural programming language. For other problems, especially in interactive programs, no procedures may be found easily, but we may formulate the knowledge of our problem in a descriptive way with facts and ruies. Prolog is an appropriate language for finding solutions in the latter case. On the other hand, Prolog does not support efficiently the writing of procedures and arithmetic, which are still essential for solving geometrical problems.
We describe how a geometrical construction problem may be solved with Prolog. For computations such as line intersections, or for graphic display, we use the procedural programming language Modula-2. In order to combine the two languages we designed an interface language ‘logula’. An easy-to-use notation allows an application programmer to add new ‘built-in’ predicates, which are implemented as Modula-2 procedures.
Keywords and phrasesLogic programming for geometric modeling language to language interface Prolog Modula-2
Unable to display preview. Download preview PDF.
- [Clock., Mell./81]W.F. Clocksin, C.S. Mellish, Programming in Prolog. Springer-Verlag Berlin, Heidelberg, NewYork, 1981.Google Scholar
- [InterFace/84]IF/Prolog User's C-interface Manual Version 1.0 edited by Preben Folkjaer, Ute Leibrandt, Lawrence Bernhard, InterFace Computer GmbH München.Google Scholar
- [Schorn, Schulz/84]Peter Schorn, Thomas Schulz Manual for ‘Lilith-Prolog’ and ‘Logula’ Semesterarbeit, Institut für Informatik ETH Zürich, 1984Google Scholar
- [Szuba/84]Tadeusz Szuba, PC-PROLOG for process control applications. Angewandte Informatik 4/84.Google Scholar
- [Wirth/81]N. Wirth, The Personal Computer Lilith. ETH Report No., 40 Eidgenössische Technische Hochschule, Institut für Informatik, ETH Zürich, 1981Google Scholar
- [Wirth/83]Niklaus Wirth Programming in Modula-2 Springer-Verlag Berlin, Heidelberg, NewYork, 1983.Google Scholar