forked from spechub/Hets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CASL.hs
113 lines (82 loc) · 3.99 KB
/
CASL.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{- |
Module : $Id$
Description : basics of the common algebraic specification language
Copyright : (c) Christian Maeder and DFKI Lab Bremen 2007
License : GPLv2 or higher, see LICENSE.txt
Maintainer : [email protected]
Stability : provisional
Portability : portable (except CASL.Logic_CASL and CASL.QuickCheck)
The "CASL" folder contains the CASL (see
<http://www.cofi.info/CASL.html>) instance of "Logic.Logic". All the
data for this instance is assembled in "CASL.Logic_CASL".
Note that the data structures are equipped with /holes/,
represented by type variables, that can be instantiated later on.
This is needed by CASL extensions, which typically extend
abstract syntax, signatures and signature morphisms.
For CASL, these holes are just filled with the unit tpye ().
However, many pieces of code can be written for any type f
instead of (), and thus be suitable also for CASL extensions.
It may be necessary to constrain these type variables in your
code, e.g. for pretty printing prefix your types with 'Pretty f =>'.
/Abstract Syntax/
The abstract syntax of CASL basic specifications is provided in
"CASL.AS_Basic_CASL" as a Haskell algebraic datatype. It largely
follows the CASL reference manual (see
<http://www.cofi.info/CASLDocuments.html>). Note that the abstract
syntax of structured specifications is provided elsewhere: in the
folder /Syntax/ (see "Syntax.ADoc").
/Parser/
The CASL parser, written with <http://www.cs.uu.nl/people/daan/parsec.html>,
is contained in
"CASL.Parse_AS_Basic". Several modules provide parsers for individual
non-terminals of the CASL grammar: "CASL.OpItem", "CASL.SortItem",
"CASL.Formula", "CASL.Quantification". The mixfix parser (which is
called only during static analysis) is provided by
"CASL.MixfixParser". "CASL.LiteralFuns" deals with literals (for
numbers, strings etc.). "CASL.SymbolParser" provides parsing of symbol
maps (occurring in fitting maps or views). Finally,
"CASL.RunMixfixParser" and "CASL.capa" provide command-line interfaces
to the parser.
/Printing/
Pretty printing (based on "Common.Lib.Pretty")
of CASL basic specifications is provided in
"CASL.Print_AS_Basic". Auxilary modules are "CASL.ShowMixfix" (for
printing mixfix formulas and terms) and "CASL.Simplify" and
"CASL.SimplifySen" (for removing redundant type information).
"CASL.LaTeX_AS_Basic" and "CASL.LaTeX_CASL" provide LaTeX output.
/Signatures/
The data structures for CASL signatures are contained in "CASL.Sign",
those for signature morphisms in "CASL.Morphism". CASL sentences are
represented as abstract syntax trees of type
'CASL.AS_Basic_CASL.FORMULA'. In order to understand these data
structures, you also should have a look at some of the "Common"
modules, providing data structures for identifiers ("Common.Id"), sets
("Common.Lib.Set"), maps ("Common.Lib.Map") and relations
("Common.Lib.Rel").
"CASL.MapSentence" implements translation of CASL sentences
along signature morphisms.
/Static Analysis/
The main module for static analysis of CASL basic specifications is
"CASL.StaticAna". The outcome basically is a signature and a set of
sentences. "CASL.Overload", "CASL.Inject" and "CASL.Project" deal
with subsorting.
"CASL.SymbolMapAnalysis" implements analysis of symbol maps,
yielding signature morphisms.
"CASL.Amalgamability" implements amalgamability checks needed for
architectural specifications.
"CASL.RunStaticAna" is a standalone command line interface for the
static analysis.
/Consistency checking/
"CASL.CCC.OnePoint" checks for the existence of a one-point model.
"CASL.CCC.FreeTypes" checks whether a specification consists
of free datatypes and recursively defined, terminating functions.
"CASL.CCC.SignFuns" provides commonly needed analysis functions
for signatures and morphisms.
/Miscellaneous/
"CASL.Sublogic" provides data structures and analysis functions
for the CASL sublogics.
"CASL.Taxonomy" displays the subsorting graph of a CASL signature.
"CASL.Utils" contains utilities.
"CASL.Test" seems to be obsolete.
-}
module CASL where