Skip to content

Commit

Permalink
at first glance i think the data flow is being set up correctly, next…
Browse files Browse the repository at this point in the history
… dot
  • Loading branch information
mengwong committed Aug 15, 2023
1 parent 1240740 commit fed88aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/haskell/natural4/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,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 <> "/" <> "dfg", xpLog $ dataFlowAsDot l4i)
(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
8 changes: 4 additions & 4 deletions lib/haskell/natural4/src/LS/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ ruleDecisionGraph rs = do
mutterd 3 "(2.5) let's elevate all the leaf terms to stubby little rules in their own right"
let stubRules = [ defaultHorn { name = rulename, keyword = Define, srcref = Nothing
, clauses = stubClause rulename }
| rulename <- ruleNames ]
| rulename <- difference ]

mutterd 3 "(2.6) then we rebuild the graph with those rules included"
let expandedRuleMap = Map.fromList (Prelude.zip (decisionRules ++ stubRules) [1..])
Expand All @@ -390,8 +390,8 @@ ruleDecisionGraph rs = do

mutterd 3 "(3.1) finally we strip the reflexive BSR from the stub rules while leaving the nodes themselves in place."

let prunedRuleGraph = nmap (\r@Hornlike{..} -> if clauses == stubClause name then r { clauses = [] } else r ) expandedRuleGraph
"(2.7) prunedRuleGraph" ***-> prunedRuleGraph
let prunedRuleGraph = nmap (\r -> if hasClauses r && clauses r == stubClause (name r) then r { clauses = [] } else r ) expandedRuleGraph
"(3.2.7) prunedRuleGraph" ***-> prunedRuleGraph

return prunedRuleGraph

Expand Down Expand Up @@ -450,7 +450,7 @@ relPredRefs rs ridmap r = do
mutterdhsf 5 "relPredRefs: bodyElements" pShowNoColorS bodyElements

-- [BUG] at some point we lose the moon

mutterd 5 "relPredReffs: will exclude various things not found in headElements"
-- given a rule R, for each term relied on by rule R, identify all the subsidiary rules which define those terms.
toreturn <- sequence
[ (rid, targetRuleId', ()) <$ mutterd 6 ("relPredRefs list comp: returning " <> show rid <> ", " <> show targetRuleId')
Expand Down

0 comments on commit fed88aa

Please sign in to comment.