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

3.3 Translation from CASL to ELAN

The translation is defined by using a straightforward mapping between CASL boolean expressions and ELAN ones, and a mapping between CASL formulas and ELAN ones. Moreover CASL predicates are viewed as ELAN functions with bool (an ELAN built-in sort) as codomains.

Definition. Given a many-sorted first-order signature Sigma, Sigma' denotes the many-sorted first-order signature defined as follows: The mapping trB: CBE(Sigma,X) -> EBE(Sigma',X) is defined recursively as follows: The mapping trF: CF(Sigma,X) -> EF(Sigma',X) is defined as follows: The ELAN translation of a CASL equational specification (Sigma,V,CF) is the ELAN equational specification (Sigma',V,trF(CF)).

From now on, the ELAN translation of a CASL equational specification is assumed to be confluent and terminating.

Example. (Example 3.1.2 continued) This ELAN translation of the CASL equational basic specification GT_pred_basic is as follows.
module GT_pred_basic

sort Integ ;
end

operators global

         plus(@,@): (Integ Integ) Integ ;
         s(@): (Integ) Integ ;
         zero: Integ ;
         @ > @ : (Integ Integ) bool ; 
end

rules for bool
   x : Integ ;
   y : Integ
global    
 [] plus(zero,y) => y end
 [] plus(s(x),y) => s(plus(x,y)) end
 [] s(x) > s(y)  => x > y end
 [] s(x) > zero  => true end
 [] zero > s(x)  => false end
 [] zero > zero  => false end
end

end // of module

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

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