Adding Function Arguments to Moded Guarded Definite Clauses
Matthew M. Huntbach · 2013
Abstract. Guarded Definite Clauses is a simple programming language which originated from attempts to introduce concurrency into the logic programming paradigm. Moded GDC introduces a new syntax for GDC which ensures all programs are well-moded and makes the moding visually apparent. A well-moded GDC program is one where a logic variable can be considered a channel with a direction of data flow, ensuring variables are guaranteed a single writer but may have multiple readers. We introduce a type system which guarantees that some variables are linear (single reader as well as single writer), allowing the polarity of data flow to be reversible and thus giving easy process interaction. We then show how certain patterns of communication can be viewed as higher-order functions, and introduce syntactic sugar which enable moded GDC programs to be written in a style which resembles conventional functional programming. Guarded Definite Clauses