Go up to 3 Mapping from CASL to ELAN
Go forward to 3.2 ELAN Equational Specifications

3.1 CASL Equational Specifications

Roughly speaking, the considered CASL equational specifications consist of many-sorted conditional equational axioms. The equality predicate is used to express the congruence on terms, whereas the equivalence predicate is used for the congruence on boolean expressions.

3.1.1 Basic CASL specifications

Definition. Let Sigma be a many-sorted first-order signature, such that SigmaS, SigmaF, SigmaP denote respectively the set of sorts, the set of ranked function symbols, and the set of ranked predicate symbols. Let X be a set of sorted variables, where sorts are taken from SigmaS. The set of many-sorted terms built over the signature Sigma and the set of variables X is denoted T(SigmaF,X). The set of CASL boolean expressions CBE(Sigma,X) is the set smallest set such that:

The set of CASL equational formulas CF(Sigma,X) is the smallest set such that:

A CASL equational specification is given by a tuple (Sigma, V, CF) where V is a finite subset of X and CF is a finite subset of CF(Sigma,V).

In the current implementation, the following abbreviations are available.

Using the CASL concrete syntax, a CASL equational specification has to be defined as follows.

Example. (CASL equational specification skeleton).
spec
     Module = 
     sort
         {s}(s  $e$  SigmaS) 
     ops
         {f}(f  $e$  SigmaF) 
     preds
         {p}(p  $e$  SigmaP) 
     vars
         {v}(v  $e$  V) 
     { . phi}(phi  $e$  CF) 

3.1.2 Structured CASL specifications

It is important to note that we are able to deal with CASL specifications which are not simply defined as in Example 3.1.1, but these complicated specifications can be reduced to basic (flat) ones thanks to the CASL tool set:

Example. Consider the following basic CASL specification:
spec 
     INTEG =
     sort 
         Integ 
     ops
         plus: Integ * Integ -> Integ;
         s: Integ -> Integ;
         zero : Integ;

     vars
         x : Integ ;
         y : Integ

     . plus(zero,y) = y
     . plus(s(x),y) = s(plus(x,y))

This basic specification can be imported in the structured specification below:

from INTEG get INTEG

spec 
     GT_pred = 
     INTEG then

     preds
         __ > __ : Integ * Integ 

     vars
         x : Integ ;
         y : Integ
    
     . s(x) > s(y) <=> x > y
     . s(x) > zero
     . not (zero > s(x))
     . not (zero > zero)
The latter is equivalent to the basic (flat) CASL specification:
spec 
     GT_pred_basic = 
     sort 
         Integ 
     ops
         plus: Integ * Integ -> Integ;
         s: Integ -> Integ;
         zero : Integ;
     preds
         __ > __ : Integ * Integ 

     vars
         x : Integ ;
         y : Integ
    
     . plus(zero,y) = y
     . plus(s(x),y) = s(plus(x,y))

     . s(x) > s(y) <=> x > y
     . s(x) > zero
     . not (zero > s(x))
     . not (zero > zero)


CoFI Note: T-9 -- Version: 1 -- November 10, 2000.
Comments to FirstName.LastName@loria.fr

Go up to 3 Mapping from CASL to ELAN
Go forward to 3.2 ELAN Equational Specifications