AS_Basic_CASL.der.hs revision 765e55b764e0fd32c09d33709d6e2770c4766799
eceb9606af609acfa431c3203484317c55ce8b35Ewaryst SchulzModule : $Header$
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerDescription : Abstract syntax of CASL basic specifications
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus HartkeCopyright : (c) Klaus Luettich, Christian Maeder, Uni Bremen 2002-2006
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus HartkeLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
26db4a742376d513cdba128780ee8ca60eeb927eTill MossakowskiMaintainer : Christian.Maeder@dfki.de
f1edf379717f0ddb7607585a027cf6f03a6fce68Christian MaederStability : provisional
26db4a742376d513cdba128780ee8ca60eeb927eTill MossakowskiPortability : portable
26db4a742376d513cdba128780ee8ca60eeb927eTill MossakowskiAbstract Syntax of CASL Basic_specs, Symb_items and Symb_map_items.
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski Follows Sect. II:2.2 of the CASL Reference Manual.
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkeimport qualified Data.Set as Set
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke-- DrIFT command
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke{-! global: GetRange !-}
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata BASIC_SPEC b s f = Basic_spec [Annoted (BASIC_ITEMS b s f)]
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata BASIC_ITEMS b s f = Sig_items (SIG_ITEMS s f)
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- the Annotation following the keyword is dropped
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- but preceding the keyword is now an Annotation allowed
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Free_datatype SortsKind [Annoted DATATYPE_DECL] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: free, type, semi colons
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Sort_gen [Annoted (SIG_ITEMS s f)] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: generated, opt. braces
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Var_items [VAR_DECL] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: var, semi colons
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Local_var_axioms [VAR_DECL] [Annoted (FORMULA f)] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: forall, semi colons, dots
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Axiom_items [Annoted (FORMULA f)] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: dots
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Ext_BASIC_ITEMS b
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata SortsKind = NonEmptySorts | PossiblyEmptySorts deriving Show
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata SIG_ITEMS s f = Sort_items SortsKind [Annoted (SORT_ITEM f)] Range
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- pos: sort, semi colons
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder | Op_items [Annoted (OP_ITEM f)] Range
a23e572c8f957cc051a1b0831abd6fe9380d45c7Christian Maeder -- pos: op, semi colons
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Pred_items [Annoted (PRED_ITEM f)] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: pred, semi colons
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Datatype_items SortsKind [Annoted DATATYPE_DECL] Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- type, semi colons
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Ext_SIG_ITEMS s
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata SORT_ITEM f = Sort_decl [SORT] Range
05bf9cbe382548c2665dd01a6a402640c9ec3813Christian Maeder | Subsort_decl [SORT] SORT Range
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- pos: commas, <
05bf9cbe382548c2665dd01a6a402640c9ec3813Christian Maeder | Subsort_defn SORT VAR SORT (Annoted (FORMULA f)) Range
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- pos: "=", "{", ":", ".", "}"
05bf9cbe382548c2665dd01a6a402640c9ec3813Christian Maeder -- the left anno list stored in Annoted Formula is
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- parsed after the equal sign
05bf9cbe382548c2665dd01a6a402640c9ec3813Christian Maeder | Iso_decl [SORT] Range
05bf9cbe382548c2665dd01a6a402640c9ec3813Christian Maeder deriving Show
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata OP_ITEM f = Op_decl [OP_NAME] OP_TYPE [OP_ATTR f] Range
e16b3696b2c173aac14200321868ed81b8f7dc69Christian Maeder -- pos: commas, colon, OP_ATTR sep. by commas
e16b3696b2c173aac14200321868ed81b8f7dc69Christian Maeder | Op_defn OP_NAME OP_HEAD (Annoted (TERM f)) Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata OpKind = Total | Partial deriving (Show, Eq, Ord)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata OP_TYPE = Op_type OpKind [SORT] SORT Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: "*"s, "->" ; if null [SORT] then Range = [] or pos: "?"
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving (Show, Eq, Ord)
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkeargs_OP_TYPE :: OP_TYPE -> [SORT]
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkeargs_OP_TYPE (Op_type _ args _ _) = args
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkeres_OP_TYPE :: OP_TYPE -> SORT
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkeres_OP_TYPE (Op_type _ _ res _) = res
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata OP_HEAD = Op_head OpKind [ARG_DECL] SORT Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: "(", semicolons, ")", colon
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata ARG_DECL = Arg_decl [VAR] SORT Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: commas, colon
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata OP_ATTR f = Assoc_op_attr | Comm_op_attr | Idem_op_attr
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Unit_op_attr (TERM f)
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving (Show, Eq, Ord)
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartkedata PRED_ITEM f = Pred_decl [PRED_NAME] PRED_TYPE Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: commas, colon
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke | Pred_defn PRED_NAME PRED_HEAD (Annoted (FORMULA f)) Range
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke -- pos: "<=>"
9f93539f2fa4f5b9d935c7baa22fcd750806def9Klaus Hartke deriving Show
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata PRED_TYPE = Pred_type [SORT] Range
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- pos: if null [SORT] then "(",")" else "*"s
b90a7e905864818883ef83927e19264f1b5a762cChristian Maeder deriving (Show, Eq, Ord)
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroederdata PRED_HEAD = Pred_head [ARG_DECL] Range
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder -- pos: "(",semi colons , ")"
| Mixfix_formula (TERM f) -- Mixfix_ Term/Token/(..)/[..]/{..}
their identity w.r.t. the original signature. The newSort in a
the constraint (i.e. a "parameter sort"). Note that this representation of
-- no duplicate sorts, i.e. injective sort map? Then we can ignore indices
indices = [0..length sorts-1]
"CASL/AS_Basic_CASL: Internal error: Unqualified OP_SYMB in Sort_gen_ax"
-- | fails (i.e. delivers Nothing) if the sort map is not injective
-- no duplicate sorts, i.e. injective sort map?
| Mixfix_term [TERM f] -- not starting with Mixfix_sorted_term/cast