4 research outputs found
Matrix Code
Matrix Code gives imperative programming a mathematical semantics and
heuristic power comparable in quality to functional and logic programming. A
program in Matrix Code is developed incrementally from a specification in
pre/post-condition form. The computations of a code matrix are characterized by
powers of the matrix when it is interpreted as a transformation in a space of
vectors of logical conditions. Correctness of a code matrix is expressed in
terms of a fixpoint of the transformation. The abstract machine for Matrix Code
is the dual-state machine, which we present as a variant of the classical
finite-state machine.Comment: 39 pages, 19 figures; extensions and minor correction
SLR inference: An inference system for fixed-mode logic programs, based on SLR parsing
AbstractDefinite-clause grammars (DCGs) generalize context-free grammars in such a way that Prolog can be used as a parser in the presence of context-sensitive information. Prolog's proof procedure, however, is based on backtracking, which may be a source of inefficiency. Parsers for context-free grammars that use backtracking, for instance, were soon replaced by more efficient methods, such as LR parsers. This suggests incorporating the principles underlying LR parsing into a parser for grammars with context-sensitive information. We present a technique that applies a transformation to the program/grammar by adding leaves to the proof/parse trees and placing the contextual information in such leaves. An inference system is then easily obtained from an LR parser, since only the parts dealing with terminals (which appear at the leaves) must be modified. Although our method is restricted to programs with fixed modes, it may be preferable to DCGs under Prolog for some programs