All languages

Clear languagehistorical

Specification language for combining theories: a theory is a signature plus equations, and combine, enrich, derive, induce and theory procedures build larger ones. Its colimit semantics for shared subtheories is the direct source of OBJ's parameterized modules and, through that, of the ML module system.

Overview

Clear is a specification language for building large theories out of small ones: a theory is a signature plus equations, and theory expressions combine them. Rod Burstall and Joseph Goguen introduced it in 1977 so that a modular specification could be structured rather than written as one monolithic axiom list.

Code

theory sorts bool
opns  true : -> bool
      false : -> bool
      not_ : bool -> bool
      _and_ : bool, bool -> bool
eqns  not true = false
      not false = true
      false and p = false
      true and p = p
endth
The tour follows the paper's own progression: an explicit theory; combine and enrich; a procedure whose parameter is itself a theory; and application of that procedure, where [element is nat] discharges the parameter. The last step is a proof obligation, not a type check, and the paper notes it is undecidable in general.

Distinctive traits

  • Theory-building is expression-based: combine (+), enrich, derive and induce compose theories, so a specification is an expression rather than a file.
  • enrich adds sorts, operators and equations to an existing theory while inheriting everything it had, so no axiom is restated.
  • Sharing is semantic, not textual: two theories that both contain Bool combine to a theory with one Bool, which is where the colimit semantics enters.
  • Theory procedures make theories first-class inputs, and a "meta-sort" is just a theory naming the requirements, so parameterization is by specification.
  • derive renames a theory's signature, expressing that one operator corresponds to another without repeating the axioms.
  • induce adds the equations holding for all variable-free instances, turning case analysis into a rule of inference.

Status

Historical, and never implemented as described: Burstall and Goguen published a design with a semantics, not a released system. Its influence outweighs its tooling — OBJ took theories and views from Clear, and Standard ML's modules cite it.

History

Burstall and Goguen presented Clear at IJCAI 1977; its semantics appeared as The Semantics of Clear in LNCS 86 (1980), with set-theoretic and categorical treatments following. Goguen later called OBJ's module system "a further development of ideas pioneered in the Clear language, which was joint work of Joseph Goguen and Rod Burstall in the 1970s".

Sources & references