-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
JacquesCarette
Owner
|
||
|
||
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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
This comment has been minimized.
Sorry, something went wrong.
samm82
Author
Collaborator
|
||
(prependAbrv thModel lbe) | ||
-} | ||
|
||
tmNoRefs :: (Concept c0, Quantity q, MayHaveUnit q, Concept c1) => c0 -> | ||
[q] -> [c1] -> [QDefinition] -> [Relation] -> [QDefinition] -> | ||
|
For IMs, the equation doesn't include the output (ie. a force IM would have
m * a
), while the equation for a TM does (ie. a force TM:F = m * a
). Is this OK to manually enforce this, or should there be a separatemkQuantDef
that implicitly adds the output to the equation? @JacquesCarette