CASL
The Common Algebraic Specification Language
Summary

by The CoFI Task Group on Language Design

22 July 1999

The formatted body and appendices of this document are also available separately, as is the list of all corrections and clarifications made since the initial release of this document in October 1998.

Copyright ©1999 CoFI, The Common Framework Initiative for Algebraic Specification and Development.

Permission is granted to anyone to make or distribute verbatim copies of this document, in any medium, provided that the copyright notice and permission notice are preserved, and that the distributor grants the recipient permission for further redistribution as permitted by this notice. Modified versions may not be made.

This document is available by FTP in various formats. It was converted to HTML using Hyperlatex 2.3.

Abstract

The language CASL is central to CoFI, the Common Framework Initiative for algebraic specification and development. It is a reasonably expressive algebraic language for specifying requirements and design for conventional software. From CASL, simpler languages (e.g., for interfacing with existing tools) are to be obtained by restriction, and CASL is to be incorporated in more advanced languages (e.g., higher-order). CASL strikes a balance between simplicity and expressiveness. The main features of its design are as follows:

Many-sorted basic specifications in CASL denote classes of many-sorted partial first-order structures: algebras where the functions are partial or total, and where also predicates are allowed. Axioms are first-order formulae built from equations and definedness assertions. Sort generation constraints can be stated. Datatype declarations are provided for concise specification of sorts together with some constructors and (optional) selectors. Subsorted basic specifications provide moreover a simple treatment of subsorts, interpreting subsort inclusion as embedding.

Structured specifications allow translation, reduction, union, and extension of specifications. Extensions may be required to be free; initiality constraints are a special case. A simple form of generic specifications is provided, together with instantiation involving parameter-fitting translations and views.

Architectural specifications express that the specified software is to be composed from separately-developed, reusable units with clear interfaces.

Finally, specification libraries allow the (distributed) storage and retrieval of named specifications.

This document gives a detailed summary of the syntax and intended semantics of CASL. It is intended for readers who are already familiar with the main concepts of algebraic specifications.

