| 1 |
Introduction |
| 2 |
============ |
| 3 |
|
| 4 |
(present a module (idea: stripped down version of the bank-account.mod) |
| 5 |
which contains most important and often used constructs |
| 6 |
describe the fundamental concepts of CafeOBJ |
| 7 |
(algebraic spec, order sort, model spec, ...) |
| 8 |
also contains a quick intro to interaction [Ch 1] but much shorter) |
| 9 |
|
| 10 |
CafeOBJ as TRS specification system, background, algebraic specification |
| 11 |
based on equational theory. |
| 12 |
|
| 13 |
Overview of the system |
| 14 |
====================== |
| 15 |
|
| 16 |
alternative title: Main concepts (?) |
| 17 |
|
| 18 |
discuss the following topics in bit more details (parts of the |
| 19 |
current manual, stripped down) |
| 20 |
|
| 21 |
- sorts [Ch 3] |
| 22 |
- operators [Ch 4, Ch 7] |
| 23 |
- module [Ch 2, Ch 8] |
| 24 |
|
| 25 |
do not contain the syntactic definition in all the details, |
| 26 |
but explain these important items in more detail |
| 27 |
|
| 28 |
Sorts |
| 29 |
----- |
| 30 |
|
| 31 |
use [Ch 3] |
| 32 |
|
| 33 |
### Normal sorts ### |
| 34 |
|
| 35 |
~~~ |
| 36 |
[ NzNat Zero < Nat ] |
| 37 |
~~~ |
| 38 |
|
| 39 |
### Hidden sorts ### |
| 40 |
|
| 41 |
Not to be included in the introduction |
| 42 |
|
| 43 |
~~~ |
| 44 |
*[ Foo ]* |
| 45 |
~~~ |
| 46 |
|
| 47 |
Term structure |
| 48 |
-------------- |
| 49 |
|
| 50 |
use [Ch 4 and 7] |
| 51 |
|
| 52 |
### Variable declarations ### |
| 53 |
|
| 54 |
== vars M N : Nat == |
| 55 |
|
| 56 |
== N:Nat == |
| 57 |
|
| 58 |
### Records ### |
| 59 |
|
| 60 |
~~~~ |
| 61 |
Record { |
| 62 |
... |
| 63 |
} |
| 64 |
~~~~ |
| 65 |
|
| 66 |
### Operators ### |
| 67 |
|
| 68 |
~~~ |
| 69 |
op 0 : -> Zero |
| 70 |
op s_ : Nat -> NzNat |
| 71 |
op _+_ : Nat Nat -> Nat |
| 72 |
~~~ |
| 73 |
|
| 74 |
Rewriting - Equations |
| 75 |
--------------------- |
| 76 |
|
| 77 |
### Equations ### |
| 78 |
|
| 79 |
~~~ |
| 80 |
eq N:Nat + 0 = N . |
| 81 |
eq N:Nat + s(M:Nat) = s(N + M) . |
| 82 |
~~~ |
| 83 |
|
| 84 |
### Transitions ### |
| 85 |
|
| 86 |
~~~ |
| 87 |
trans ... |
| 88 |
~~~ |
| 89 |
|
| 90 |
Glueing it together - modules |
| 91 |
----------------------------- |
| 92 |
|
| 93 |
use [Ch 2 and 8] |
| 94 |
|
| 95 |
~~~ |
| 96 |
module { |
| 97 |
...sort definitions... |
| 98 |
...operators... |
| 99 |
...axioms and transitions... |
| 100 |
} |
| 101 |
~~~ |
| 102 |
|
| 103 |
### Views/Parametrization ### |
| 104 |
|
| 105 |
|
| 106 |
The full module |
| 107 |
--------------- |
| 108 |
~~~ {#mycode .cafeobj .numberLines startFrom="10"} |
| 109 |
mod! SIMPLE-NAT { |
| 110 |
[ NzNat Zero < Nat ] |
| 111 |
op 0 : -> Zero |
| 112 |
op s_ : Nat -> NzNat |
| 113 |
op _+_ : Nat Nat -> Nat {comm} |
| 114 |
|
| 115 |
eq N:Nat + s(M:Nat) = s(N + M) . |
| 116 |
eq N:Nat + 0 = N . |
| 117 |
} |
| 118 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 119 |
|
| 120 |
Gory Details |
| 121 |
============ |
| 122 |
|
| 123 |
starting with the BNF definition of [Ch 12], go through |
| 124 |
alphabetic list of syntax elements (care has to be taken for |
| 125 |
infix ops etc) with explanations, taken from and adapted from |
| 126 |
the current manual. Combining similar items. |
| 127 |
Full syntactic definition and semantics |
| 128 |
(extraction/unification for the current manual): |
| 129 |
|
| 130 |
list as in the attached pdf (extraction of current manual), but |
| 131 |
merging following items (at least) (numbers also refer to the |
| 132 |
Syntax elements in the current manual) |
| 133 |
|
| 134 |
- done 12,13 |
| 135 |
- done 14,15 |
| 136 |
- done 17,23,24,61,64-69 parts of module expressin todo |
| 137 |
- done 26-28 |
| 138 |
- 29-31 |
| 139 |
- 32,33 |
| 140 |
- 39,40 |
| 141 |
- 42,43 |
| 142 |
- 44,46,47 |
| 143 |
- 49,50 |
| 144 |
|
| 145 |
From the currently not treated chapters we would |
| 146 |
|
| 147 |
- [Ch 5,6] -> part of the "part 3" (inspecting, evaluating, ...) |
| 148 |
- [Ch 9,10]-> merged into either "part 2" or appendix on proving |
| 149 |
- [Ch 11] -> part of the "part 3" |