The Witness Properties and the Semantics of the Prolog Cut
James H. Andrews
Abstract
The semantics of the Prolog ``cut'' construct is explored in the context of some desirable properties of logic programming systems, referred to as the witness properties. The witness properties concern the operational consistency of responses to queries. A generalization of Prolog with negation as failure and cut is described, and shown not to have the witness properties. A restriction of the system is then described, which preserves the choice and first-solution behaviour of cut but allows the system to have the witness properties. The notion of cut in the restricted system is more restricted than the Prolog hard cut, but retains the useful first-solution behaviour of hard cut, not retained by other proposed cuts such as the ``soft cut''. It is argued that the restricted system achieves a good compromise between the power and utility of the Prolog cut and the need for internal consistency in logic programming systems. The restricted system is given an abstract semantics, which depends on the witness properties; this semantics suggests that the restricted system has a deeper connection to logic than simply permitting some computations which are logical. Parts of this paper appeared previously in a different form in the Proceedings of the 1995 International Logic Programming Symposium.
Create a lesson
Related papers
Verified Implementation of the Next-gen Borrow Checking Algorithm for Rust via Abstract Interpretation
Jinhua Wu, Yuting Wang, Zhemin Chen
TauLang: A Language and Compiler for Space-Time Programming on Statically Scheduled Accelerators
Xuxiao Yang, Junchi Wu, Feiyang Wu et al.
Demystifying Information Flow Downgrading using the Real--Ideal Paradigm
Suraaj Kanniwadi, Andrew C. Myers
Linking as Evaluation: Correct Separate Compilation via First-Class Environments
Jam Kabeer Ali Khan, Jinhao Tan, Bruno C. d. S. Oliveira
Properly defining Erlang lists
Albert Schimpf, Stefan Wehr, Annette Bieniusa
Proving the Wrong Program: Miscompilations as a Threat to zkVM Guarantees
Hui Xuan Tan, Stefanos Chaliasos, Alastair F. Donaldson