Portability : non-portable (Logic)
graphParms :: (GraphAllConfig graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
=> (Graph graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
-> String -- ^ title of graph
arcType arcTypeParms) title =
AllowClose (return True) $$
makeNodeMenu :: ( GraphAllConfig graph graphParms node
arc arcType arcTypeParms,
=> (Graph graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
-- ^ display the value as a String
-> String -- ^ color of node
arcType arcTypeParms) showValue logicNodeMenu color =
stableColor, testingColor, unstableColor, experimentalColor,
unstableColor = "#CCFF66"
experimentalColor = "white"
proverColor = "lightsteelblue"
inclusionArcColor :: String
inclusionArcColor = "blue"
-- | Test whether a comorphism is an ad-hoc inclusion
isInclComorphism :: AnyComorphism -> Bool
isInclComorphism (Comorphism cid) =
Logic (sourceLogic cid) == Logic (targetLogic cid) &&
(isProperSublogic (G_sublogics (sourceLogic cid) (sourceSublogic cid))
(G_sublogics (targetLogic cid) (targetSublogic cid)))
(GraphAllConfig graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
=> (Graph graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
-- disp s tD = debug (s ++ (show tD))
logicG <- newGraph displaySrt (GlobalMenu (Menu Nothing [
Button "Show detailed logic graph" (showHSG) ]) $$
graphParms displaySrt "Logic Graph"
let logicNodeMenu = LocalMenu(Menu (Just "Info")
[Button "Tools" (\lg -> createTextDisplay
("Parsers, Provers and Cons_Checker of "
++ show lg) (showTools lg) [size(80,25)]),
Button "Sublogic" (\lg -> createTextDisplay ("Sublogics of "
++ show lg) (showSublogic lg) [size(80,25)]),
Button "Sublogic Graph" showSubLogicGraph,
Button "Description" (\lg -> createTextDisplay
("Description of " ++ show lg) (showDescription lg)
makeLogicNodeMenu color =
makeNodeMenu displaySrt (return . show)
stableNodeType <- newNodeType logicG $ makeLogicNodeMenu stableColor
testingNodeType <- newNodeType logicG $ makeLogicNodeMenu testingColor
unstableNodeType <- newNodeType logicG $ makeLogicNodeMenu unstableColor
experimentalNodeType <- newNodeType logicG $
makeLogicNodeMenu experimentalColor
newNodeType logicG $ makeLogicNodeMenu proverColor
Logic lid -> if (hasProver lid) then
newNode logicG proverNodeType logic
else let nodeType = case stability lid of
Testing -> testingNodeType
Unstable -> unstableNodeType
Experimental -> experimentalNodeType
in newNode logicG nodeType logic
where hasProver lid = not $ null $ provers lid
-- production of the nodes (in a list)
nodeList <- mapM newNode' (
Map.elems(logics logicGraph))
-- build the map with the node's name and the node.
{- each edge can also show the informations (the
description of comorphism and names of
let ssid = G_sublogics (sourceLogic cid)
tsid = G_sublogics (targetLogic cid)
in createTextDisplay (show c)
(showComoDescription c ++ "\n\n" ++
(language_name $ sourceLogic cid) ++
(language_name $ targetLogic cid) ++
"source sublogic: " ++ showSubTitle ssid ++
"target sublogic: " ++ showSubTitle tsid)
normalArcTypeParms = logicArcMenu $$$ -- normal comorphism
ValueTitle (\c -> case c of
return $ language_name cid) $$$
inclArcTypeParms = logicArcMenu $$$ -- inclusion
Color inclusionArcColor $$$
normalArcType <- newArcType logicG normalArcTypeParms
inclArcType <- newArcType logicG inclArcTypeParms
let insertComo = -- for cormophism
let sid = Logic (sourceLogic cid)
tid = Logic (targetLogic cid)
in newArc logicG normalArcType c (lookupLogi sid)
insertIncl = -- for inclusion
let sid = Logic (sourceLogic cid)
tid = Logic (targetLogic cid)
in newArc logicG inclArcType i (lookupLogi sid)
mapM_ insertIncl (
Map.elems(inclusions logicGraph))
filter (not . flip elem (
Map.elems(inclusions logicGraph))) $
(nullArcTypeParms :: arcTypeParms AnyComorphism) = emptyArcTypeParms
(nullSubArcTypeParms:: arcTypeParms [Char]) = emptyArcTypeParms
Logic lid -> unlines (map unwords $
map sublogic_names (all_sublogics lid))
G_sublogics _ sls -> unwords $ sublogic_names sls
Logic lid -> description lid ++
"\n\nStability: " ++ show (stability lid)
Comorphism cid -> description cid
Logic lid -> showParse lid ++ "\nProvers: " ++ showProver lid
++ "\nConsistency checkers: " ++ showConsChecker lid
showProver lid = if null (provers lid) then "None"
else unlines $ map prover_name (provers lid)
showConsChecker lid = if null (cons_checkers lid) then "None"
else unlines $ map prover_name (cons_checkers lid)
let s1 = case parse_basic_spec lid of
Just _ -> "Parser for basic specifications.\n"
s2 = case parse_symb_items lid of
Just _ -> "Parser for symbol lists.\n"
s3 = case parse_symb_map_items lid of
Just _ -> "Parser for symbol maps.\n"
s4 = case parse_sentence lid of
Just _ -> "Parser for sentences.\n"
s5 = case basic_analysis lid of
Just _ -> "Analysis of basic specifications.\n"
s6 = case data_logic lid of
Just _ -> "is a process logic.\n"
in (s1 ++ s2 ++ s3 ++ s4 ++ s5 ++ s6)
do subLogicG <- newGraph displaySrt
(graphParms displaySrt "SubLogic Graph")
let listG_Sublogics = -- map (\sbl -> G_sublogics sublid sbl)
subNodeMenu = LocalMenu (Menu Nothing [])
(\gsl -> return (unwords $ sublogic_names gsl)) $$$
subNodeType <- newNodeType subLogicG subNodeTypeParms
subNodeList <- mapM (newNode subLogicG subNodeType)
zip listG_Sublogics subNodeList
(error "lookupSublogic: node not found")
subArcMenu = LocalMenu( Menu Nothing [])
subArcTypeParms = subArcMenu $$$
subArcType <- newArcType subLogicG subArcTypeParms
let insertSubArc = \ (node1, node2) ->
newArc subLogicG subArcType ""
mapM_ insertSubArc subl_nodes
(GraphAllConfig graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
=> (Graph graph graphParms node nodeType nodeTypeParms
arc arcType arcTypeParms)
logicG <- newGraph displaySrt (graphParms displaySrt
"Heterogeneous Sublogic Graph")
let logicNodeMenu = LocalMenu(Menu (Just "Info")
[Button "Tools" (\lg -> createTextDisplay
("Parsers, Provers and Cons_Checker of "
++ show lg) (showTools lg) [size(80,25)]),
Button "Sublogic" (\lg -> createTextDisplay ("Sublogics of "
++ show lg) (showSublogic lg) [size(80,25)]),
Button "Description" (\lg -> createTextDisplay
("Description of " ++ show lg) (showDescription lg)
makeLogicNodeMenu color =
makeNodeMenu displaySrt (return . show)
stableNodeType <- newNodeType logicG $ makeLogicNodeMenu stableColor
testingNodeType <- newNodeType logicG $ makeLogicNodeMenu testingColor
unstableNodeType <- newNodeType logicG $ makeLogicNodeMenu unstableColor
newNodeType logicG $ makeLogicNodeMenu experimentalColor
newNodeType logicG $ makeLogicNodeMenu proverColor
let newNode' gsl@(G_sublogics lid _) =
if not $ null $ provers lid
then newNode logicG proverNodeType gsl
else let nodeType = case stability lid of
Testing -> testingNodeType
Unstable -> unstableNodeType
Experimental -> experimentalNodeType
in newNode logicG nodeType gsl
-- production of the nodes (in a list)
nodeList <- mapM newNode' (
Map.elems(sublogicNodes hetSublogicGraph))
-- build the map with the node's name and the node.
{- each edge can also show the informations (the
description of comorphism and names of
let ssid = G_sublogics (sourceLogic cid)
tsid = G_sublogics (targetLogic cid)
in createTextDisplay (show c)
(showComoDescription c ++ "\n\n" ++
(language_name $ sourceLogic cid) ++
(language_name $ targetLogic cid) ++
"source sublogic: " ++ showSubTitle ssid ++
"target sublogic: " ++ showSubTitle tsid)
acmName = (\ (Comorphism cid) -> return $ language_name cid)
normalArcTypeParms = logicArcMenu $$$ -- normal comorphism
inclArcTypeParms = logicArcMenu $$$ -- inclusion
Color inclusionArcColor $$$
Color inclusionArcColor $$$ -- ad-hoc inclusion
normalArcType <- newArcType logicG normalArcTypeParms
inclArcType <- newArcType logicG inclArcTypeParms
adhocInclArcType <- newArcType logicG adhocInclArcTypeParms
newArc logicG tp acm (lookupLogi src)
partition ((`elem`
Map.elems (inclusions logicGraph)) . snd) $
concatMap (\ (x, ys) -> zip (repeat x) ys) $
(comorphismEdges hetSublogicGraph)
partition (isInclComorphism . snd) notInclCom
sequence_ $ map (insertArcType inclArcType) inclCom
sequence_ $ map (insertArcType adhocInclArcType) adhocCom
sequence_ $ map (insertArcType normalArcType) normalCom
(nullArcTypeParms :: arcTypeParms AnyComorphism) = emptyArcTypeParms
showSublogic (G_sublogics lid _) =
unlines (map unwords $ map sublogic_names (all_sublogics lid))
G_sublogics _ sls -> unwords $ sublogic_names sls
showDescription (G_sublogics lid _) =
description lid ++ "\n\nStability: " ++ show (stability lid)
Comorphism cid -> description cid
showTools (G_sublogics lid _) =
showParse lid ++ "\nProvers: " ++ showProver lid
++ "\nConsistency checkers: " ++ showConsChecker lid
showProver li = case provers li of
ls -> unlines $ map prover_name ls
showConsChecker li = case cons_checkers li of
ls -> unlines $ map prover_name ls
let s1 = case parse_basic_spec li of
Just _ -> "Parser for basic specifications.\n"
s2 = case parse_symb_items li of
Just _ -> "Parser for symbol lists.\n"
s3 = case parse_symb_map_items li of
Just _ -> "Parser for symbol maps.\n"
s4 = case parse_sentence li of
Just _ -> "Parser for sentences.\n"
s5 = case basic_analysis li of
Just _ -> "Analysis of basic specifications.\n"
s6 = case data_logic li of
Just _ -> "is a process logic.\n"
in (s1 ++ s2 ++ s3 ++ s4 ++ s5 ++ s6)
showHSG = showHetSublogicGraph daVinciSort
showLG = showLogicGraph daVinciSort