Brief Contents

  • About this document
  • I Basic Specifications
  • 1 Basic Concepts
  • 1.1 Signatures
  • 1.2 Models
  • 1.3 Sentences
  • 1.4 Satisfaction
  • 2 Basic Constructs
  • 2.1 Signature Declarations
  • 2.2 Variables
  • 2.3 Axioms
  • 2.4 Identifiers
  • 3 Subsorting Concepts
  • 3.1 Signatures
  • 3.2 Models
  • 3.3 Sentences
  • 4 Subsorting Constructs
  • 4.1 Signature Declarations
  • 4.2 Axioms
  • II Structured Specifications
  • 5 Structuring Concepts
  • 6 Structuring Constructs
  • 6.1 Structured Specifications
  • 6.2 Named and Parametrized Specifications
  • 6.3 Views
  • 6.4 Symbol Lists and Mappings
  • 6.5 Compound Identifiers
  • III Architectural Specifications
  • 7 Architectural Concepts
  • 8 Architectural Constructs
  • 8.1 Unit Declarations and Definitions
  • 8.2 Unit Specifications
  • 8.3 Unit Expressions
  • IV Specification Libraries
  • 9 Library Concepts
  • 10 Library Constructs
  • 10.1 Local Libraries
  • 10.2 Distributed Libraries
  • 10.3 Library Names
  • References
  • Index
  • Appendices
  • A Abstract Syntax
  • A.1 Basic Specifications
  • A.2 Basic Specifications with Subsorts
  • A.3 Structured Specifications
  • A.4 Architectural Specifications
  • A.5 Specification Libraries
  • B Abbreviated Abstract Syntax
  • B.1 Basic and Subsorted Specifications
  • B.2 Structured Specifications
  • B.3 Architectural Specifications
  • B.4 Specification Libraries
  • C Concrete Syntax
  • C.1 Introduction
  • C.2 Context-Free Syntax
  • C.3 Disambiguation
  • C.4 Lexical Syntax
  • C.5 Comments and Annotations
  • C.6 Syntax for Literals
  • D Display Format
  • D.1 Mathematical Symbols
  • D.2 Keywords
  • D.3 Identifiers
  • D.4 Comments and Annotations
  • E Examples
  • E.1 Simple Structured Specifications
  • E.2 Generic Structured Specifications
  • E.3 Architectural Specifications
  • Footnotes
  • Full Contents

  • About this document
  • Structure
  • Versions
  • Contributors
  • I Basic Specifications
  • 1 Basic Concepts
  • 1.1 Signatures
  • 1.2 Models
  • 1.3 Sentences
  • 1.4 Satisfaction
  • 2 Basic Constructs
  • 2.1 Signature Declarations
  • 2.1.1 Sorts
  • 2.1.1.1 Sort Declarations
  • 2.1.2 Operations
  • 2.1.2.1 Operation Declarations
  • Operation Types
  • Operation Attributes
  • 2.1.2.2 Operation Definitions
  • 2.1.3 Predicates
  • 2.1.3.1 Predicate Declarations
  • Predicate Types
  • 2.1.3.2 Predicate Definitions
  • 2.1.4 Datatypes
  • 2.1.4.1 Datatype Declarations
  • Alternatives
  • Components
  • 2.1.4.2 Free Datatype Declarations
  • 2.1.5 Sort Generation
  • 2.2 Variables
  • 2.2.1 Global Variable Declarations
  • 2.2.2 Local Variable Declarations
  • 2.3 Axioms
  • 2.3.1 Quantifications
  • 2.3.2 Logical Connectives
  • 2.3.2.1 Conjunction
  • 2.3.2.2 Disjunction
  • 2.3.2.3 Implication
  • 2.3.2.4 Equivalence
  • 2.3.2.5 Negation
  • 2.3.3 Atomic Formulae
  • 2.3.3.1 Truth
  • 2.3.3.2 Predicate Application
  • 2.3.3.3 Definedness
  • 2.3.3.4 Equations
  • 2.3.4 Terms
  • 2.3.4.1 Identifiers
  • 2.3.4.2 Qualified Variables
  • 2.3.4.3 Operation Application
  • 2.3.4.4 Sorted Terms
  • 2.3.4.5 Conditional Terms
  • 2.4 Identifiers
  • 3 Subsorting Concepts
  • 3.1 Signatures
  • 3.2 Models
  • 3.3 Sentences
  • 4 Subsorting Constructs
  • 4.1 Signature Declarations
  • 4.1.1 Sorts
  • 4.1.1.1 Subsort Declarations
  • 4.1.1.2 Isomorphism Declarations
  • 4.1.1.3 Subsort Definitions
  • 4.1.2 Datatypes
  • 4.1.2.1 Alternatives
  • 4.2 Axioms
  • 4.2.1 Atomic Formulae
  • 4.2.1.1 Membership
  • 4.2.2 Terms
  • 4.2.2.1 Casts
  • II Structured Specifications
  • 5 Structuring Concepts
  • 6 Structuring Constructs
  • 6.1 Structured Specifications
  • 6.1.1 Translations
  • 6.1.2 Reductions
  • 6.1.3 Unions
  • 6.1.4 Extensions
  • 6.1.5 Free Specifications
  • 6.1.6 Local Specifications
  • 6.1.7 Closed Specifications
  • 6.2 Named and Parametrized Specifications
  • 6.2.1 Specification Definitions
  • 6.2.2 Specification Instantiation
  • 6.3 Views
  • 6.3.1 View Definitions
  • 6.3.2 Fitting Views
  • 6.4 Symbol Lists and Mappings
  • 6.4.1 Symbol Lists
  • 6.4.2 Symbol Mappings
  • 6.5 Compound Identifiers
  • III Architectural Specifications
  • 7 Architectural Concepts
  • 8 Architectural Constructs
  • 8.1 Unit Declarations and Definitions
  • 8.1.1 Unit Declarations
  • 8.1.2 Unit Definitions
  • 8.2 Unit Specifications
  • 8.2.1 Unit Types
  • 8.2.2 Architectural Unit Specifications
  • 8.2.3 Closed Unit Specifications
  • 8.3 Unit Expressions
  • 8.3.1 Unit Terms
  • 8.3.1.1 Unit Translations
  • 8.3.1.2 Unit Reductions
  • 8.3.1.3 Amalgamations
  • 8.3.1.4 Local Units
  • 8.3.1.5 Unit Applications
  • IV Specification Libraries
  • 9 Library Concepts
  • 10 Library Constructs
  • 10.1 Local Libraries
  • 10.2 Distributed Libraries
  • 10.3 Library Names
  • References
  • Index
  • Appendices
  • A Abstract Syntax
  • A.1 Basic Specifications
  • A.2 Basic Specifications with Subsorts
  • A.3 Structured Specifications
  • A.4 Architectural Specifications
  • A.5 Specification Libraries
  • B Abbreviated Abstract Syntax
  • B.1 Basic and Subsorted Specifications
  • B.2 Structured Specifications
  • B.3 Architectural Specifications
  • B.4 Specification Libraries
  • C Concrete Syntax
  • C.1 Introduction
  • C.2 Context-Free Syntax
  • C.2.1 Basic Specifications with Subsorts
  • C.2.2 Structured Specifications
  • C.2.3 Architectural Specifications
  • C.2.4 Specification Libraries
  • C.3 Disambiguation
  • C.3.1 Precedence
  • C.3.2 Mixfix Grouping Analysis
  • C.4 Lexical Syntax
  • C.5 Comments and Annotations
  • C.5.1 Comments
  • C.5.2 Annotations
  • C.5.2.1 Label Annotations
  • C.5.2.2 Display Annotations
  • C.5.2.3 Parsing Annotations
  • C.5.2.4 Semantic Annotations
  • C.6 Syntax for Literals
  • C.6.1 Literal syntax for numbers
  • C.6.2 Literal syntax for strings
  • C.6.3 Literal syntax for lists
  • D Display Format
  • D.1 Mathematical Symbols
  • D.2 Keywords
  • D.3 Identifiers
  • D.4 Comments and Annotations
  • E Examples
  • E.1 Simple Structured Specifications
  • E.1.1 Partial_Order
  • E.1.2 Monoid
  • E.1.3 Nat
  • E.1.4 Elem
  • E.2 Generic Structured Specifications
  • E.2.1 Set1
  • E.2.2 Set2
  • E.2.3 List
  • E.2.4 List_with_Order
  • E.2.5 Nat_List_with_Reverse_Orders
  • E.2.6 Non_Empty_List
  • E.2.7 Path
  • E.2.8 File
  • E.2.9 List_of_List_of_List_of_Nat
  • E.2.10 Nat_List_with_Order
  • E.2.11 Bounded_Nat_List
  • E.3 Architectural Specifications
  • E.3.1 Num
  • E.3.2 Num_Monoid
  • E.3.3 Add_Num
  • E.3.4 Add_Num_Efficiently
  • E.3.5 Efficient_Add_Num
  • Footnotes

  • CoFI Document: CASL/Summary -- Version: 1.0 -- 22 July 1999.
    Comments to cofi-language@brics.dk