data CASL_DL2CASL = CASL_DL2CASL deriving Show
instance Language CASL_DL2CASL
CASL_DL2CASL -- comorphism
CASL_DL_SL -- sublogics domain
DL_BASIC_SPEC -- Basic spec domain
DLFORMULA -- sentence domain
SYMB_ITEMS -- symbol items domain
SYMB_MAP_ITEMS -- symbol map items domain
DLSign -- signature domain
RawSymbol -- rawsymbol domain
ProofTree -- proof tree codomain
CASL_Sublogics -- sublogics codomain
CASLBasicSpec -- Basic spec codomain
CASLFORMULA -- sentence codomain
SYMB_ITEMS -- symbol items codomain
SYMB_MAP_ITEMS -- symbol map items codomain
CASLSign -- signature codomain
CASLMor -- morphism codomain
Symbol -- symbol codomain
RawSymbol -- rawsymbol codomain
ProofTree -- proof tree domain
sourceLogic CASL_DL2CASL = CASL_DL
targetLogic CASL_DL2CASL = CASL
sourceSublogic CASL_DL2CASL = SROIQ
{ sub_features = LocFilSub
, cons_features = emptyMapConsFeature }
map_sentence CASL_DL2CASL = trSentence
map_morphism CASL_DL2CASL = mapMor
map_theory CASL_DL2CASL = trTheory
isInclusionComorphism CASL_DL2CASL = True
has_model_expansion CASL_DL2CASL = True
-- ^ mapping of morphims, we just forget the
mapMor :: DLMor -> Result CASLMor
ms = trSign $ msource inMor
mt = trSign $ mtarget inMor
in return (embedMorphism () ms mt)
-- ^ we forget additional information in the signature
projectToCASL :: DLSign -> CASLSign
-- ^ Thing is established as the TopSort of all sorts
-- ^ defined in the CASL_DL spec, a predefined signature
trSign :: DLSign -> CASLSign
inC = (projectToCASL inSig) `uniteCASLSign` predefSign
inData = sortSet dataSig_CASL
-- ^ translation of the signature
-- ^ predefined axioms are added
rtrSign :: DLSign -> Result CASLSign
rtrSign inSig = return $ trSign inSig
-- Translation of theories
trTheory :: (DLSign, [Named (FORMULA DL_FORMULA)]) ->
Result (CASLSign, [Named (FORMULA ())])
trTheory (inSig, inForms) =
outForms <- mapR (\x -> trNamedSentence inSig x) inForms
return (outSig, predefinedAxioms ++ outForms)
-- ^ translation of named sentences
trNamedSentence :: DLSign -> Named (FORMULA DL_FORMULA) ->
Result (Named (FORMULA ()))
trNamedSentence inSig inForm =
wasThL = wasTheorem inForm
outSen <- trSentence inSig inSenL
-- ^ translation of sentences
trSentence :: DLSign -> FORMULA DL_FORMULA -> Result (FORMULA ())
Quantification qf vs frm rn ->
outF <- trSentence inSig frm
return (Quantification qf vs (outF) rn)
outF <- mapR (\x -> trSentence inSig x) fns
return (Conjunction outF rn)
outF <- mapR (\x -> trSentence inSig x) fns
return (Disjunction outF rn)
Implication f1 f2 b rn ->
out1 <- trSentence inSig f1
out2 <- trSentence inSig f2
return (Implication out1 out2 b rn)
out1 <- trSentence inSig f1
out2 <- trSentence inSig f2
return (Equivalence out1 out2 rn)
outF <- trSentence inSig frm
return (Negation outF rn)
True_atom rn -> do return (True_atom rn)
False_atom rn -> do return (False_atom rn)
ot <- mapR (\x -> trTerm inSig x) trm
return (Predication pr ot rn)
return (Definedness ot rn)
Existl_equation t1 t2 rn ->
return (Existl_equation ot1 ot2 rn)
Strong_equation t1 t2 rn ->
return (Strong_equation ot1 ot2 rn)
return (Membership ot st rn)
return (Mixfix_formula ot)
Unparsed_formula str rn ->
do return (Unparsed_formula str rn)
do return (Sort_gen_ax cstr ft)
Cardinality _ _ _ _ _ _ ->
fail "Mapping for cardinality expressions not yet implemented"
-- ^ translation of terms
trTerm :: DLSign -> TERM DL_FORMULA -> Result (TERM ())
Qual_var v s rn -> return (Qual_var v s rn)
ot <- mapR (\x -> trTerm inSig x) tms
return (Application os ot rn)
return (Sorted_term ot st rn)
Conditional t1 frm t2 rn ->
of1 <- trSentence inSig frm
return (Conditional ot1 of1 ot2 rn)
Unparsed_term str rn -> do return (Unparsed_term str rn)
Mixfix_qual_pred ps -> do return (Mixfix_qual_pred ps)
ot <- mapR (\x -> trTerm inSig x) trm
Mixfix_token tok -> do return (Mixfix_token tok)
Mixfix_sorted_term st rn -> do return (Mixfix_sorted_term st rn)
Mixfix_cast st rn -> do return (Mixfix_cast st rn)
Mixfix_parenthesized trm rn ->
ot <- mapR (\x -> trTerm inSig x) trm
return (Mixfix_parenthesized ot rn)
Mixfix_bracketed trm rn ->
ot <- mapR (\x -> trTerm inSig x) trm
return (Mixfix_bracketed ot rn)
ot <- mapR (\x -> trTerm inSig x) trm
return (Mixfix_braced ot rn)