All languages

CafeOBJ language

Successor to OBJ adding hidden sorts, behavioural specification and rewriting logic under one institution-based semantics. Its distinguishing practice is the proof score: a proof is CafeOBJ source, executed by reduction, so specification and verification share one tool.

Overview

CafeOBJ is an algebraic specification and verification language, a direct successor to OBJ developed under Kokichi Futatsugi's direction at JAIST. It keeps OBJ's mixfix syntax, order-sorted typing and parameterized modules, and adds hidden sorts and rewriting logic for behavioural and concurrent systems.

Code

mod! SIMPLE-NAT {
  [Nat]
  op 0 : -> Nat {constr}
  op s_ : Nat -> Nat {constr}
  op _+_ : Nat Nat -> Nat
  vars N M : Nat
  eq 0 + N = N .
  eq s N + M = s(N + M) .
}
red s s 0 + s s s 0 .   ***> s s s s s 0
Two sorts of sort declaration carry the design: [Nat] is a visible sort whose values are decided by equations, *[Counter]* is a hidden sort whose identity is decided by observation through its bop operators. beq states those observations behaviourally, and red drives the whole thing.

Distinctive traits

  • Institution-based semantics: each logic combination is a separate institution, giving one language several precisely defined paradigms at once.
  • Hidden sorts and behavioural operators (bop, beq, =*=) specify infinite objects by observation rather than by term equality.
  • Proof scores: case analysis and induction are written as CafeOBJ source and discharged by red, so the proof is checked by the same engine that runs the specification.
  • mod! and mod* choose initial vs loose semantics for a module, making the model-theoretic reading part of the declaration.
  • Syntax is fully user-definable (_+_, if_then_else_fi), and ops ... {constr} marks which operators generate the data.

Status

Actively maintained: version 1.6.2 shipped in November 2024 under a BSD licence, with binaries for Windows, macOS and Linux built on SBCL and source at CafeOBJ/cafeobj. The interpreter is written in Common Lisp and ships with the CITP/PTcalc proof assistant.

History

The CafeOBJ project began in April 1997 as a Japanese government-funded consortium to build an industrial-strength OBJ environment; Futatsugi, an OBJ2 designer, led it at JAIST. The CafeOBJ Report (Diaconescu and Futatsugi) appeared in 1998, and the interpreter has been in continuous release since.

Sources & references