diff --git a/code/drasil-example/Drasil/GlassBR/TMods.hs b/code/drasil-example/Drasil/GlassBR/TMods.hs index 4834af5118..6d3051d469 100644 --- a/code/drasil-example/Drasil/GlassBR/TMods.hs +++ b/code/drasil-example/Drasil/GlassBR/TMods.hs @@ -1,7 +1,7 @@ module Drasil.GlassBR.TMods (tMods, pbIsSafe, lrIsSafe) where import Language.Drasil -import Theory.Drasil (TheoryModel, mkQuantDef, tm) +import Theory.Drasil (TheoryModel, mkQuantDef, tmEqn) import Utils.Drasil import Control.Lens ((^.)) @@ -24,13 +24,10 @@ tMods = [pbIsSafe, lrIsSafe] lrIsSafe :: TheoryModel -lrIsSafe = tm (cw lrIsSafeQD) - [qw isSafeLoad, qw tmLRe, qw tmDemand] ([] :: [ConceptChunk]) - [lrIsSafeQD] [sy isSafeLoad $= sy tmLRe $> sy tmDemand] [] [makeCite astm2009] - "isSafeLoad" [lrIsSafeDesc] +lrIsSafe = tmEqn lrIsSafeQD [] [makeCite astm2009] "isSafeLoad" [lrIsSafeDesc] lrIsSafeQD :: QDefinition -lrIsSafeQD = mkQuantDef isSafeLoad (sy tmLRe $> sy tmDemand) +lrIsSafeQD = mkQuantDef isSafeLoad (sy isSafeLoad $= sy tmLRe $> sy tmDemand) lrIsSafeDesc :: Sentence lrIsSafeDesc = tModDesc isSafeLoad s ending @@ -41,13 +38,10 @@ lrIsSafeDesc = tModDesc isSafeLoad s ending titleize demandq) `isThe` (demandq ^. defn) pbIsSafe :: TheoryModel -pbIsSafe = tm (cw pbIsSafeQD) - [qw isSafeProb, qw probFail, qw pbTolfail] ([] :: [ConceptChunk]) - [pbIsSafeQD] [sy isSafeProb $= sy probFail $< sy pbTolfail] [] [makeCite astm2009] - "isSafeProb" [pbIsSafeDesc] +pbIsSafe = tmEqn pbIsSafeQD [] [makeCite astm2009] "isSafeProb" [pbIsSafeDesc] pbIsSafeQD :: QDefinition -pbIsSafeQD = mkQuantDef isSafeProb (sy probFail $< sy pbTolfail) +pbIsSafeQD = mkQuantDef isSafeProb (sy isSafeProb $= sy probFail $< sy pbTolfail) pbIsSafeDesc :: Sentence pbIsSafeDesc = tModDesc isSafeProb s ending diff --git a/code/drasil-theory/Theory/Drasil.hs b/code/drasil-theory/Theory/Drasil.hs index 8a766bc138..a677399c53 100644 --- a/code/drasil-theory/Theory/Drasil.hs +++ b/code/drasil-theory/Theory/Drasil.hs @@ -10,7 +10,7 @@ module Theory.Drasil ( , inCons, outCons, imOutput, imInputs , getEqMod -- Theory - , Theory(..), TheoryModel, tm, tmNoRefs + , Theory(..), TheoryModel, tm, tmEqn, tmNoRefs ) where import Theory.Drasil.DataDefinition (DataDefinition, mkQuantDef, diff --git a/code/drasil-theory/Theory/Drasil/Theory.hs b/code/drasil-theory/Theory/Drasil/Theory.hs index 28e41092d3..26a849d53f 100644 --- a/code/drasil-theory/Theory/Drasil/Theory.hs +++ b/code/drasil-theory/Theory/Drasil/Theory.hs @@ -1,5 +1,5 @@ {-# Language TemplateHaskell #-} -module Theory.Drasil.Theory (Theory(..), TheoryModel, tm, tmNoRefs) where +module Theory.Drasil.Theory (Theory(..), TheoryModel, tm, tmEqn, tmNoRefs) where import Language.Drasil import Data.Drasil.IdeaDicts (thModel) @@ -75,16 +75,11 @@ tm c _ _ _ _ _ [] _ = error $ "Source field of " ++ c ^. uid ++ " is emp tm c0 q c1 dq inv dfn r lbe = TM (cw c0) [] [] (map qw q) (map cw c1) dq inv dfn r (shortname' lbe) (prependAbrv thModel lbe) -{-} -tmEqn :: QDefinition -> - [q] -> [c1] -> [QDefinition] -> - [Relation] -> [QDefinition] -> [Reference] -> - String -> [Sentence] -> TheoryModel -tm c _ _ _ _ _ [] _ = error $ "Source field of " ++ c ^. uid ++ " is empty" -tm c0 q c1 dq inv dfn r lbe = - TM (cw c0) [] [] (map qw q) (map cw c1) dq inv dfn r (shortname' lbe) + +tmEqn :: QDefinition -> [QDefinition] -> [Reference] -> String -> [Sentence] -> TheoryModel +tmEqn c _ [] _ = error $ "Source field of " ++ c ^. uid ++ " is empty" +tmEqn q dfn r lbe = TM (cw q) [] [] [qw q] [] [q] [q ^. defnExpr] dfn r (shortname' lbe) (prependAbrv thModel lbe) - -} tmNoRefs :: (Concept c0, Quantity q, MayHaveUnit q, Concept c1) => c0 -> [q] -> [c1] -> [QDefinition] -> [Relation] -> [QDefinition] ->