diff --git a/code/drasil-data/Data/Drasil/SentenceStructures.hs b/code/drasil-data/Data/Drasil/SentenceStructures.hs index 54f0b7f50c..46d85c434c 100644 --- a/code/drasil-data/Data/Drasil/SentenceStructures.hs +++ b/code/drasil-data/Data/Drasil/SentenceStructures.hs @@ -186,7 +186,7 @@ tAndDOnly :: Concept s => s -> ItemType tAndDOnly chunk = Flat $ ((at_start chunk) +:+ S "- ") :+: (chunk ^. defn) followA :: Sentence -> AssumpChunk -> Sentence -preceding `followA` assumpt = preceding +:+ S "following" +:+ (Ref $ makeRef assumpt) +preceding `followA` assumpt = preceding +:+ S "following" +:+ (Ref2 $ makeRef2 assumpt) -- | Used when you want to say a term followed by its symbol. ex. "...using the Force F in..." getTandS :: (Quantity a, NamedIdea a) => a -> Sentence diff --git a/code/drasil-example/Drasil/GlassBR/Assumptions.hs b/code/drasil-example/Drasil/GlassBR/Assumptions.hs index 4f4d773fe3..1226e8108f 100644 --- a/code/drasil-example/Drasil/GlassBR/Assumptions.hs +++ b/code/drasil-example/Drasil/GlassBR/Assumptions.hs @@ -94,6 +94,6 @@ responseTypeDesc = foldlSent [S "The", phrase responseTy, S "considered in", ldfConstantDesc :: QDefinition -> Sentence ldfConstantDesc mainConcept = foldlSent [S "With", phrase reference, S "to", - makeRefS standardValues `sC` S "the", phrase value `sOf` + makeRef2S standardValues `sC` S "the", phrase value `sOf` phrase mainConcept, sParen (ch mainConcept), S "is a", phrase constant, S "in", short gLassBR] diff --git a/code/drasil-example/Drasil/GlassBR/Changes.hs b/code/drasil-example/Drasil/GlassBR/Changes.hs index 64916816ab..4ee2ad1d7a 100644 --- a/code/drasil-example/Drasil/GlassBR/Changes.hs +++ b/code/drasil-example/Drasil/GlassBR/Changes.hs @@ -39,26 +39,26 @@ considerMoreThanFlexGlass = cic "considerMoreThanFlexGlass" considerMoreThanFlex calcInternalBlastRiskDesc :: NamedChunk -> Sentence varValsOfmkEDesc, accMoreThanSingleLiteDesc, accMoreBoundaryConditionsDesc, considerMoreThanFlexGlassDesc :: Sentence -calcInternalBlastRiskDesc mainConcept = foldlSent [(makeRefS explainScenario) +:+ S "- The", +calcInternalBlastRiskDesc mainConcept = foldlSent [(makeRef2S explainScenario) +:+ S "- The", phrase system, S "currently only calculates for external" +:+. phrase mainConcept, S "In the future,", plural calculation, S "can be added for the internal", phrase mainConcept] -varValsOfmkEDesc = foldlSent [(makeRefS standardValues) `sC` ((makeRefS ldfConstant) +:+ +varValsOfmkEDesc = foldlSent [(makeRef2S standardValues) `sC` ((makeRef2S ldfConstant) +:+ S "- Currently, the"), plural value, S "for", foldlList Comma List (map ch (take 3 assumptionConstants)), S "are assumed to be the same for all" +:+. phrase glass, S "In the future, these", plural value, S "can be changed to", phrase variable, plural input_] -accMoreThanSingleLiteDesc = foldlSent [(makeRefS glassLite) +:+ S "- The", phrase software, +accMoreThanSingleLiteDesc = foldlSent [(makeRef2S glassLite) +:+ S "- The", phrase software, S "may be changed to accommodate more than a single", phrase lite] -accMoreBoundaryConditionsDesc = foldlSent [(makeRefS boundaryConditions) :+: S "- The", phrase software, +accMoreBoundaryConditionsDesc = foldlSent [(makeRef2S boundaryConditions) :+: S "- The", phrase software, S "may be changed to accommodate more boundary", plural condition, S "than 4-sided support"] -considerMoreThanFlexGlassDesc = foldlSent [(makeRefS responseType) +:+ S "- The", phrase software, +considerMoreThanFlexGlassDesc = foldlSent [(makeRef2S responseType) +:+ S "- The", phrase software, S "may be changed to consider more than just", phrase flexure, S "of the glass"] @@ -81,6 +81,6 @@ predictWithstandOfCertDegDesc = foldlSent [phrase goal `ofThe'` phrase system, S "is to predict whether the", phrase glaSlab, S "under consideration can", S "withstand an", phrase explosion, S "of a certain degree"] -accAlteredGlassDesc = foldlSent [makeRefS glassCondition, S "requires that the", phrase glass +:+. +accAlteredGlassDesc = foldlSent [makeRef2S glassCondition, S "requires that the", phrase glass +:+. S "is not altered in any way", S "Therefore, this cannot be used on altered", phrase glass] diff --git a/code/drasil-example/Drasil/GlassBR/DataDefs.hs b/code/drasil-example/Drasil/GlassBR/DataDefs.hs index 1d286a3951..817baf0403 100644 --- a/code/drasil-example/Drasil/GlassBR/DataDefs.hs +++ b/code/drasil-example/Drasil/GlassBR/DataDefs.hs @@ -11,7 +11,7 @@ import Data.Drasil.Concepts.PhysicalProperties (dimension) import Data.Drasil.Citations (campidelli) import Data.Drasil.SentenceStructures (sAnd, sOf) -import Drasil.GlassBR.Assumptions (standardValues, ldfConstant) +import Drasil.GlassBR.Assumptions (standardValues, ldfConstant, glassLite) import Drasil.GlassBR.Concepts (annealed, fullyT, heatS) import Drasil.GlassBR.Labels (calOfDemandL, glassLiteL) import Drasil.GlassBR.References (astm2009, beasonEtAl1998) @@ -77,8 +77,8 @@ loadDFQD :: QDefinition loadDFQD = mkQuantDef lDurFac loadDF_eq loadDF :: DataDefinition -loadDF = mkDD loadDFQD [makeRef astm2009] [{-derivation-}] "loadDurFactor" [makeRefS standardValues, - makeRefS ldfConstant] +loadDF = mkDD loadDFQD [makeRef astm2009] [{-derivation-}] "loadDurFactor" [makeRef2S standardValues, + makeRef2S ldfConstant] --DD4-- @@ -105,7 +105,7 @@ nonFLQD = mkQuantDef nonFactorL nonFL_eq nonFL :: DataDefinition nonFL = mkDD nonFLQD [makeRef astm2009] [{-derivation-}] "nFL" - (aGrtrThanB : hRef : qHtTlTolRef : [makeRefS standardValues]) + (aGrtrThanB : hRef : qHtTlTolRef : [makeRef2S standardValues]) --DD6-- @@ -133,7 +133,7 @@ dimLLQD = mkQuantDef dimlessLoad dimLL_eq dimLL :: DataDefinition dimLL = mkDD dimLLQD [makeRef astm2009, makeRef campidelli {- +:+ sParen (S "Eq. 7") -}] [{-derivation-}] "dimlessLoad" - (qRef : aGrtrThanB : hRef : gtfRef : glassLiteRef : [makeRefS standardValues]) + (qRef : aGrtrThanB : hRef : gtfRef : glassLiteRef : [makeRef2S standardValues]) --DD8-- @@ -161,7 +161,7 @@ tolStrDisFacQD = mkQuantDef sdf_tol tolStrDisFac_eq tolStrDisFac :: DataDefinition tolStrDisFac = mkDD tolStrDisFacQD [makeRef astm2009] [{-derivation-}] "sdf_tol" - (jtolRelToPbtol : aGrtrThanB : hRef : ldfRef : pbTolUsr : [makeRefS standardValues]) + (jtolRelToPbtol : aGrtrThanB : hRef : ldfRef : pbTolUsr : [makeRef2S standardValues]) --DD10-- @@ -251,4 +251,4 @@ jtolRelToPbtol :: Sentence jtolRelToPbtol = (ch sdf_tol +:+ S " is calculated with reference to " +:+. ch pb_tol) glassLiteRef :: Sentence -glassLiteRef = (ch dimlessLoad +:+ S "is calculated with reference to" +:+. makeRefS glassLiteL) +glassLiteRef = (ch dimlessLoad +:+ S "is calculated with reference to" +:+. makeRef2S glassLite) diff --git a/code/drasil-example/Drasil/GlassBR/IMods.hs b/code/drasil-example/Drasil/GlassBR/IMods.hs index 939af60303..49ebe4b227 100644 --- a/code/drasil-example/Drasil/GlassBR/IMods.hs +++ b/code/drasil-example/Drasil/GlassBR/IMods.hs @@ -29,8 +29,8 @@ glassBRsymb = map dqdWr [plate_len, plate_width, char_weight, standOffDist] ++ probOfBreak :: InstanceModel probOfBreak = im' probOfBreak_RC [qw risk] [sy risk $> 0] (qw prob_br) [sy prob_br $> 0] - (map makeRef [astm2009, beasonEtAl1998]) probOfBreakL [makeRefS standardValues, makeRefS boundaryConditions, - makeRefS responseType, makeRefS risk] + (map makeRef [astm2009, beasonEtAl1998]) probOfBreakL [makeRef2S standardValues, makeRef2S boundaryConditions, + makeRef2S responseType, makeRefS risk] {--} @@ -56,7 +56,7 @@ calofCapacity_RC = makeRC "calofCapacity_RC" (nounPhraseSP "Calculation of Capac calofCapacityDesc :: Sentence calofCapacityDesc = - foldlSent [makeRefS glassLite, makeRefS glaTyFac, makeRefS nonFL] + foldlSent [makeRef2S glassLite, makeRefS glaTyFac, makeRefS nonFL] {--} diff --git a/code/drasil-lang/Language/Drasil/Chunk/Theory.hs b/code/drasil-lang/Language/Drasil/Chunk/Theory.hs index 60117d5a42..30bd26c89a 100644 --- a/code/drasil-lang/Language/Drasil/Chunk/Theory.hs +++ b/code/drasil-lang/Language/Drasil/Chunk/Theory.hs @@ -6,7 +6,7 @@ import Language.Drasil.Chunk.Eq (QDefinition) import Language.Drasil.Chunk.Quantity (QuantityDict, qw) import Language.Drasil.Classes (HasUID(uid), NamedIdea(term), Idea(getA), Quantity, Definition(defn), ConceptDomain(cdom), Concept, HasReference(getReferences), - HasAdditionalNotes(getNotes), HasLabel(getLabel), HasShortName(shortname)) + HasAdditionalNotes(getNotes), HasLabel(getLabel), HasShortName(shortname), CommonIdea(abrv)) import Language.Drasil.Development.Unit (MayHaveUnit) import Language.Drasil.Expr (Relation) import Language.Drasil.Label.Core (Label) @@ -50,7 +50,7 @@ data TheoryModel = TM , _ref :: [Reference] , _lb :: Label , _notes :: [Sentence] - , ci :: CI + , _ci :: CI } makeLenses ''TheoryModel @@ -72,6 +72,7 @@ instance Theory TheoryModel where defined_fun = dfun instance HasLabel TheoryModel where getLabel = lb instance HasShortName TheoryModel where shortname = lb . shortname +instance CommonIdea TheoryModel where abrv = abrv . view ci softEng :: IdeaDict softEng = mkIdea "softEng" (cn' "Software Engineering") (Just "SE") diff --git a/code/drasil-lang/Language/Drasil/Reference.hs b/code/drasil-lang/Language/Drasil/Reference.hs index 22b22d0a0e..3f3f882f6e 100644 --- a/code/drasil-lang/Language/Drasil/Reference.hs +++ b/code/drasil-lang/Language/Drasil/Reference.hs @@ -133,7 +133,7 @@ instance Referable Citation where instance Referable TheoryModel where refAdd t = getAdd ((t ^. getLabel) ^. getRefAdd) rType _ = Def TM - rProg l = Name -- FIXME: Implement Ref2 for TheoryModel + rProg l = PrependDomain (l ^. uid) $ abrv l -- FIXME: Implement Ref2 for TheoryModel instance Referable GenDefn where refAdd g = getAdd ((g ^. getLabel) ^. getRefAdd) diff --git a/code/stable/glassbr/SRS/GlassBR_SRS.tex b/code/stable/glassbr/SRS/GlassBR_SRS.tex index e403af75ad..ff1aa6a6d9 100644 --- a/code/stable/glassbr/SRS/GlassBR_SRS.tex +++ b/code/stable/glassbr/SRS/GlassBR_SRS.tex @@ -365,7 +365,7 @@ \subsubsection{Assumptions} \item[\refstepcounter{assumpnum}\atheassumpnum\label{A:responseType}:]The response type considered in GlassBR is flexural. \end{description} \begin{description} -\item[\refstepcounter{assumpnum}\atheassumpnum\label{A:ldfConstant}:]With reference to A\ref{A:standardValues}, the value of load duration factor ($LDF$) is a constant in GlassBR. +\item[\refstepcounter{assumpnum}\atheassumpnum\label{A:ldfConstant}:]With reference to \hyperref[A:standardValues]{A: standardValues}, the value of load duration factor ($LDF$) is a constant in GlassBR. \end{description} \subsubsection{Theoretical Models} \label{Sec:TMs} @@ -532,8 +532,8 @@ \subsubsection{Data Definitions} \item{$m$ is the surface flaw parameter ($\frac{\text{m}^{12}}{\text{N}^{7}}$)} \end{symbDescription} \\ \midrule \\ -Notes & A\ref{A:standardValues} - A\ref{A:ldfConstant} +Notes & \hyperref[A:standardValues]{A: standardValues} + \hyperref[A:ldfConstant]{A: ldfConstant} \\ \midrule \\ Source & \cite{astm2009} \\ \midrule \\ @@ -602,7 +602,7 @@ \subsubsection{Data Definitions} Notes & $a$, $b$ are dimensions of the plate, where ($a\geq{}b$). $h$ is the minimum thickness, which is based on the nominal thicknesses as shown in \hyperref[DD:min.thick]{Definition~DD:min.thick}. ${\hat{q}_{tol}}$ is the tolerable load defined in \hyperref[DD:tolLoad]{Definition~DD:tolLoad}. - A\ref{A:standardValues} + \hyperref[A:standardValues]{A: standardValues} \\ \midrule \\ Source & \cite{astm2009} \\ \midrule \\ @@ -675,8 +675,8 @@ \subsubsection{Data Definitions} $a$, $b$ are dimensions of the plate, where ($a\geq{}b$). $h$ is the minimum thickness, which is based on the nominal thicknesses as shown in \hyperref[DD:min.thick]{Definition~DD:min.thick}. $GTF$ is the glass type factor, as given by \hyperref[DD:gTF]{Definition~DD:gTF}. - $\hat{q}$ is calculated with reference to A\ref{A:glassLite}. - A\ref{A:standardValues} + $\hat{q}$ is calculated with reference to \hyperref[A:glassLite]{A: glassLite}. + \hyperref[A:standardValues]{A: standardValues} \\ \midrule \\ Source & \cite{astm2009} and \cite{campidelli} \\ \midrule \\ @@ -749,7 +749,7 @@ \subsubsection{Data Definitions} $h$ is the minimum thickness, which is based on the nominal thicknesses as shown in \hyperref[DD:min.thick]{Definition~DD:min.thick}. $LDF$ is the load duration factor as defined by \hyperref[DD:loadDurFactor]{Definition~DD:loadDurFactor}. ${P_{btol}}$ is the tolerable probability entered by the user. - A\ref{A:standardValues} + \hyperref[A:standardValues]{A: standardValues} \\ \midrule \\ Source & \cite{astm2009} \\ \midrule \\ @@ -848,9 +848,9 @@ \subsubsection{Instance Models} \item{$B$ is the risk of failure (Unitless)} \end{symbDescription} \\ \midrule \\ -Notes & A\ref{A:standardValues} - A\ref{A:boundaryConditions} - A\ref{A:responseType} +Notes & \hyperref[A:standardValues]{A: standardValues} + \hyperref[A:boundaryConditions]{A: boundaryConditions} + \hyperref[A:responseType]{A: responseType} \hyperref[DD:risk.fun]{Definition~DD:risk.fun} \\ \midrule \\ Source & \cite{astm2009} and \cite{beasonEtAl1998} @@ -894,7 +894,7 @@ \subsubsection{Instance Models} \item{$LSF$ is the load share factor (Unitless)} \end{symbDescription} \\ \midrule \\ -Notes & A\ref{A:glassLite} \hyperref[DD:gTF]{Definition~DD:gTF} \hyperref[DD:nFL]{Definition~DD:nFL}. +Notes & \hyperref[A:glassLite]{A: glassLite} \hyperref[DD:gTF]{Definition~DD:gTF} \hyperref[DD:nFL]{Definition~DD:nFL}. \\ \midrule \\ Source & \cite{astm2009} \\ \midrule \\ @@ -989,9 +989,9 @@ \subsection{Functional Requirements} \item[Input-Glass-Props:\phantomsection\label{inputGlassProps}]Input the quantities from Table~\ref{Table:InputGlassPropsReqInputs}, which define the glass dimensions, type of glass, tolerable probability of failure, and the characteristics of the blast. Note: $a$ and $b$ will be input in terms of millimetres and will be converted to the equivalent value in metres. \item[System-Set-Values-Following-Assumptions:\phantomsection\label{sysSetValsFollowingAssumps}]The system shall set the known values as follows: \begin{itemize} - \item{$m$, $k$, $E$, and ${t_{d}}$ following A\ref{A:standardValues}} + \item{$m$, $k$, $E$, and ${t_{d}}$ following \hyperref[A:standardValues]{A: standardValues}} \item{$LDF$ from \hyperref[DD:loadDurFactor]{Definition~DD:loadDurFactor}} - \item{LSF following A\ref{A:glassLite}} + \item{LSF following \hyperref[A:glassLite]{A: glassLite}} \item{$h$ from \hyperref[DD:min.thick]{Definition~DD:min.thick}} \item{$GTF$ from \hyperref[DD:gTF]{Definition~DD:gTF}} \item{$SD$ from \hyperref[DD:standOffDist]{Definition~DD:standOffDist}} @@ -1051,17 +1051,17 @@ \subsection{Non-Functional Requirements} \section{Likely Changes} \label{Sec:LCs} \begin{itemize} -\item[Calculate-Internal-Blask-Risk:\phantomsection\label{calcInternalBlastRisk}]A\ref{A:explainScenario} - The system currently only calculates for external blast risk. In the future, calculations can be added for the internal blast risk. -\item[Variable-Values-of-m,k,E:\phantomsection\label{varValsOfmkE}]A\ref{A:standardValues}, A\ref{A:ldfConstant} - Currently, the values for $m$, $k$, and $E$ are assumed to be the same for all glass. In the future, these values can be changed to variable inputs. -\item[Accomodate-More-than-Single-Lite:\phantomsection\label{accMoreThanSingleLite}]A\ref{A:glassLite} - The software may be changed to accommodate more than a single lite. -\item[Accomodate-More-Boundary-Conditions:\phantomsection\label{accMoreBoundaryConditions}]A\ref{A:boundaryConditions}- The software may be changed to accommodate more boundary conditions than 4-sided support. -\item[Consider-More-than-Flexure-Glass:\phantomsection\label{considerMoreThanFlexGlass}]A\ref{A:responseType} - The software may be changed to consider more than just flexure of the glass. +\item[Calculate-Internal-Blask-Risk:\phantomsection\label{calcInternalBlastRisk}]\hyperref[A:explainScenario]{A: explainScenario} - The system currently only calculates for external blast risk. In the future, calculations can be added for the internal blast risk. +\item[Variable-Values-of-m,k,E:\phantomsection\label{varValsOfmkE}]\hyperref[A:standardValues]{A: standardValues}, \hyperref[A:ldfConstant]{A: ldfConstant} - Currently, the values for $m$, $k$, and $E$ are assumed to be the same for all glass. In the future, these values can be changed to variable inputs. +\item[Accomodate-More-than-Single-Lite:\phantomsection\label{accMoreThanSingleLite}]\hyperref[A:glassLite]{A: glassLite} - The software may be changed to accommodate more than a single lite. +\item[Accomodate-More-Boundary-Conditions:\phantomsection\label{accMoreBoundaryConditions}]\hyperref[A:boundaryConditions]{A: boundaryConditions}- The software may be changed to accommodate more boundary conditions than 4-sided support. +\item[Consider-More-than-Flexure-Glass:\phantomsection\label{considerMoreThanFlexGlass}]\hyperref[A:responseType]{A: responseType} - The software may be changed to consider more than just flexure of the glass. \end{itemize} \section{Unlikely Changes} \label{Sec:UCs} \begin{itemize} \item[Predict-Withstanding-of-Certain-Degree:\phantomsection\label{predictWithstandOfCertDeg}]The goal of the system is to predict whether the glass slab under consideration can withstand an explosion of a certain degree. -\item[Accommodate-Altered-Glass:\phantomsection\label{accAlteredGlass}]A\ref{A:glassCondition} requires that the glass is not altered in any way. Therefore, this cannot be used on altered glass. +\item[Accommodate-Altered-Glass:\phantomsection\label{accAlteredGlass}]\hyperref[A:glassCondition]{A: glassCondition} requires that the glass is not altered in any way. Therefore, this cannot be used on altered glass. \end{itemize} \section{Traceability Matrices and Graphs} \label{Sec:TraceMatrices}