CafeOBJ Algebraic Specification - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

CafeOBJ Algebraic Specification

Description:

A specification is a precise, unambiguous and complete statement of the ... print to the screen. Note: no spaces. Module. module module_name { module_element ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 18
Provided by: csM8
Category:

less

Transcript and Presenter's Notes

Title: CafeOBJ Algebraic Specification


1
CafeOBJ Algebraic Specification
  • Formal Methods se304/cs407

2
This lecture
  • Review CafeOBJ
  • The point
  • The constructs
  • The syntax
  • Example
  • List

3
CafeOBJ version 1.4.5
  • Does not have the same bug
  • Well look at it in the lab
  • Lets recap

4
The point
  • Specification
  • Maths
  • Precise
  • Unambiguous
  • Consistent
  • What, not how

5
Specification
  • A specification is a precise, unambiguous and
    complete statement of the requirements of a
    system (or program or process), written in such a
    way that it can be used to predict how the system
    will behave.

6
In algebraic specification
  • State axioms built of
  • Sorts
  • Operators
  • Variables
  • Combine them to
  • Draw conclusions

7
CafeOBJ
  • Modules
  • Imports
  • Reuse modules written by other people
  • Signature
  • Declare sorts and operations
  • Like a method signature
  • Axioms
  • Statements of truth from which to build arguments

8
CafeOBJ syntax
  • Comments
  • , -- normal comments
  • gt, --gt print to the screen
  • Note no spaces
  • Module
  • module module_name
  • module_element

9
CafeOBJ syntax
  • Imports
  • imports
  • protecting(module_name)

10
CafeOBJ syntax
  • Signature declaration, not definition
  • signature

11
CafeOBJ syntax
  • Signature declaration, not definition
  • Sorts
  • list_of_sorts
  • Subsorts, eg
  • Int lt Rat

12
CafeOBJ Syntax
  • Signature declaration, not definition
  • Operators
  • op symbol list_of_sorts -gt sort
  • Underscores represent argument position
  • op if_then_else_fi Bool Nat Nat -gt Nat
  • if N lt M then N else M fi

13
CafeOBJ syntax
  • Axioms
  • axioms

14
CafeOBJ syntax
  • Axioms
  • Variables (must be declared before used)
  • var variable_name variable_sort
  • Equations (note spaces)
  • eq term term .
  • Conditional equations
  • ceq term term if boolean_term .

15
Axioms
  • Tomorrow
  • Well take a close look at term rewriting, and
    using axioms

16
Example List
  • Well develop it on the board
  • Lab will be similar but more complex

17
http//home.planet.nl/faase009/HaCAR_CDR.html
Write a Comment
User Comments (0)
About PowerShow.com