Skip to content

Commit

Permalink
ported to fgl
Browse files Browse the repository at this point in the history
git-svn-id: https://svn-agbkb.informatik.uni-bremen.de/Hets/trunk@4275 cec4b9c1-7d33-0410-9eda-942365e851bb
  • Loading branch information
Christian Maeder authored and Christian Maeder committed May 13, 2005
1 parent 68f8cb9 commit 0799b5d
Show file tree
Hide file tree
Showing 21 changed files with 166 additions and 688 deletions.
21 changes: 0 additions & 21 deletions ATC/Graph.header.hs

This file was deleted.

1 change: 0 additions & 1 deletion ATC/Grothendieck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import Common.ATerm.Lib
import Common.Result
import Comorphisms.LogicGraph
import Logic.Logic
import ATC.Graph
import qualified Common.Lib.Set as Set

instance ShATermConvertible G_basic_spec where
Expand Down
11 changes: 6 additions & 5 deletions CASL/Amalgamability.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ module CASL.Amalgamability(-- * Types

import CASL.AS_Basic_CASL
import Common.Id
import Common.Lib.Graph
import Data.Graph.Inductive.Graph
import qualified Data.Graph.Inductive.Tree as Tree
import qualified Common.Lib.Map as Map
import qualified Common.Lib.Rel as Rel
import qualified Common.Lib.Set as Set
Expand All @@ -46,7 +47,7 @@ type CASLSign = Sign () ()
type CASLMor = Morphism () () ()

-- Miscellaneous types
type CASLDiag = Diagram CASLSign CASLMor
type CASLDiag = Tree.Gr CASLSign CASLMor
type DiagSort = (Node, SORT)
type DiagOp = (Node, (Id, OpType))
type DiagPred = (Node, (Id, PredType))
Expand All @@ -60,7 +61,7 @@ type EquivRel a = [EquivClass a]
type EquivRelTagged a b = [(a, b)]

-- PrettyPrint instance (for diagnostic output)
instance (PrettyPrint a, PrettyPrint b) => PrettyPrint (Diagram a b) where
instance (PrettyPrint a, PrettyPrint b) => PrettyPrint (Tree.Gr a b) where
printText0 ga diag =
ptext "nodes: "
<+> (printText0 ga (labNodes diag))
Expand Down Expand Up @@ -458,7 +459,7 @@ sinkEmbs :: CASLDiag -- ^ the diagram
-> [DiagEmb]
sinkEmbs _ [] = []
sinkEmbs diag ((srcNode, _) : edgs) =
let (_, _, Sign {sortRel = sr}, _) = context srcNode diag
let (_, _, Sign {sortRel = sr}, _) = context diag srcNode
in (map (\(s1, s2) -> (srcNode, s1, s2)) (Rel.toList sr))
++ (sinkEmbs diag edgs)

Expand Down Expand Up @@ -1023,7 +1024,7 @@ hasColimitThinnessOpt = any ( \ o -> case o of
ensuresAmalgamability :: [CASLAmalgOpt] -- ^ program options
-> CASLDiag -- ^ the diagram to be checked
-> [(Node, CASLMor)] -- ^ the sink
-> Diagram String String
-> Tree.Gr String String
-- ^ the diagram containing descriptions of nodes and edges
-> Result Amalgamates
ensuresAmalgamability opts diag sink desc =
Expand Down
4 changes: 0 additions & 4 deletions Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ identifiers and annotations as well as their parsing and printing.
* "Common.ATerm.ReadWrite"
* "Common.Lib.Graph"
* "Common.Lib.Map"
* "Common.Lib.Pretty"
Expand All @@ -85,8 +83,6 @@ identifiers and annotations as well as their parsing and printing.
* "Common.Lib.Set"
* "Common.Lib.SimpleMap"
* "Common.Lib.State"
-}
Expand Down
16 changes: 16 additions & 0 deletions Common/ATerm/ConvInstances.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ module Common.ATerm.ConvInstances where

import Common.ATerm.Conversion
import Common.ATerm.AbstractSyntax
import Data.Graph.Inductive.Graph
import qualified Data.Graph.Inductive.Tree as Tree
import qualified Common.Lib.Map as Map
import qualified Common.Lib.Set as Set
import qualified Common.Lib.Rel as Rel
import Common.Id
import Common.Result

instance (ShATermConvertible a,
ShATermConvertible b) => ShATermConvertible (Tree.Gr a b) where
toShATerm att0 graph =
case toShATerm att0 (labNodes graph) of { (att1,aa') ->
case toShATerm att1 (labEdges graph) of { (att2,bb') ->
addATerm (ShAAppl "Graph" [ aa' , bb' ] []) att2}}
fromShATerm att =
case getATerm att of
(ShAAppl "Graph" [ aa , bb ] _) ->
case fromShATerm (getATermByIndex1 aa att) of { aa' ->
case fromShATerm (getATermByIndex1 bb att) of { bb' ->
mkGraph aa' bb' }}
u -> fromShATermError "Graph" u

instance (Ord a, ShATermConvertible a, ShATermConvertible b)
=> ShATermConvertible (Map.Map a b) where
{-# SPECIALIZE instance ShATermConvertible (Map.Map Id (Set.Set Id)) #-}
Expand Down
51 changes: 0 additions & 51 deletions Common/GraphUtils.hs

This file was deleted.

Loading

0 comments on commit 0799b5d

Please sign in to comment.