-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathLogic_OWL.hs
164 lines (134 loc) · 4.76 KB
/
Logic_OWL.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
{-# OPTIONS -cpp #-}
{- |
Module : $Header$
Description : instance of the class Logic for OWL
Copyright : (c) Klaus Luettich, Heng Jiang, Uni Bremen 2002-2004
License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : provisional
Portability : portable
Here is the place where the class Logic is instantiated for OWL.
__SROIQ__
-}
module OWL.Logic_OWL where
import Common.AS_Annotation
import Common.Doc
import Common.DocUtils
import Common.ProofTree
import ATC.ProofTree ()
import ATC.AS ()
import Logic.Logic
import OWL.AS
import OWL.Parse
import OWL.Print ()
import OWL.ATC_OWL ()
import OWL.Sign
import OWL.StaticAnalysis
import OWL.Sublogic
import OWL.Morphism
import Common.Consistency
import Common.ProverTools
#ifdef UNI_PACKAGE
import OWL.ProvePellet
-- import OWL.ProveFact
import OWL.Conservativity
import OWL.Taxonomy
#endif
data OWL = OWL deriving Show
instance Language OWL where
description _ =
"OWL DL -- Web Ontology Language Description Logic http://wwww.w3c.org/"
instance Category Sign OWLMorphism where
ide sig = inclOWLMorphism sig sig
dom = osource
cod = otarget
legal_mor = legalMor
isInclusion = isOWLInclusion
composeMorphisms = composeMor
instance Syntax OWL OntologyFile SymbItems SymbMapItems where
parse_basic_spec OWL = Just basicSpec
parse_symb_items OWL = Just symbItems
parse_symb_map_items OWL = Just symbMapItems
instance Sentences OWL Axiom Sign OWLMorphism Entity where
map_sen OWL = mapSen
print_named OWL namedSen =
pretty (sentence namedSen) <>
if isAxiom namedSen then empty else space <> text "%implied"
sym_of OWL = symOf
instance StaticAnalysis OWL OntologyFile Axiom
SymbItems SymbMapItems
Sign
OWLMorphism
Entity RawSymb where
{- these functions are implemented in OWL.StaticAna and OWL.Sign. -}
basic_analysis OWL = Just basicOWLAnalysis
stat_symb_items OWL = return . statSymbItems
stat_symb_map_items OWL = statSymbMapItems
empty_signature OWL = emptySign
signature_union OWL s = return . addSign s
final_union OWL = signature_union OWL
is_subsig OWL = isSubSign
subsig_inclusion OWL s = return . inclOWLMorphism s
matches OWL = matchesSym
symbol_to_raw OWL = ASymbol
induced_from_morphism OWL = inducedFromMor
cogenerated_sign OWL = cogeneratedSign
generated_sign OWL = fail "cogenerated_sign OWL nyi"
#ifdef UNI_PACKAGE
theory_to_taxonomy OWL = onto2Tax
#endif
{- this function will be implemented in OWL.Taxonomy
theory_to_taxonomy OWL = convTaxo
-}
instance Logic OWL OWLSub OntologyFile Axiom SymbItems SymbMapItems
Sign
OWLMorphism Entity RawSymb ProofTree where
-- stability _ = Testing
-- default implementations are fine
-- the prover uses HTk and IO functions from uni
#ifdef UNI_PACKAGE
provers OWL = unsafeFileCheck "pellet.sh" "PELLET_PATH" pelletProver
cons_checkers OWL =
unsafeFileCheck "pellet.sh" "PELLET_PATH" pelletConsChecker
conservativityCheck OWL =
unsafeFileCheck "OWLLocality.jar" "HETS_OWL_TOOLS"
(ConservativityChecker "Locality_BOTTOM_BOTTOM"
$ conserCheck "BOTTOM_BOTTOM")
++ unsafeFileCheck "OWLLocality.jar" "HETS_OWL_TOOLS"
(ConservativityChecker "Locality_TOP_BOTTOM"
$ conserCheck "TOP_BOTTOM")
++ unsafeFileCheck "OWLLocality.jar" "HETS_OWL_TOOLS"
(ConservativityChecker "Locality_TOP_TOP"
$ conserCheck "TOP_TOP")
#endif
instance SemiLatticeWithTop OWLSub where
join = sl_max
top = sl_top
instance SublogicName OWLSub where
sublogicName = sl_name
instance MinSublogic OWLSub Axiom where
minSublogic = sl_ax
instance MinSublogic OWLSub OWLMorphism where
minSublogic = sl_mor
instance ProjectSublogic OWLSub OWLMorphism where
projectSublogic = pr_mor
instance MinSublogic OWLSub Sign where
minSublogic = sl_sig
instance ProjectSublogic OWLSub Sign where
projectSublogic = pr_sig
instance MinSublogic OWLSub SymbItems where
minSublogic = const sl_top
instance MinSublogic OWLSub SymbMapItems where
minSublogic = const sl_top
instance MinSublogic OWLSub Entity where
minSublogic = const sl_top
instance MinSublogic OWLSub OntologyFile where
minSublogic = sl_o_file
instance ProjectSublogicM OWLSub SymbItems where
projectSublogicM = const Just
instance ProjectSublogicM OWLSub SymbMapItems where
projectSublogicM = const Just
instance ProjectSublogicM OWLSub Entity where
projectSublogicM = const Just
instance ProjectSublogic OWLSub OntologyFile where
projectSublogic = pr_o_file