{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE MonoLocalBinds #-}
module Logic.Logic where
import Logic.Prover (Prover, ConsChecker, Theory (..))
import Logic.KnownIris
import Taxonomy.MMiSSOntology (MMiSSOntology)
import ATC.DefaultMorphism ()
import qualified OMDoc.DataTypes as OMDoc
( TCElement
, TCorOMElement
, NameMap
, SigMap
, SigMapI
, OMCD
, OmdADT)
import ATerm.Lib (ShATermConvertible)
import Common.AS_Annotation
import Common.Amalgamate
import Common.AnnoState
import Common.Consistency
import Common.DefaultMorphism
import Common.Doc
import Common.DocUtils
import Common.ExtSign
import Common.GlobalAnnotations
import Common.Id
import Common.IRI
import Common.Item
import Common.Json
import Common.Lib.Graph
import Common.LibName
import Common.Prec (PrecMap)
import Common.Result
import Common.Taxonomy
import Common.ToXml
import qualified Data.Set as Set
import qualified Data.Map as Map
import Data.Monoid ()
import Data.Ord
import Data.Typeable
import Control.Monad (unless)
import qualified Control.Monad.Fail as Fail
import Data.Aeson (FromJSON, ToJSON)
data Stability = Stable | Testing | Unstable | Experimental
deriving (Stability -> Stability -> Bool
(Stability -> Stability -> Bool)
-> (Stability -> Stability -> Bool) -> Eq Stability
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Stability -> Stability -> Bool
$c/= :: Stability -> Stability -> Bool
== :: Stability -> Stability -> Bool
$c== :: Stability -> Stability -> Bool
Eq, Int -> Stability -> ShowS
[Stability] -> ShowS
Stability -> String
(Int -> Stability -> ShowS)
-> (Stability -> String)
-> ([Stability] -> ShowS)
-> Show Stability
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Stability] -> ShowS
$cshowList :: [Stability] -> ShowS
show :: Stability -> String
$cshow :: Stability -> String
showsPrec :: Int -> Stability -> ShowS
$cshowsPrec :: Int -> Stability -> ShowS
Show)
class ShATermConvertible a => Convertible a
instance ShATermConvertible a => Convertible a
class (Pretty a, Convertible a, ToJSON a, FromJSON a) => PrintTypeConv a
instance (Pretty a, Convertible a, ToJSON a, FromJSON a) => PrintTypeConv a
class (Eq a, PrintTypeConv a) => EqPrintTypeConv a
instance (Eq a, PrintTypeConv a) => EqPrintTypeConv a
type EndoMap a = Map.Map a a
class Show lid => Language lid where
language_name :: lid -> String
language_name = lid -> String
forall a. Show a => a -> String
show
description :: lid -> String
description _ = ""
short_description :: Language lid => lid -> String
short_description :: lid -> String
short_description l :: lid
l = [String] -> String
forall a. [a] -> a
head ((String -> [String]
lines (String -> [String]) -> String -> [String]
forall a b. (a -> b) -> a -> b
$ lid -> String
forall lid. Language lid => lid -> String
description lid
l) [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [""])
class (Ord object, Ord morphism)
=> Category object morphism | morphism -> object where
ide :: object -> morphism
composeMorphisms :: morphism -> morphism -> Result morphism
dom, cod :: morphism -> object
inverse :: morphism -> Result morphism
inverse _ = String -> Result morphism
forall (m :: * -> *) a. MonadFail m => String -> m a
Fail.fail "Logic.Logic.Category.inverse not implemented"
isInclusion :: morphism -> Bool
isInclusion _ = Bool
False
legal_mor :: morphism -> Result ()
legal_mor _ = () -> Result ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
isIdentity :: Category object morphism => morphism -> Bool
isIdentity :: morphism -> Bool
isIdentity m :: morphism
m = morphism -> Bool
forall object morphism.
Category object morphism =>
morphism -> Bool
isInclusion morphism
m Bool -> Bool -> Bool
&& morphism -> object
forall object morphism.
Category object morphism =>
morphism -> object
dom morphism
m object -> object -> Bool
forall a. Eq a => a -> a -> Bool
== morphism -> object
forall object morphism.
Category object morphism =>
morphism -> object
cod morphism
m
comp :: Category object morphism => morphism -> morphism -> Result morphism
comp :: morphism -> morphism -> Result morphism
comp m1 :: morphism
m1 m2 :: morphism
m2 = if morphism -> object
forall object morphism.
Category object morphism =>
morphism -> object
cod morphism
m1 object -> object -> Bool
forall a. Eq a => a -> a -> Bool
== morphism -> object
forall object morphism.
Category object morphism =>
morphism -> object
dom morphism
m2 then morphism -> morphism -> Result morphism
forall object morphism.
Category object morphism =>
morphism -> morphism -> Result morphism
composeMorphisms morphism
m1 morphism
m2 else
String -> Result morphism
forall (m :: * -> *) a. MonadFail m => String -> m a
Fail.fail "target of first and source of second morphism are different"
instance Ord sign => Category sign (DefaultMorphism sign) where
dom :: DefaultMorphism sign -> sign
dom = DefaultMorphism sign -> sign
forall sign. DefaultMorphism sign -> sign
domOfDefaultMorphism
cod :: DefaultMorphism sign -> sign
cod = DefaultMorphism sign -> sign
forall sign. DefaultMorphism sign -> sign
codOfDefaultMorphism
ide :: sign -> DefaultMorphism sign
ide = sign -> DefaultMorphism sign
forall sign. sign -> DefaultMorphism sign
ideOfDefaultMorphism
isInclusion :: DefaultMorphism sign -> Bool
isInclusion = Bool -> DefaultMorphism sign -> Bool
forall a b. a -> b -> a
const Bool
True
composeMorphisms :: DefaultMorphism sign
-> DefaultMorphism sign -> Result (DefaultMorphism sign)
composeMorphisms = DefaultMorphism sign
-> DefaultMorphism sign -> Result (DefaultMorphism sign)
forall (m :: * -> *) sign.
Monad m =>
DefaultMorphism sign
-> DefaultMorphism sign -> m (DefaultMorphism sign)
compOfDefaultMorphism
class (Language lid, PrintTypeConv basic_spec, GetRange basic_spec,
Monoid basic_spec,
Pretty symbol,
EqPrintTypeConv symb_items,
EqPrintTypeConv symb_map_items)
=> Syntax lid basic_spec symbol symb_items symb_map_items
| lid -> basic_spec symbol symb_items symb_map_items
where
parsersAndPrinters :: lid -> Map.Map String
(PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
parsersAndPrinters li :: lid
li = case lid -> Maybe (PrefixMap -> AParser st basic_spec)
forall lid basic_spec symbol symb_items symb_map_items st.
Syntax lid basic_spec symbol symb_items symb_map_items =>
lid -> Maybe (PrefixMap -> AParser st basic_spec)
parse_basic_spec lid
li of
Nothing -> Map String (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
forall k a. Map k a
Map.empty
Just p :: PrefixMap -> AParser st basic_spec
p -> (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
-> Map
String (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
forall b. b -> Map String b
makeDefault (PrefixMap -> AParser st basic_spec
p, basic_spec -> Doc
forall a. Pretty a => a -> Doc
pretty)
parse_basic_spec :: lid -> Maybe (PrefixMap -> AParser st basic_spec)
parseSingleSymbItem :: lid -> Maybe (PrefixMap -> AParser st symb_items)
parse_symb_items :: lid -> Maybe (PrefixMap -> AParser st symb_items)
parse_symb_map_items :: lid -> Maybe (PrefixMap -> AParser st symb_map_items)
toItem :: lid -> basic_spec -> Item
symb_items_name :: lid -> symb_items -> [String]
parse_basic_spec _ = Maybe (PrefixMap -> AParser st basic_spec)
forall a. Maybe a
Nothing
parseSingleSymbItem _ = Maybe (PrefixMap -> AParser st symb_items)
forall a. Maybe a
Nothing
parse_symb_items _ = Maybe (PrefixMap -> AParser st symb_items)
forall a. Maybe a
Nothing
parse_symb_map_items _ = Maybe (PrefixMap -> AParser st symb_map_items)
forall a. Maybe a
Nothing
symb_items_name _ _ = [""]
toItem _ bs :: basic_spec
bs = (String, Doc) -> Range -> Item
forall a. ItemTypeable a => a -> Range -> Item
mkFlatItem ("Basicspec", basic_spec -> Doc
forall a. Pretty a => a -> Doc
pretty basic_spec
bs) (Range -> Item) -> Range -> Item
forall a b. (a -> b) -> a -> b
$ basic_spec -> Range
forall a. GetRange a => a -> Range
getRangeSpan basic_spec
bs
basicSpecParser :: Syntax lid basic_spec symbol symb_items symb_map_items
=> Maybe IRI -> lid -> Maybe (PrefixMap -> AParser st basic_spec)
basicSpecParser :: Maybe IRI -> lid -> Maybe (PrefixMap -> AParser st basic_spec)
basicSpecParser sm :: Maybe IRI
sm = ((PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
-> PrefixMap -> AParser st basic_spec)
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
-> Maybe (PrefixMap -> AParser st basic_spec)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
-> PrefixMap -> AParser st basic_spec
forall a b. (a, b) -> a
fst (Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
-> Maybe (PrefixMap -> AParser st basic_spec))
-> (lid
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc))
-> lid
-> Maybe (PrefixMap -> AParser st basic_spec)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe IRI
-> lid
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
forall lid basic_spec symbol symb_items symb_map_items st.
Syntax lid basic_spec symbol symb_items symb_map_items =>
Maybe IRI
-> lid
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
parserAndPrinter Maybe IRI
sm
basicSpecPrinter :: Syntax lid basic_spec symbol symb_items symb_map_items
=> Maybe IRI -> lid -> Maybe (basic_spec -> Doc)
basicSpecPrinter :: Maybe IRI -> lid -> Maybe (basic_spec -> Doc)
basicSpecPrinter sm :: Maybe IRI
sm = ((PrefixMap -> AParser Any basic_spec, basic_spec -> Doc)
-> basic_spec -> Doc)
-> Maybe (PrefixMap -> AParser Any basic_spec, basic_spec -> Doc)
-> Maybe (basic_spec -> Doc)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (PrefixMap -> AParser Any basic_spec, basic_spec -> Doc)
-> basic_spec -> Doc
forall a b. (a, b) -> b
snd (Maybe (PrefixMap -> AParser Any basic_spec, basic_spec -> Doc)
-> Maybe (basic_spec -> Doc))
-> (lid
-> Maybe (PrefixMap -> AParser Any basic_spec, basic_spec -> Doc))
-> lid
-> Maybe (basic_spec -> Doc)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe IRI
-> lid
-> Maybe (PrefixMap -> AParser Any basic_spec, basic_spec -> Doc)
forall lid basic_spec symbol symb_items symb_map_items st.
Syntax lid basic_spec symbol symb_items symb_map_items =>
Maybe IRI
-> lid
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
parserAndPrinter Maybe IRI
sm
basicSpecSyntaxes :: Syntax lid basic_spec symbol symb_items symb_map_items
=> lid -> [String]
basicSpecSyntaxes :: lid -> [String]
basicSpecSyntaxes = Map String String -> [String]
forall k a. Map k a -> [k]
Map.keys (Map String String -> [String])
-> (lid -> Map String String) -> lid -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Map String String
serializations (String -> Map String String)
-> (lid -> String) -> lid -> Map String String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. lid -> String
forall lid. Language lid => lid -> String
language_name
parserAndPrinter :: Syntax lid basic_spec symbol symb_items symb_map_items
=> Maybe IRI -> lid -> Maybe (PrefixMap -> AParser st basic_spec,
basic_spec -> Doc)
parserAndPrinter :: Maybe IRI
-> lid
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
parserAndPrinter sm :: Maybe IRI
sm l :: lid
l = lid
-> Maybe IRI
-> Map
String (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
-> Maybe (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
forall lid basic_spec symbol symb_items symb_map_items b.
Syntax lid basic_spec symbol symb_items symb_map_items =>
lid -> Maybe IRI -> Map String b -> Maybe b
lookupDefault lid
l Maybe IRI
sm (lid
-> Map
String (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
forall lid basic_spec symbol symb_items symb_map_items st.
Syntax lid basic_spec symbol symb_items symb_map_items =>
lid
-> Map
String (PrefixMap -> AParser st basic_spec, basic_spec -> Doc)
parsersAndPrinters lid
l)
lookupDefault :: Syntax lid basic_spec symbol symb_items symb_map_items
=> lid -> Maybe IRI -> Map.Map String b -> Maybe b
lookupDefault :: lid -> Maybe IRI -> Map String b -> Maybe b
lookupDefault l :: lid
l im :: Maybe IRI
im m :: Map String b
m = case Maybe IRI
im of
Just i :: IRI
i -> do
let s :: String
s = IRI -> String
iriToStringUnsecure IRI
i
String
ser <- if IRI -> Bool
isSimple IRI
i then String -> Maybe String
forall (m :: * -> *) a. Monad m => a -> m a
return String
s
else String -> String -> Maybe String
lookupSerialization (lid -> String
forall lid. Language lid => lid -> String
language_name lid
l) String
s
String -> Map String b -> Maybe b
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup String
ser Map String b
m
Nothing -> if Map String b -> Int
forall k a. Map k a -> Int
Map.size Map String b
m Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== 1 then b -> Maybe b
forall a. a -> Maybe a
Just (b -> Maybe b) -> b -> Maybe b
forall a b. (a -> b) -> a -> b
$ [b] -> b
forall a. [a] -> a
head ([b] -> b) -> [b] -> b
forall a b. (a -> b) -> a -> b
$ Map String b -> [b]
forall k a. Map k a -> [a]
Map.elems Map String b
m
else String -> Map String b -> Maybe b
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup "" Map String b
m
showSyntax :: Language lid => lid -> Maybe IRI -> String
showSyntax :: lid -> Maybe IRI -> String
showSyntax lid :: lid
lid = (("logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> String
forall lid. Language lid => lid -> String
language_name lid
lid) String -> ShowS
forall a. [a] -> [a] -> [a]
++)
ShowS -> (Maybe IRI -> String) -> Maybe IRI -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (IRI -> String) -> Maybe IRI -> String
forall b a. b -> (a -> b) -> Maybe a -> b
maybe "" ((" serialization " String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> (IRI -> String) -> IRI -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IRI -> String
iriToStringUnsecure)
makeDefault :: b -> Map.Map String b
makeDefault :: b -> Map String b
makeDefault = String -> b -> Map String b
forall k a. k -> a -> Map k a
Map.singleton ""
addSyntax :: String -> b -> Map.Map String b -> Map.Map String b
addSyntax :: String -> b -> Map String b -> Map String b
addSyntax = String -> b -> Map String b -> Map String b
forall k a. Ord k => k -> a -> Map k a -> Map k a
Map.insert
class (Language lid, Category sign morphism, Ord sentence,
Ord symbol,
PrintTypeConv sign, PrintTypeConv morphism,
GetRange sentence, GetRange symbol,
PrintTypeConv sentence, ToJson sentence,
ToXml sentence, PrintTypeConv symbol)
=> Sentences lid sentence sign morphism symbol
| lid -> sentence sign morphism symbol
where
map_sen :: lid -> morphism -> sentence -> Result sentence
map_sen l :: lid
l _ _ = lid -> String -> Result sentence
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "map_sen"
simplify_sen :: lid -> sign -> sentence -> sentence
simplify_sen _ _ = sentence -> sentence
forall a. a -> a
id
negation :: lid -> sentence -> Maybe sentence
negation _ _ = Maybe sentence
forall a. Maybe a
Nothing
print_sign :: lid -> sign -> Doc
print_sign _ = sign -> Doc
forall a. Pretty a => a -> Doc
pretty
print_named :: lid -> Named sentence -> Doc
print_named _ = (sentence -> Doc) -> Annoted sentence -> Doc
forall a. (a -> Doc) -> Annoted a -> Doc
printAnnoted (Doc -> Doc
addBullet (Doc -> Doc) -> (sentence -> Doc) -> sentence -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. sentence -> Doc
forall a. Pretty a => a -> Doc
pretty) (Annoted sentence -> Doc)
-> (Named sentence -> Annoted sentence) -> Named sentence -> Doc
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Named sentence -> Annoted sentence
forall s. Named s -> Annoted s
fromLabelledSen
sym_of :: lid -> sign -> [Set.Set symbol]
sym_of _ _ = []
mostSymsOf :: lid -> sign -> [symbol]
mostSymsOf l :: lid
l = (Set symbol -> [symbol]) -> [Set symbol] -> [symbol]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Set symbol -> [symbol]
forall a. Set a -> [a]
Set.toList ([Set symbol] -> [symbol])
-> (sign -> [Set symbol]) -> sign -> [symbol]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. lid -> sign -> [Set symbol]
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> [Set symbol]
sym_of lid
l
symmap_of :: lid -> morphism -> EndoMap symbol
symmap_of _ _ = EndoMap symbol
forall k a. Map k a
Map.empty
sym_name :: lid -> symbol -> Id
sym_name l :: lid
l _ = lid -> String -> Id
forall lid a. Language lid => lid -> String -> a
statError lid
l "sym_name"
sym_label :: lid -> symbol -> Maybe String
sym_label _ _ = Maybe String
forall a. Maybe a
Nothing
fullSymName :: lid -> symbol -> String
fullSymName l :: lid
l = Id -> String
forall a. Show a => a -> String
show (Id -> String) -> (symbol -> Id) -> symbol -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. lid -> symbol -> Id
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> symbol -> Id
sym_name lid
l
symKind :: lid -> symbol -> String
symKind _ _ = "defaultKind"
symsOfSen :: lid -> sign -> sentence -> [symbol]
symsOfSen _ _ _ = []
pair_symbols :: lid -> symbol -> symbol -> Result symbol
pair_symbols lid :: lid
lid _ _ = String -> Result symbol
forall a. HasCallStack => String -> a
error (String -> Result symbol) -> String -> Result symbol
forall a b. (a -> b) -> a -> b
$ "pair_symbols nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> String
forall a. Show a => a -> String
show lid
lid
singletonList :: a -> [a]
singletonList :: a -> [a]
singletonList x :: a
x = [a
x]
symset_of :: forall lid sentence sign morphism symbol .
Sentences lid sentence sign morphism symbol =>
lid -> sign -> Set.Set symbol
symset_of :: lid -> sign -> Set symbol
symset_of lid :: lid
lid sig :: sign
sig = [Set symbol] -> Set symbol
forall (f :: * -> *) a. (Foldable f, Ord a) => f (Set a) -> Set a
Set.unions ([Set symbol] -> Set symbol) -> [Set symbol] -> Set symbol
forall a b. (a -> b) -> a -> b
$ lid -> sign -> [Set symbol]
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> [Set symbol]
sym_of lid
lid sign
sig
symlist_of :: forall lid sentence sign morphism symbol .
Sentences lid sentence sign morphism symbol =>
lid -> sign -> [symbol]
symlist_of :: lid -> sign -> [symbol]
symlist_of lid :: lid
lid sig :: sign
sig = (Set symbol -> [symbol]) -> [Set symbol] -> [symbol]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Set symbol -> [symbol]
forall a. Set a -> [a]
Set.toList ([Set symbol] -> [symbol]) -> [Set symbol] -> [symbol]
forall a b. (a -> b) -> a -> b
$ lid -> sign -> [Set symbol]
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> [Set symbol]
sym_of lid
lid sign
sig
inlineAxioms :: StaticAnalysis lid
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol => lid -> String -> [Named sentence]
inlineAxioms :: lid -> String -> [Named sentence]
inlineAxioms _ _ = String -> [Named sentence]
forall a. HasCallStack => String -> a
error "inlineAxioms"
statFail :: (Language lid, Fail.MonadFail m) => lid -> String -> m a
statFail :: lid -> String -> m a
statFail lid :: lid
lid = String -> m a
forall (m :: * -> *) a. MonadFail m => String -> m a
Fail.fail (String -> m a) -> ShowS -> String -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. lid -> ShowS
forall lid. Language lid => lid -> ShowS
statErrMsg lid
lid
statError :: Language lid => lid -> String -> a
statError :: lid -> String -> a
statError lid :: lid
lid = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> ShowS -> String -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. lid -> ShowS
forall lid. Language lid => lid -> ShowS
statErrMsg lid
lid
statErrMsg :: Language lid => lid -> String -> String
statErrMsg :: lid -> ShowS
statErrMsg lid :: lid
lid str :: String
str =
"Logic." String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
str String -> ShowS
forall a. [a] -> [a] -> [a]
++ " not implemented for: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> String
forall lid. Language lid => lid -> String
language_name lid
lid
data REL_REF = Subs | IsSubs | Equiv | Incomp
| HasInst | InstOf | DefRel
| RelName IRI
deriving (Int -> REL_REF -> ShowS
[REL_REF] -> ShowS
REL_REF -> String
(Int -> REL_REF -> ShowS)
-> (REL_REF -> String) -> ([REL_REF] -> ShowS) -> Show REL_REF
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [REL_REF] -> ShowS
$cshowList :: [REL_REF] -> ShowS
show :: REL_REF -> String
$cshow :: REL_REF -> String
showsPrec :: Int -> REL_REF -> ShowS
$cshowsPrec :: Int -> REL_REF -> ShowS
Show, REL_REF -> REL_REF -> Bool
(REL_REF -> REL_REF -> Bool)
-> (REL_REF -> REL_REF -> Bool) -> Eq REL_REF
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: REL_REF -> REL_REF -> Bool
$c/= :: REL_REF -> REL_REF -> Bool
== :: REL_REF -> REL_REF -> Bool
$c== :: REL_REF -> REL_REF -> Bool
Eq)
class ( Syntax lid basic_spec symbol symb_items symb_map_items
, Sentences lid sentence sign morphism symbol
, GetRange raw_symbol, Ord raw_symbol, Pretty raw_symbol
, Typeable raw_symbol)
=> StaticAnalysis lid
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol
| lid -> basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol
where
basic_analysis :: lid
-> Maybe ((basic_spec, sign, GlobalAnnos)
-> Result (basic_spec, ExtSign sign symbol, [Named sentence]))
basic_analysis _ = Maybe
((basic_spec, sign, GlobalAnnos)
-> Result (basic_spec, ExtSign sign symbol, [Named sentence]))
forall a. Maybe a
Nothing
sen_analysis :: lid
-> Maybe ((basic_spec, sign, sentence) -> Result sentence)
sen_analysis _ = Maybe ((basic_spec, sign, sentence) -> Result sentence)
forall a. Maybe a
Nothing
extBasicAnalysis :: lid -> IRI -> LibName
-> basic_spec -> sign -> GlobalAnnos
-> Result (basic_spec, ExtSign sign symbol, [Named sentence])
extBasicAnalysis l :: lid
l _ _ b :: basic_spec
b s :: sign
s g :: GlobalAnnos
g = case lid
-> Maybe
((basic_spec, sign, GlobalAnnos)
-> Result (basic_spec, ExtSign sign symbol, [Named sentence]))
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid
-> Maybe
((basic_spec, sign, GlobalAnnos)
-> Result (basic_spec, ExtSign sign symbol, [Named sentence]))
basic_analysis lid
l of
Nothing -> lid
-> String
-> Result (basic_spec, ExtSign sign symbol, [Named sentence])
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "basic_analysis"
Just ba :: (basic_spec, sign, GlobalAnnos)
-> Result (basic_spec, ExtSign sign symbol, [Named sentence])
ba -> (basic_spec, sign, GlobalAnnos)
-> Result (basic_spec, ExtSign sign symbol, [Named sentence])
ba (basic_spec
b, sign
s, GlobalAnnos
g)
stat_symb_map_items :: lid -> sign -> Maybe sign -> [symb_map_items]
-> Result (EndoMap raw_symbol)
stat_symb_map_items l :: lid
l _ _ _ = lid -> String -> Result (EndoMap raw_symbol)
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "stat_symb_map_items"
stat_symb_items :: lid -> sign -> [symb_items] -> Result [raw_symbol]
stat_symb_items l :: lid
l _ _ = lid -> String -> Result [raw_symbol]
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "stat_symb_items"
convertTheory :: lid -> Maybe ((sign, [Named sentence]) -> basic_spec)
convertTheory _ = Maybe ((sign, [Named sentence]) -> basic_spec)
forall a. Maybe a
Nothing
ensures_amalgamability :: lid ->
([CASLAmalgOpt],
Gr sign (Int, morphism),
[(Int, morphism)],
Gr String String)
-> Result Amalgamates
ensures_amalgamability l :: lid
l _ = Amalgamates -> String -> Range -> Result Amalgamates
forall a. a -> String -> Range -> Result a
warning Amalgamates
Amalgamates
("amalgamability test not implemented for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> String
forall a. Show a => a -> String
show lid
l)
Range
nullRange
quotient_term_algebra :: lid
-> morphism
-> [Named sentence]
-> Result
(sign,
[Named sentence]
)
quotient_term_algebra l :: lid
l _ _ = lid -> String -> Result (sign, [Named sentence])
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "quotient_term_algebra"
signature_colimit :: lid -> Gr sign (Int, morphism)
-> Result (sign, Map.Map Int morphism)
signature_colimit l :: lid
l _ = lid -> String -> Result (sign, Map Int morphism)
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "signature_colimit"
qualify :: lid -> SIMPLE_ID -> LibName -> morphism -> sign
-> Result (morphism, [Named sentence])
qualify l :: lid
l _ _ _ _ = lid -> String -> Result (morphism, [Named sentence])
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "qualify"
symbol_to_raw :: lid -> symbol -> raw_symbol
symbol_to_raw l :: lid
l _ = lid -> String -> raw_symbol
forall lid a. Language lid => lid -> String -> a
statError lid
l "symbol_to_raw"
id_to_raw :: lid -> Id -> raw_symbol
id_to_raw l :: lid
l _ = lid -> String -> raw_symbol
forall lid a. Language lid => lid -> String -> a
statError lid
l "id_to_raw"
matches :: lid -> symbol -> raw_symbol -> Bool
matches _ _ _ = Bool
True
empty_signature :: lid -> sign
add_symb_to_sign :: lid -> sign -> symbol -> Result sign
add_symb_to_sign l :: lid
l _ _ = lid -> String -> Result sign
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "add_symb_to_sign"
signature_union :: lid -> sign -> sign -> Result sign
signature_union l :: lid
l _ _ = lid -> String -> Result sign
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "signature_union"
signatureDiff :: lid -> sign -> sign -> Result sign
signatureDiff l :: lid
l _ _ = lid -> String -> Result sign
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "signatureDiff"
intersection :: lid -> sign -> sign -> Result sign
intersection l :: lid
l _ _ = lid -> String -> Result sign
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "intersection"
final_union :: lid -> sign -> sign -> Result sign
final_union l :: lid
l _ _ = lid -> String -> Result sign
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "final_union"
morphism_union :: lid -> morphism -> morphism -> Result morphism
morphism_union l :: lid
l _ _ = lid -> String -> Result morphism
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "morphism_union"
is_subsig :: lid -> sign -> sign -> Bool
is_subsig _ _ _ = Bool
False
subsig_inclusion :: lid -> sign -> sign -> Result morphism
subsig_inclusion l :: lid
l _ _ = lid -> String -> Result morphism
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "subsig_inclusion"
generated_sign, cogenerated_sign ::
lid -> Set.Set symbol -> sign -> Result morphism
generated_sign l :: lid
l _ _ = lid -> String -> Result morphism
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "generated_sign"
cogenerated_sign l :: lid
l _ _ = lid -> String -> Result morphism
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "cogenerated_sign"
induced_from_morphism ::
lid -> EndoMap raw_symbol -> sign -> Result morphism
induced_from_morphism l :: lid
l _ _ = lid -> String -> Result morphism
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "induced_from_morphism"
induced_from_to_morphism ::
lid -> EndoMap raw_symbol -> ExtSign sign symbol
-> ExtSign sign symbol -> Result morphism
induced_from_to_morphism l :: lid
l rm :: EndoMap raw_symbol
rm (ExtSign sig :: sign
sig _) (ExtSign tar :: sign
tar _) = do
morphism
mor <- lid -> EndoMap raw_symbol -> sign -> Result morphism
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid -> EndoMap raw_symbol -> sign -> Result morphism
induced_from_morphism lid
l EndoMap raw_symbol
rm sign
sig
lid -> sign -> sign -> Result morphism
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid -> sign -> sign -> Result morphism
inclusion lid
l (morphism -> sign
forall object morphism.
Category object morphism =>
morphism -> object
cod morphism
mor) sign
tar Result morphism -> (morphism -> Result morphism) -> Result morphism
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= morphism -> morphism -> Result morphism
forall object morphism.
Category object morphism =>
morphism -> morphism -> Result morphism
composeMorphisms morphism
mor
is_transportable :: lid -> morphism -> Bool
is_transportable _ _ = Bool
False
is_injective :: lid -> morphism -> Bool
is_injective _ _ = Bool
False
theory_to_taxonomy :: lid
-> TaxoGraphKind
-> MMiSSOntology
-> sign -> [Named sentence]
-> Result MMiSSOntology
theory_to_taxonomy l :: lid
l _ _ _ _ = lid -> String -> Result MMiSSOntology
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "theory_to_taxonomy"
corresp2th :: lid
-> String
-> Bool
-> sign
-> sign
-> [symb_items]
-> [symb_items]
-> EndoMap symbol
-> EndoMap symbol
-> REL_REF
-> Result (sign, [Named sentence], sign, sign,
EndoMap symbol, EndoMap symbol)
corresp2th _ _ _ _ _ _ _ _ _ = String
-> REL_REF
-> Result
(sign, [Named sentence], sign, sign, EndoMap symbol,
EndoMap symbol)
forall a. HasCallStack => String -> a
error "c2th nyi"
equiv2cospan :: lid -> sign -> sign -> [symb_items] -> [symb_items]
-> Result (sign, sign, sign, EndoMap symbol, EndoMap symbol)
equiv2cospan _ _ _ _ _ = String -> Result (sign, sign, sign, EndoMap symbol, EndoMap symbol)
forall a. HasCallStack => String -> a
error "equiv2cospan nyi"
:: lid -> [IRI] -> (sign, [Named sentence])
-> Result (sign, [Named sentence])
extract_module _ _ = (sign, [Named sentence]) -> Result (sign, [Named sentence])
forall (m :: * -> *) a. Monad m => a -> m a
return
printTheory :: StaticAnalysis lid basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol
=> Maybe IRI -> lid -> (sign, [Named sentence]) -> Doc
printTheory :: Maybe IRI -> lid -> (sign, [Named sentence]) -> Doc
printTheory sm :: Maybe IRI
sm lid :: lid
lid th :: (sign, [Named sentence])
th@(s :: sign
s, l :: [Named sentence]
l) = case
(lid -> Maybe ((sign, [Named sentence]) -> basic_spec)
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid -> Maybe ((sign, [Named sentence]) -> basic_spec)
convertTheory lid
lid, Maybe IRI -> lid -> Maybe (basic_spec -> Doc)
forall lid basic_spec symbol symb_items symb_map_items.
Syntax lid basic_spec symbol symb_items symb_map_items =>
Maybe IRI -> lid -> Maybe (basic_spec -> Doc)
basicSpecPrinter Maybe IRI
sm lid
lid) of
(Just c :: (sign, [Named sentence]) -> basic_spec
c, Just p :: basic_spec -> Doc
p) -> basic_spec -> Doc
p ((sign, [Named sentence]) -> basic_spec
c (sign, [Named sentence])
th)
_ -> lid -> sign -> Doc
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> Doc
print_sign lid
lid sign
s Doc -> Doc -> Doc
$++$ [Doc] -> Doc
vsep ((Named sentence -> Doc) -> [Named sentence] -> [Doc]
forall a b. (a -> b) -> [a] -> [b]
map (lid -> Named sentence -> Doc
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> Named sentence -> Doc
print_named lid
lid) [Named sentence]
l)
inclusion :: StaticAnalysis lid basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol
=> lid -> sign -> sign -> Result morphism
inclusion :: lid -> sign -> sign -> Result morphism
inclusion l :: lid
l s1 :: sign
s1 s2 :: sign
s2 = if lid -> sign -> sign -> Bool
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid -> sign -> sign -> Bool
is_subsig lid
l sign
s1 sign
s2 then lid -> sign -> sign -> Result morphism
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid -> sign -> sign -> Result morphism
subsig_inclusion lid
l sign
s1 sign
s2
else String -> Result morphism
forall (m :: * -> *) a. MonadFail m => String -> m a
Fail.fail (String -> Result morphism) -> String -> Result morphism
forall a b. (a -> b) -> a -> b
$ Doc -> String
forall a. Show a => a -> String
show (Doc -> String) -> Doc -> String
forall a b. (a -> b) -> a -> b
$ [Doc] -> Doc
fsep
[ String -> Doc
text (lid -> String
forall lid. Language lid => lid -> String
language_name lid
l)
, String -> Doc
text "cannot construct inclusion. Symbol(s) missing in target:"
, Set symbol -> Doc
forall a. Pretty a => a -> Doc
pretty (Set symbol -> Doc) -> Set symbol -> Doc
forall a b. (a -> b) -> a -> b
$ Set symbol -> Set symbol -> Set symbol
forall a. Ord a => Set a -> Set a -> Set a
Set.difference (lid -> sign -> Set symbol
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> Set symbol
symset_of lid
l sign
s1) (Set symbol -> Set symbol) -> Set symbol -> Set symbol
forall a b. (a -> b) -> a -> b
$ lid -> sign -> Set symbol
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> Set symbol
symset_of lid
l sign
s2
, String -> Doc
text "\nSource is: "
, Set symbol -> Doc
forall a. Pretty a => a -> Doc
pretty (Set symbol -> Doc) -> Set symbol -> Doc
forall a b. (a -> b) -> a -> b
$ lid -> sign -> Set symbol
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> Set symbol
symset_of lid
l sign
s1
, String -> Doc
text "\nTarget is: "
, Set symbol -> Doc
forall a. Pretty a => a -> Doc
pretty (Set symbol -> Doc) -> Set symbol -> Doc
forall a b. (a -> b) -> a -> b
$ lid -> sign -> Set symbol
forall lid sentence sign morphism symbol.
Sentences lid sentence sign morphism symbol =>
lid -> sign -> Set symbol
symset_of lid
l sign
s2 ]
class (Ord l, Show l) => SemiLatticeWithTop l where
lub :: l -> l -> l
top :: l
instance SemiLatticeWithTop () where
lub :: () -> () -> ()
lub _ _ = ()
top :: ()
top = ()
isSubElem :: SemiLatticeWithTop l => l -> l -> Bool
isSubElem :: l -> l -> Bool
isSubElem a :: l
a b :: l
b = l -> l -> l
forall l. SemiLatticeWithTop l => l -> l -> l
lub l
a l
b l -> l -> Bool
forall a. Eq a => a -> a -> Bool
== l
b
class MinSublogic sublogic item where
minSublogic :: item -> sublogic
instance MinSublogic () a where
minSublogic :: a -> ()
minSublogic _ = ()
class MinSublogic sublogic item => ProjectSublogic sublogic item where
projectSublogic :: sublogic -> item -> item
instance ProjectSublogic () b where
projectSublogic :: () -> b -> b
projectSublogic _ = b -> b
forall a. a -> a
id
class MinSublogic sublogic item => ProjectSublogicM sublogic item where
projectSublogicM :: sublogic -> item -> Maybe item
instance ProjectSublogicM () b where
projectSublogicM :: () -> b -> Maybe b
projectSublogicM _ = b -> Maybe b
forall a. a -> Maybe a
Just
class SublogicName l where
sublogicName :: l -> String
instance SublogicName () where
sublogicName :: () -> String
sublogicName () = ""
type SyntaxTable = (PrecMap, AssocMap)
class (StaticAnalysis lid
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol,
SemiLatticeWithTop sublogics,
MinSublogic sublogics sentence,
ProjectSublogic sublogics basic_spec,
ProjectSublogicM sublogics symb_items,
ProjectSublogicM sublogics symb_map_items,
ProjectSublogic sublogics sign,
ProjectSublogic sublogics morphism,
ProjectSublogicM sublogics symbol,
Convertible sublogics,
SublogicName sublogics,
Ord proof_tree, Show proof_tree,
Convertible proof_tree)
=> Logic lid sublogics
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree
| lid -> sublogics
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree
where
parse_basic_sen :: lid -> Maybe (basic_spec -> AParser st sentence)
parse_basic_sen _ = Maybe (basic_spec -> AParser st sentence)
forall a. Maybe a
Nothing
stability :: lid -> Stability
stability _ = Stability
Experimental
data_logic :: lid -> Maybe AnyLogic
data_logic _ = Maybe AnyLogic
forall a. Maybe a
Nothing
top_sublogic :: lid -> sublogics
top_sublogic _ = sublogics
forall l. SemiLatticeWithTop l => l
top
all_sublogics :: lid -> [sublogics]
all_sublogics li :: lid
li = [lid -> sublogics
forall lid sublogics basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree.
Logic
lid
sublogics
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol
proof_tree =>
lid -> sublogics
top_sublogic lid
li]
bottomSublogic :: lid -> Maybe sublogics
bottomSublogic _ = Maybe sublogics
forall a. Maybe a
Nothing
sublogicDimensions :: lid -> [[sublogics]]
sublogicDimensions li :: lid
li = [lid -> [sublogics]
forall lid sublogics basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree.
Logic
lid
sublogics
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol
proof_tree =>
lid -> [sublogics]
all_sublogics lid
li]
parseSublogic :: lid -> String -> Maybe sublogics
parseSublogic li :: lid
li s :: String
s = String -> [(String, sublogics)] -> Maybe sublogics
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup String
s ([(String, sublogics)] -> Maybe sublogics)
-> [(String, sublogics)] -> Maybe sublogics
forall a b. (a -> b) -> a -> b
$ (sublogics -> (String, sublogics))
-> [sublogics] -> [(String, sublogics)]
forall a b. (a -> b) -> [a] -> [b]
map (\ l :: sublogics
l -> (sublogics -> String
forall l. SublogicName l => l -> String
sublogicName sublogics
l, sublogics
l))
([sublogics] -> [(String, sublogics)])
-> [sublogics] -> [(String, sublogics)]
forall a b. (a -> b) -> a -> b
$ lid -> [sublogics]
forall lid sublogics basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree.
Logic
lid
sublogics
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol
proof_tree =>
lid -> [sublogics]
all_sublogics lid
li
proj_sublogic_epsilon :: lid -> sublogics -> sign -> morphism
proj_sublogic_epsilon _ _ = sign -> morphism
forall object morphism.
Category object morphism =>
object -> morphism
ide
provers :: lid -> [Prover sign sentence morphism sublogics proof_tree]
provers _ = []
default_prover :: lid -> String
default_prover _ = ""
cons_checkers :: lid
-> [ConsChecker sign sentence
sublogics morphism proof_tree]
cons_checkers _ = []
conservativityCheck :: lid
-> [ConservativityChecker sign sentence morphism]
conservativityCheck _ = []
empty_proof_tree :: lid -> proof_tree
empty_proof_tree l :: lid
l = lid -> String -> proof_tree
forall lid a. Language lid => lid -> String -> a
statError lid
l "empty_proof_tree"
syntaxTable :: lid -> sign -> Maybe SyntaxTable
syntaxTable _ _ = Maybe SyntaxTable
forall a. Maybe a
Nothing
omdoc_metatheory :: lid -> Maybe OMDoc.OMCD
omdoc_metatheory _ = Maybe OMCD
forall a. Maybe a
Nothing
export_symToOmdoc :: lid -> OMDoc.NameMap symbol
-> symbol -> String -> Result OMDoc.TCElement
export_symToOmdoc l :: lid
l _ _ _ = lid -> String -> Result TCElement
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "export_symToOmdoc"
export_senToOmdoc :: lid -> OMDoc.NameMap symbol
-> sentence -> Result OMDoc.TCorOMElement
export_senToOmdoc l :: lid
l _ _ = lid -> String -> Result TCorOMElement
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "export_senToOmdoc"
export_theoryToOmdoc :: lid -> OMDoc.SigMap symbol -> sign
-> [Named sentence] -> Result [OMDoc.TCElement]
export_theoryToOmdoc _ _ _ _ = [TCElement] -> Result [TCElement]
forall (m :: * -> *) a. Monad m => a -> m a
return []
omdocToSym :: lid -> OMDoc.SigMapI symbol -> OMDoc.TCElement
-> String -> Result symbol
omdocToSym l :: lid
l _ _ _ = lid -> String -> Result symbol
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "omdocToSym"
omdocToSen :: lid -> OMDoc.SigMapI symbol -> OMDoc.TCElement
-> String -> Result (Maybe (Named sentence))
omdocToSen l :: lid
l _ _ _ = lid -> String -> Result (Maybe (Named sentence))
forall lid (m :: * -> *) a.
(Language lid, MonadFail m) =>
lid -> String -> m a
statFail lid
l "omdocToSen"
addOMadtToTheory :: lid -> OMDoc.SigMapI symbol
-> (sign, [Named sentence]) -> [[OMDoc.OmdADT]]
-> Result (sign, [Named sentence])
addOMadtToTheory l :: lid
l _ t :: (sign, [Named sentence])
t adts :: [[OmdADT]]
adts = do
Bool -> Result () -> Result ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ([[OmdADT]] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [[OmdADT]]
adts) (Result () -> Result ()) -> Result () -> Result ()
forall a b. (a -> b) -> a -> b
$ () -> String -> Range -> Result ()
forall a. a -> String -> Range -> Result a
warning ()
([String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [ "ADT handling not implemented for logic "
, lid -> String
forall a. Show a => a -> String
show lid
l, " but some adts have to be handled" ])
Range
nullRange
(sign, [Named sentence]) -> Result (sign, [Named sentence])
forall (m :: * -> *) a. Monad m => a -> m a
return (sign, [Named sentence])
t
addOmdocToTheory :: lid -> OMDoc.SigMapI symbol
-> (sign, [Named sentence]) -> [OMDoc.TCElement]
-> Result (sign, [Named sentence])
addOmdocToTheory _ _ t :: (sign, [Named sentence])
t _ = (sign, [Named sentence]) -> Result (sign, [Named sentence])
forall (m :: * -> *) a. Monad m => a -> m a
return (sign, [Named sentence])
t
sublogicOfTheo :: lid -> (sign, [sentence]) -> sublogics
sublogicOfTheo _ (sig :: sign
sig, axs :: [sentence]
axs) =
(sublogics -> sublogics -> sublogics)
-> sublogics -> [sublogics] -> sublogics
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl sublogics -> sublogics -> sublogics
forall l. SemiLatticeWithTop l => l -> l -> l
lub (sign -> sublogics
forall sublogic item. MinSublogic sublogic item => item -> sublogic
minSublogic sign
sig) ([sublogics] -> sublogics) -> [sublogics] -> sublogics
forall a b. (a -> b) -> a -> b
$ (sentence -> sublogics) -> [sentence] -> [sublogics]
forall a b. (a -> b) -> [a] -> [b]
map sentence -> sublogics
forall sublogic item. MinSublogic sublogic item => item -> sublogic
minSublogic [sentence]
axs
class Logic lid sublogics basic_spec sentence
symb_items symb_map_items sign
morphism symbol raw_symbol proof_tree
=> LogicalFramework lid sublogics basic_spec sentence
symb_items symb_map_items sign
morphism symbol raw_symbol proof_tree
| lid -> sublogics basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree
where
base_sig :: lid -> sign
base_sig l :: lid
l = String -> sign
forall a. HasCallStack => String -> a
error (String -> sign) -> String -> sign
forall a b. (a -> b) -> a -> b
$ "Function base_sig nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
write_logic :: lid -> String -> String
write_logic l :: lid
l = String -> ShowS
forall a. HasCallStack => String -> a
error
(String -> ShowS) -> String -> ShowS
forall a b. (a -> b) -> a -> b
$ "Function write_logic nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
write_syntax :: lid -> String -> morphism -> String
write_syntax l :: lid
l = String -> String -> morphism -> String
forall a. HasCallStack => String -> a
error (String -> String -> morphism -> String)
-> String -> String -> morphism -> String
forall a b. (a -> b) -> a -> b
$
"Function write_syntax nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
write_proof :: lid -> String -> morphism -> String
write_proof l :: lid
l = String -> String -> morphism -> String
forall a. HasCallStack => String -> a
error (String -> String -> morphism -> String)
-> String -> String -> morphism -> String
forall a b. (a -> b) -> a -> b
$
"Function write_proof nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
write_model :: lid -> String -> morphism -> String
write_model l :: lid
l = String -> String -> morphism -> String
forall a. HasCallStack => String -> a
error (String -> String -> morphism -> String)
-> String -> String -> morphism -> String
forall a b. (a -> b) -> a -> b
$
"Function write_model nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
read_morphism :: lid -> FilePath -> morphism
read_morphism l :: lid
l _ = String -> morphism
forall a. HasCallStack => String -> a
error (String -> morphism) -> String -> morphism
forall a b. (a -> b) -> a -> b
$
"Function read_morphism nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
write_comorphism :: lid -> String -> String -> String
-> morphism -> morphism -> morphism
-> String
write_comorphism l :: lid
l = String
-> String
-> String
-> String
-> morphism
-> morphism
-> morphism
-> String
forall a. HasCallStack => String -> a
error (String
-> String
-> String
-> String
-> morphism
-> morphism
-> morphism
-> String)
-> String
-> String
-> String
-> String
-> morphism
-> morphism
-> morphism
-> String
forall a b. (a -> b) -> a -> b
$
"Function write_comorphism nyi for logic " String -> ShowS
forall a. [a] -> [a] -> [a]
++ lid -> ShowS
forall a. Show a => a -> ShowS
shows lid
l "."
emptyTheory :: StaticAnalysis lid
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol =>
lid -> Theory sign sentence proof_tree
emptyTheory :: lid -> Theory sign sentence proof_tree
emptyTheory lid :: lid
lid = sign
-> ThSens sentence (ProofStatus proof_tree)
-> Theory sign sentence proof_tree
forall sign sen proof_tree.
sign
-> ThSens sen (ProofStatus proof_tree)
-> Theory sign sen proof_tree
Theory (lid -> sign
forall lid basic_spec sentence symb_items symb_map_items sign
morphism symbol raw_symbol.
StaticAnalysis
lid
basic_spec
sentence
symb_items
symb_map_items
sign
morphism
symbol
raw_symbol =>
lid -> sign
empty_signature lid
lid) ThSens sentence (ProofStatus proof_tree)
forall k a. Map k a
Map.empty
data AnyLogic = forall lid sublogics
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree .
Logic lid sublogics
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree =>
Logic lid
deriving Typeable
instance GetRange AnyLogic
instance Show AnyLogic where
show :: AnyLogic -> String
show (Logic lid :: lid
lid) = lid -> String
forall lid. Language lid => lid -> String
language_name lid
lid
instance Eq AnyLogic where
a :: AnyLogic
a == :: AnyLogic -> AnyLogic -> Bool
== b :: AnyLogic
b = AnyLogic -> AnyLogic -> Ordering
forall a. Ord a => a -> a -> Ordering
compare AnyLogic
a AnyLogic
b Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
EQ
instance Ord AnyLogic where
compare :: AnyLogic -> AnyLogic -> Ordering
compare = (AnyLogic -> String) -> AnyLogic -> AnyLogic -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing AnyLogic -> String
forall a. Show a => a -> String
show