Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1693 datatypes for dol #2153

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Common/Consistency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data Conservativity =
| PCons
| Cons
| Mono
| WDef
| Def
deriving (Show, Read, Eq, Ord, Typeable, Data)

Expand All @@ -42,6 +43,7 @@ showConsistencyStatus cs = case cs of
Cons -> "conservative"
PCons -> "proof-theoretically conservative"
Mono -> "monomorphic"
WDef -> "weak definitional"
Def -> "definitional"

instance Pretty Conservativity where
Expand Down
31 changes: 31 additions & 0 deletions Static/DevGraph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ data DGLinkOrigin =
data DGLinkType =
ScopedLink Scope LinkKind ConsStatus
| HidingDefLink
| ApproxLink
-- same as hiding definition link, but needs to be treated differently
-- e.g. when computing theories
| FreeOrCofreeDefLink FreeOrCofree MaybeNode -- the "parameter" node
| HidingFreeOrCofreeThm (Maybe FreeOrCofree) Node GMorphism ThmLinkStatus
{- DGLink S1 S2 m2 (DGLinkType m1 p) n
Expand Down Expand Up @@ -355,6 +358,7 @@ getHomEdgeType isPend isHom lt = case lt of
, isConservativ = isProvenConsStatusLink cons
, isPending = isPend } -- needs to be checked
HidingDefLink -> HidingDef
ApproxLink -> ApproxDef
FreeOrCofreeDefLink fc _ -> FreeOrCofreeDef fc
HidingFreeOrCofreeThm mh _ _ st -> ThmType
{ thmEdgeType = case mh of
Expand Down Expand Up @@ -679,10 +683,37 @@ refSigComposition (ComponentRefSig n1 rsmap1) (ComponentRefSig n2 rsmap2) = do
refSigComposition _rsig1 _rsig2 =
Fail.fail "composition of refinement signatures"

-- | signature of modules

data ModuleSig = ModuleSig NodeSig NodeSig
deriving (Show, Typeable)
-- the first NodeSig is the node of the module
-- the second is the one of the original ontology
-- this determines uniquely the edge between them
-- labeled with the inclusion

-- | signature of equivalences

data EquivSig = EquivSig GDiagram GDiagram GDiagram
deriving (Show, Typeable)

-- we use the type GDiagram to store graphs
-- we have just one datatype for all types of equivalences
-- the ontologies in semantics of OMS equivalences
-- can be regarded as a graph with one node and no edges

-- | signature of entailments

data EntailSig = EntailSig GDiagram
deriving (Show, Typeable)

-- | an entry of the global environment
data GlobalEntry =
SpecEntry ExtGenSig
| ViewOrStructEntry Bool ExtViewSig
| ModuleEntry ModuleSig
| EntailmentEntry EntailSig
| EquivalenceEntry EquivSig
| ArchOrRefEntry Bool RefSig
| AlignEntry AlignSig
| UnitEntry UnitSig
Expand Down
3 changes: 2 additions & 1 deletion Static/DgUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ data Scope = Local | Global deriving (Show, Eq, Ord, Typeable, Data)
data LinkKind = DefLink | ThmLink ThmLinkStatus
deriving (Show, Eq, Ord, Typeable, Data)

data FreeOrCofree = Free | Cofree | NPFree | Minimize
data FreeOrCofree = Free | Cofree | NPFree | Minimize | Maximize
deriving (Show, Eq, Ord, Enum, Bounded, Read, Typeable, Data)

fcList :: [FreeOrCofree]
Expand Down Expand Up @@ -270,6 +270,7 @@ data DGEdgeTypeModInc =
GlobalDef
| HetDef
| HidingDef
| ApproxDef
| LocalDef
| FreeOrCofreeDef FreeOrCofree
| ThmType { thmEdgeType :: ThmTypes
Expand Down
1 change: 1 addition & 0 deletions Static/DotGraph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ edgeAttributes ety = concatMap (", " ++)
GlobalDef -> []
HetDef -> ["color=" ++ doubleColor "black"]
HidingDef -> ["color=blue"]
ApproxDef -> ["color=orange"] -- should think of something else here
LocalDef -> ["style=dashed"]
FreeOrCofreeDef _ -> ["color=blue"]
ThmType
Expand Down
11 changes: 11 additions & 0 deletions Static/GTheory.hs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,17 @@ propagateProofs locTh@(G_theory lid1 syn sig ind lsens _)
-- | Grothendieck diagrams
type GDiagram = Gr G_theory (Int, GMorphism)

-- | Morphisms between networks

data DistributedMorphism =
DistributedMorphism {
sourceNetwork :: GDiagram,
targetNetwork :: GDiagram,
graphMorphism :: Map.Map (Node, Node) GMorphism
}

-- static analysis should check naturality condition

-- | checks whether a connected GDiagram is homogeneous

isHomogeneousGDiagram :: GDiagram -> Bool
Expand Down
Loading