From d788d4b4960ac34ba70562ec54118315fd509ffe Mon Sep 17 00:00:00 2001 From: Maryyam Niazi Date: Tue, 17 Jul 2018 11:43:34 -0400 Subject: [PATCH] running make now gets to logs after GlassBR is completely commented out in makefile --- code/drasil-example/Drasil/GlassBR/Body.hs | 4 +-- code/drasil-example/Drasil/GlassBR/TMods.hs | 6 ++++- .../Language/Drasil/Printing/Import.hs | 27 +++++++++---------- code/drasil-lang/Language/Drasil/RefTypes.hs | 3 ++- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/code/drasil-example/Drasil/GlassBR/Body.hs b/code/drasil-example/Drasil/GlassBR/Body.hs index 71b36cc764..660a0e17d7 100644 --- a/code/drasil-example/Drasil/GlassBR/Body.hs +++ b/code/drasil-example/Drasil/GlassBR/Body.hs @@ -60,7 +60,7 @@ import Drasil.GlassBR.DataDefs (dataDefns, gbQDefns, hFromt, strDisFac, nonFL, import Drasil.GlassBR.ModuleDefs (allMods) import Drasil.GlassBR.References (rbrtsn2012) import Drasil.GlassBR.Symbols (this_symbols) -import Drasil.GlassBR.TMods (gbrTMods, t1IsSafe, t2IsSafe) +import Drasil.GlassBR.TMods (gbrTMods, t1IsSafe, t2IsSafe, tmodels) import Drasil.GlassBR.IMods (probOfBreak, calofCapacity, calofDemand, gbrIMods) @@ -169,7 +169,7 @@ glassSystInfo = SI { _quants = this_symbols, _concepts = [] :: [DefinedQuantityDict], _definitions = (map (relToQD gbSymbMap) gbrIMods) ++ - --FIXME: #891 (map (relToQD gbSymbMap) gbrTMods) ++ + --(map (relToQD gbSymbMap) tmodels{-gbrTMods-}) ++ --FIXME: #891 [wtntWithEqn, sdWithEqn], -- wtntWithEqn is defined in Unitals but only appears -- in the description of the Calculation of Demand instance model; -- should this be included as a Data Definition? diff --git a/code/drasil-example/Drasil/GlassBR/TMods.hs b/code/drasil-example/Drasil/GlassBR/TMods.hs index 168e729764..084a1fcbc8 100644 --- a/code/drasil-example/Drasil/GlassBR/TMods.hs +++ b/code/drasil-example/Drasil/GlassBR/TMods.hs @@ -1,4 +1,4 @@ -module Drasil.GlassBR.TMods (gbrTMods, t1IsSafe,t2IsSafe) where +module Drasil.GlassBR.TMods (gbrTMods, t1IsSafe,t2IsSafe, tmodels) where import Drasil.GlassBR.Unitals (demand, demandq, is_safe1, is_safe2, lRe, pb_tol, prob_br) @@ -12,6 +12,10 @@ import Data.Drasil.SentenceStructures (foldlSent, isThe, sAnd) {--} +--FIXME: should be removed with closure of #891 +tmodels :: [RelationConcept] +tmodels = [t1SafetyReq, t2SafetyReq] + gbrTMods :: [TheoryModel] gbrTMods = [t1IsSafe, t2IsSafe] diff --git a/code/drasil-lang/Language/Drasil/Printing/Import.hs b/code/drasil-lang/Language/Drasil/Printing/Import.hs index a473d0877f..20b284e640 100644 --- a/code/drasil-lang/Language/Drasil/Printing/Import.hs +++ b/code/drasil-lang/Language/Drasil/Printing/Import.hs @@ -260,8 +260,7 @@ makeDocument sm (Document title author sections) = -- | Translates from LayoutObj to the Printing representation of LayoutObj layout :: HasSymbolTable ctx => ctx -> Int -> SecCons -> T.LayoutObj layout sm currDepth (Sub s) = sec sm (currDepth+1) s ---layout sm _ (Con c) = lay sm c -layout sm _ (Con c) = error "Contents is still used" +layout sm _ (Con c) = lay sm c layout sm _ (LCon lc) = lay' sm lc (accessContents lc) -- | Helper function for creating sections as layout objects @@ -276,29 +275,29 @@ sec sm depth x@(Section title contents _) = --FIXME: should ShortName be used so (T.Header depth (spec sm title) ref : map (layout sm depth) contents) ref -{-- | Translates from Contents to the Printing Representation of LayoutObj. +-- | Translates from Contents to the Printing Representation of LayoutObj. -- Called internally by layout. lay :: HasSymbolTable ctx => ctx -> Contents -> T.LayoutObj lay sm x@(Table hdr lls t b _) = T.Table ["table"] - ((map (spec sm) hdr) : (map (map (spec sm)) lls)) (P.S (refAdd x)) b (spec sm t) -lay sm (Paragraph c) = T.Paragraph (spec sm c) -lay sm (EqnBlock c _) = T.HDiv ["equation"] [T.EqnBlock (P.E (expr c sm))] P.EmptyS + ((map (spec sm) hdr) : (map (map (spec sm)) lls)) (P.S "fixmelabel0") b (spec sm t) +lay sm (Paragraph c) = T.Paragraph (spec sm c) (P.S "fixmelabel1") +lay sm (EqnBlock c _) = T.HDiv ["equation"] [T.EqnBlock (P.E (expr c sm)) (P.S "fixmelabel2")] (P.S "fixmelabel3") -- FIXME: Make equations referable -lay sm x@(Definition c) = T.Definition c (makePairs sm c) (P.S (refAdd x)) -lay sm (Enumeration cs) = T.List $ makeL sm cs -lay sm x@(Figure c f wp _) = T.Figure (P.S (refAdd x)) (spec sm c) f wp +lay sm x@(Definition c) = T.Definition c (makePairs sm c) (P.S "fixmelabel4") +lay sm (Enumeration cs) = T.List (makeL sm cs) (P.S "fixmelabel5") +lay sm x@(Figure c f wp _) = T.Figure (P.S "fixmelabel6") (spec sm c) f wp lay sm x@(Requirement r) = T.ALUR T.Requirement - (spec sm $ requires r) (P.S $ refAdd x) (spec sm $ getShortName r) + (spec sm $ requires r) (P.S "fixmelabel7") (spec sm $ getShortName r) lay sm x@(Assumption a) = T.ALUR T.Assumption - (spec sm (assuming a)) (P.S (refAdd x)) (spec sm $ getShortName a) + (spec sm (assuming a)) (P.S "fixmelabel8") (spec sm $ getShortName a) lay sm x@(Change lc) = T.ALUR (if (chngType lc) == Likely then T.LikelyChange else T.UnlikelyChange) - (spec sm (chng lc)) (P.S (refAdd x)) (spec sm $ getShortName lc) + (spec sm (chng lc)) (P.S "fixmelabel9") (spec sm $ getShortName lc) lay sm x@(Graph ps w h t _) = T.Graph (map (\(y,z) -> (spec sm y, spec sm z)) ps) - w h (spec sm t) (P.S (refAdd x)) + w h (spec sm t) (P.S "fixmelabel10") lay sm (Defnt dtyp pairs rn) = T.Definition dtyp (layPairs pairs) (P.S rn) where layPairs = map (\(x,y) -> (x, map (lay sm) y)) -lay sm (Bib bib) = T.Bib map (layCite sm) bib-} +lay sm (Bib bib) = T.Bib (map (layCite sm) bib) (P.S "fixmelabel11") lay' :: HasSymbolTable ctx => ctx -> LabelledContent -> Contents -> T.LayoutObj lay' sm lc (Table hdr lls t b _) = T.Table ["table"] diff --git a/code/drasil-lang/Language/Drasil/RefTypes.hs b/code/drasil-lang/Language/Drasil/RefTypes.hs index 630377c39c..b986e282c2 100644 --- a/code/drasil-lang/Language/Drasil/RefTypes.hs +++ b/code/drasil-lang/Language/Drasil/RefTypes.hs @@ -35,4 +35,5 @@ instance Show RefType where show Goal = "Goal Statement" show PSD = "Physical System Description" show EqnB = "Equation" - show Lbl = "Label" \ No newline at end of file + show Lbl = "Label" + show Cntnts = "Content" \ No newline at end of file