All languages

Eqlog languagehistorical

OBJ3 enriched with order-sorted unification and backtracking, so an equality becomes a constraint to solve rather than a rewrite rule. Default execution is order-sorted narrowing; retracts give it the flexibility of an untyped language without giving up strong typing.

Overview

Eqlog is an equational logic programming language: it combines constraint logic programming with equational programming by enriching OBJ with order-sorted unification and backtracking. Its default operational semantics is order-sorted narrowing, so a query is answered by finding substitutions rather than by reducing to a normal form.

Code

***> a theory of labelled transition systems with an idle transition
th OBJECT is
  sort Action .
  op skip : -> Action .
  sort State .
  op _--[_]->_ : State Action State -> Bool .
  var S : State .
  eq S --[skip]-> S = true .
endth
find … such that is the idiom that separates Eqlog from OBJ: searching for a substitution replaces reduction as the execution model. view … endv is inherited unchanged from the family's module system, which is why Eqlog can compose objects as ordinary parameterized modules.

Distinctive traits

  • Order-sorted narrowing is the default strategy, combining rewriting with unification so that partially instantiated terms can still be evaluated.
  • Built-in solvers for equality, disequality and numeric orderings run instead of narrowing wherever a closed form applies, keeping the general mechanism efficient on its common cases.
  • Retracts give a rigorous form of runtime type checking, which buys the syntactic flexibility of an untyped language while keeping strong typing.
  • Theories and views are inherited from OBJ, so modules are parameterized by specification rather than by type.
  • Evaluating a module expression builds a system, so composition is part of the language rather than a linking step.
  • The semantics is initiality in Horn-clause logic with equality, which unifies functional and logic programming under one model.

Status

Historical. Eqlog was developed in Oxford by Răzvan Diaconescu during the mid-1980s and is documented through the UCSD pages and worked examples; no current distribution is maintained. Its ideas survive in the narrowing and unification machinery of Maude.

History

Goguen and Meseguer proposed Eqlog around 1985 as OBJ3 plus order-sorted unification, and presented it through 1986. Diaconescu implemented it at Oxford and completed its categorical semantics as a doctoral thesis; the language remained a research vehicle for constraint equational programming rather than a released product.

Sources & references