Skip to content

Commit

Permalink
Merge pull request #425 from smucclaw/20230822-merge-dataflow
Browse files Browse the repository at this point in the history
20230822 merge dataflow
  • Loading branch information
mengwong authored Aug 21, 2023
2 parents 5ed45cb + f7544d1 commit cbe58b0
Show file tree
Hide file tree
Showing 17 changed files with 900 additions and 607 deletions.
5 changes: 4 additions & 1 deletion lib/haskell/natural4/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import LS.Interpreter
l4interpret,
onlyTheItems,
)
import LS.DataFlow
import LS.NLP.NLG
( allLangs,
expandRulesForNLG,
Expand Down Expand Up @@ -95,7 +96,7 @@ main = do
workuuid = SFL4.workdir opts <> "/" <> SFL4.uuiddir opts

-- Bits that have to do with natural language processing and generation
nlgLangs <- unsafeInterleaveIO allLangs
nlgLangs <- unsafeInterleaveIO allLangs -- [TODO] Edsko is not a fan and has a whole talk about why we should not use this.
strLangs <- unsafeInterleaveIO $ printLangs allLangs
(engE,engErr) <- xpLog <$> langEng
-- [NOTE] the Production Haskell book gives better ways to integrate Logging with IO
Expand Down Expand Up @@ -194,6 +195,7 @@ main = do
(totsFN, (asTSpretty, asTSerr)) = (workuuid <> "/" <> "ts", xpLog $ asTypescript l4i)
(togroundsFN, asGrounds) = (workuuid <> "/" <> "grounds", show $ groundrules rc rules)
(toOrgFN, asOrg) = (workuuid <> "/" <> "org", toOrg l4i rules)
(toDFGFN, (asDFG, asDFGerr)) = (workuuid <> "/" <> "dataflow", xpLog $ dataFlowAsDot l4i)
(toNL_FN, asNatLang) = (workuuid <> "/" <> "natlang", toNatLang l4i)
(toMaudeFN, asMaude) = (workuuid <> "/" <> "maude", Maude.rules2maudeStr rules)
(tonativeFN, asNative) = (workuuid <> "/" <> "native", unlines
Expand Down Expand Up @@ -233,6 +235,7 @@ main = do
-- however, we can flag specific exclusions by adding the --tomd option which, counterintuitively, disables tomd
when (toworkdir && not (null $ SFL4.uuiddir opts) && (null $ SFL4.only opts)) $ do

when (SFL4.tonative opts) $ mywritefile2 True toDFGFN iso8601 "dot" asDFG asDFGerr
when (SFL4.tonative opts) $ mywritefile True toOrgFN iso8601 "org" asOrg
when (SFL4.tonative opts) $ mywritefile True tonativeFN iso8601 "hs" asNative
when ( SFL4.tocorel4 opts) $ mywritefile2 True tocorel4FN iso8601 "l4" (commentIfError "--" asCoreL4) asCoreL4Err
Expand Down
136 changes: 66 additions & 70 deletions lib/haskell/natural4/doc/Interpreter.dot
Original file line number Diff line number Diff line change
@@ -1,89 +1,87 @@
strict digraph deps {
node [colorscheme=set312, style=filled];

subgraph cluster_2 {
label = "src/LS/Interpreter.hs";
"unleaf" [label= "unleaf", color=2];
"topsortedClasses" [label= "topsortedClasses", color=2];
"symbolTable" [label= "symbolTable", color=2];
"stitchRules" [label= "stitchRules", color=2];
"ruleNameStr" [label= "ruleNameStr", color=2];
"ruleDecisionGraph" [label= "ruleDecisionGraph", color=2];
"relPredRefsAll" [label= "relPredRefsAll", color=2];
"relPredRefs" [label= "relPredRefs", color=2];
"onlyTheItems" [label= "onlyTheItems", color=2];
"onlyItemNamed" [label= "onlyItemNamed", color=2];
"musings" [label= "musings", color=2];
"l4interpret" [label= "l4interpret", color=2];
"itemsByRule" [label= "itemsByRule", color=2];
"isRuleAlias" [label= "isRuleAlias", color=2];
"groupedByAOTree" [label= "groupedByAOTree", color=2];
"getRuleByName" [label= "getRuleByName", color=2];
"getRuleByLabelName" [label= "getRuleByLabelName", color=2];
"getRuleByLabel" [label= "getRuleByLabel", color=2];
"getInheritances" [label= "getInheritances", color=2];
"getCTkeys" [label= "getCTkeys", color=2];
"getAttrTypesIn" [label= "getAttrTypesIn", color=2];
"getAndOrTree" [label= "getAndOrTree", color=2];
"extractRPMT2Text" [label= "extractRPMT2Text", color=2];
"exposedRoots" [label= "exposedRoots", color=2];
"expandTraceDebugging" [label= "expandTraceDebugging", color=2];
"expandTrace" [label= "expandTrace", color=2];
"expandRulesByLabel" [label= "expandRulesByLabel", color=2];
"expandRule" [label= "expandRule", color=2];
"expandRP" [label= "expandRP", color=2];
"expandMT" [label= "expandMT", color=2];
"expandClauses\'" [label= "expandClauses\'", color=2];
"expandClauses" [label= "expandClauses", color=2];
"expandClause" [label= "expandClause", color=2];
"expandBody" [label= "expandBody", color=2];
"expandBSR\'" [label= "expandBSR\'", color=2];
"expandBSR" [label= "expandBSR", color=2];
"decisionRoots" [label= "decisionRoots", color=2];
"classHierarchy" [label= "classHierarchy", color=2];
"classGraph" [label= "classGraph", color=2];
"bsr2bsmt" [label= "bsr2bsmt", color=2];
"bsmtOfClauses" [label= "bsmtOfClauses", color=2];
"biggestItem" [label= "biggestItem", color=2];
"attrType" [label= "attrType", color=2];
"allCTkeys" [label= "allCTkeys", color=2];
}

subgraph cluster_1 {
label = "src/LS/XPile/SVG.hs";
"asAAsvg" [label= "asAAsvg", color=1];
label = "src/LS/Interpreter.hs";
"unleaf" [label= "unleaf", color=1];
"topsortedClasses" [label= "topsortedClasses", color=1];
"symbolTable" [label= "symbolTable", color=1];
"ruleNameStr" [label= "ruleNameStr", color=1];
"ruleLocalsOut" [label= "ruleLocalsOut", color=1];
"ruleLocalsIn" [label= "ruleLocalsIn", color=1];
"ruleLocals" [label= "ruleLocals", color=1];
"ruleDecisionGraph" [label= "ruleDecisionGraph", color=1];
"relPredRefsAll" [label= "relPredRefsAll", color=1];
"relPredRefs" [label= "relPredRefs", color=1];
"qaHornsT" [label= "qaHornsT", color=1];
"qaHornsR" [label= "qaHornsR", color=1];
"onlyTheItems" [label= "onlyTheItems", color=1];
"onlyItemNamed" [label= "onlyItemNamed", color=1];
"l4interpret" [label= "l4interpret", color=1];
"itemsByRule" [label= "itemsByRule", color=1];
"isRuleAlias" [label= "isRuleAlias", color=1];
"groupedByAOTree" [label= "groupedByAOTree", color=1];
"globalFacts" [label= "globalFacts", color=1];
"getRuleByName" [label= "getRuleByName", color=1];
"getRuleByLabelName" [label= "getRuleByLabelName", color=1];
"getRuleByLabel" [label= "getRuleByLabel", color=1];
"getMarkings" [label= "getMarkings", color=1];
"getInheritances" [label= "getInheritances", color=1];
"getCTkeys" [label= "getCTkeys", color=1];
"getAttrTypesIn" [label= "getAttrTypesIn", color=1];
"getAndOrTree" [label= "getAndOrTree", color=1];
"extractRPMT2Text" [label= "extractRPMT2Text", color=1];
"extractEnums" [label= "extractEnums", color=1];
"exposedRoots" [label= "exposedRoots", color=1];
"expandTraceDebugging" [label= "expandTraceDebugging", color=1];
"expandTrace" [label= "expandTrace", color=1];
"expandRulesByLabel" [label= "expandRulesByLabel", color=1];
"expandRule" [label= "expandRule", color=1];
"expandRP" [label= "expandRP", color=1];
"expandMT" [label= "expandMT", color=1];
"expandClauses\'" [label= "expandClauses\'", color=1];
"expandClauses" [label= "expandClauses", color=1];
"expandClause" [label= "expandClause", color=1];
"expandBody" [label= "expandBody", color=1];
"expandBSR\'" [label= "expandBSR\'", color=1];
"expandBSRM" [label= "expandBSRM", color=1];
"expandBSR" [label= "expandBSR", color=1];
"entryPoints" [label= "entryPoints", color=1];
"defaultToSuperType" [label= "defaultToSuperType", color=1];
"defaultToSuperClass" [label= "defaultToSuperClass", color=1];
"decisionRoots" [label= "decisionRoots", color=1];
"classHierarchy" [label= "classHierarchy", color=1];
"classGraph" [label= "classGraph", color=1];
"bsr2bsmt" [label= "bsr2bsmt", color=1];
"bsmtOfClauses" [label= "bsmtOfClauses", color=1];
"attrsAsMethods" [label= "attrsAsMethods", color=1];
"attrType" [label= "attrType", color=1];
"allCTkeys" [label= "allCTkeys", color=1];
}

"allCTkeys" -> "allCTkeys";
"allCTkeys" -> "getCTkeys";
"asAAsvg" -> "expandBSR";
"asAAsvg" -> "exposedRoots";
"asAAsvg" -> "groupedByAOTree";
"asAAsvg" -> "isRuleAlias";
"biggestItem" -> "itemsByRule";
"bsmtOfClauses" -> "bsr2bsmt";
"bsmtOfClauses" -> "expandClauses";
"bsmtOfClauses" -> "expandTrace";
"bsr2bsmt" -> "bsr2bsmt";
"classGraph" -> "classGraph";
"classHierarchy" -> "classHierarchy";
"classHierarchy" -> "defaultToSuperType";
"defaultToSuperType" -> "defaultToSuperClass";
"expandBSR" -> "expandBSR\'";
"expandBSR" -> "expandTrace";
"expandBSRM" -> "expandBSR";
"expandBSR\'" -> "expandBSR\'";
"expandBSR\'" -> "expandRP";
"expandBSR\'" -> "expandTrace";
"expandClause" -> "expandBSR\'";
"expandClause" -> "expandTrace";
"expandClauses" -> "expandClauses\'";
"expandClauses" -> "expandTrace";
"expandClauses\'" -> "expandRP";
"expandClauses\'" -> "expandTrace";
"expandClauses\'" -> "unleaf";
"expandMT" -> "expandClause";
"expandMT" -> "expandTrace";
"expandRP" -> "expandBSR\'";
"expandRP" -> "expandMT";
"expandRP" -> "expandTrace";
"expandRule" -> "expandRulesByLabel";
"expandRulesByLabel" -> "expandRule";
"expandTrace" -> "expandTraceDebugging";
Expand All @@ -98,25 +96,23 @@ strict digraph deps {
"getAndOrTree" -> "getRuleByName";
"getAttrTypesIn" -> "getAttrTypesIn";
"getAttrTypesIn" -> "getCTkeys";
"getInheritances" -> "defaultToSuperClass";
"getInheritances" -> "getCTkeys";
"groupedByAOTree" -> "decisionRoots";
"groupedByAOTree" -> "getAndOrTree";
"groupedByAOTree" -> "ruleDecisionGraph";
"itemsByRule" -> "getAndOrTree";
"l4interpret" -> "attrsAsMethods";
"l4interpret" -> "classHierarchy";
"l4interpret" -> "symbolTable";
"musings" -> "classGraph";
"musings" -> "expandBSR";
"musings" -> "expandRule";
"musings" -> "exposedRoots";
"musings" -> "getAndOrTree";
"musings" -> "groupedByAOTree";
"musings" -> "isRuleAlias";
"musings" -> "ruleDecisionGraph";
"onlyItemNamed" -> "itemsByRule";
"onlyTheItems" -> "getAndOrTree";
"qaHornsR" -> "expandBSR";
"qaHornsR" -> "exposedRoots";
"qaHornsR" -> "groupedByAOTree";
"qaHornsT" -> "qaHornsR";
"relPredRefsAll" -> "relPredRefs";
"ruleDecisionGraph" -> "relPredRefsAll";
"ruleLocals" -> "ruleLocalsIn";
"ruleLocals" -> "ruleLocalsOut";
"topsortedClasses" -> "getAttrTypesIn";
"topsortedClasses" -> "getCTkeys";
"topsortedClasses" -> "getInheritances";
Expand Down
Loading

0 comments on commit cbe58b0

Please sign in to comment.