An Application of Rational Trees in a Logic Programming Interpreter for a Procedural Language
Manuel Carro
Abstract
We describe here a simple application of rational trees to the implementation of an interpreter for a procedural language written in a logic programming language. This is possible in languages designed to support rational trees (such as Prolog II and its descendants), but also in traditional Prolog, whose data structures are initially based on Herbrand terms, but in which implementations often omit the occurs check needed to avoid the creation of infinite data structures. We provide code implementing two interpreters, one of which needs non-occurs-check unification, which makes it faster (and more economic). We provide experimental data supporting this, and we argue that rational trees are interesting enough as to receive thorough support inside the language.
Create a lesson
Related papers
Fast FPRAS for the Permanent
Xiaoyu Chen, Heng Guo, Eric Vigoda et al.
Large-Scale Trade-Off Curve Computation for Incentive Allocation with Cardinality and Matroid Constraints
Yu Cong, Chao Xu, Yi Zhou
An Ω( n m) Information-Theoretic Lower Bound for Randomized Online Set Cover
Roie Levin
Optimal Simulated Annealing for Partition Function Estimation
Heng Guo, Hongyang Liu, Xiongxin Yang et al.
Emergency Vertex Cover
Eric Angel, Evangelos Bampas, Evripidis Bampis et al.
Exact Greedy Influence Maximization in Linear Time on Bounded-Treewidth Graphs
Matic Požar