Skip to content

Commit

Permalink
Apply Ref2 to Some Chunks (#1052)
Browse files Browse the repository at this point in the history
* Update RefProg language and renderer.

* Silence some warnings.

* Add rProg to Referable and have makeRef2 use that. Use snref for Ref2 in TeX printer.

* Use makeRef2 for ConceptInstance in GlassBR

* Turn all references of AssumpChunk to use makeRef2.

* Turn TM related references to use makeRef2.

* Make GenDef to use new ref2, but there is no GD for GlassBr.

* Turn DD related references to use new ref2.

* Turn IM related references to use new ref2.

* Make RefProg for LabelledContent.

* Implement RefProg for Citation.

* Apply new conceptDomain for Citation.
  • Loading branch information
Yuzhi Zhao authored and JacquesCarette committed Nov 23, 2018
1 parent 441b995 commit c3cf8e0
Show file tree
Hide file tree
Showing 16 changed files with 122 additions and 103 deletions.
2 changes: 1 addition & 1 deletion code/drasil-data/Data/Drasil/SentenceStructures.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/drasil-example/Drasil/GlassBR/Assumptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
12 changes: 6 additions & 6 deletions code/drasil-example/Drasil/GlassBR/Changes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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]
32 changes: 16 additions & 16 deletions code/drasil-example/Drasil/GlassBR/DataDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ 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.Labels (calOfDemandL)
import Drasil.GlassBR.References (astm2009, beasonEtAl1998)
import Drasil.GlassBR.Unitals (actualThicknesses, aspect_ratio,
demand, dimlessLoad, gTF, glassTypeAbbrsStr, glassTypeFactors, glass_type,
Expand Down Expand Up @@ -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--

Expand All @@ -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--

Expand Down Expand Up @@ -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--

Expand Down Expand Up @@ -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--

Expand Down Expand Up @@ -197,28 +197,28 @@ anGlass = (getAcc annealed +:+ S "is" +:+ phrase annealed +:+ S "glass")

arRef :: Sentence
arRef = (ch aspect_ratio +:+ S "is the" +:+ phrase aspect_ratio +:+.
S "defined in" +:+ makeRefS aspRat)
S "defined in" +:+ makeRef2S aspRat)

ftGlass :: Sentence
ftGlass = (getAcc fullyT +:+ S "is" +:+ phrase fullyT +:+ S "glass")

hRef :: Sentence
hRef = (ch min_thick +:+ S "is the" +:+ phrase min_thick `sC`
S "which is based on the nominal thicknesses as shown in" +:+. makeRefS hFromt)
S "which is based on the nominal thicknesses as shown in" +:+. makeRef2S hFromt)

hsGlass :: Sentence
hsGlass = (getAcc heatS +:+ S "is" +:+ phrase heatS +:+ S "glass")

ldfRef :: Sentence
ldfRef = (ch lDurFac +:+ S "is the" +:+ phrase lDurFac +:+ S "as defined by" +:+. makeRefS loadDF)
ldfRef = (ch lDurFac +:+ S "is the" +:+ phrase lDurFac +:+ S "as defined by" +:+. makeRef2S loadDF)

pbTolUsr :: Sentence
pbTolUsr = (ch pb_tol +:+ S "is the tolerable" +:+ phrase probability +:+ S "entered by the" +:+.
phrase user)

jRef :: Sentence
jRef = (ch stressDistFac +:+ S "is the" +:+ phrase stressDistFac `sC` S "as defined in" +:+.
makeRefS strDisFac)
makeRef2S strDisFac)

hMin :: Sentence
hMin = (ch nom_thick +:+ S "is a function that maps from the nominal thickness"
Expand All @@ -228,19 +228,19 @@ qHtTlExtra :: Sentence
qHtTlExtra = (ch tolLoad +:+ S "is the tolerable load which is obtained from Figure 7 using"
+:+ ch sdf_tol `sAnd` phrase aspect_ratio +:+ S "as" +:+ plural parameter +:+. S "using interpolation"
+:+ titleize' calculation `sOf` ch sdf_tol `sAnd` ch aspect_ratio +:+
S "are defined in" +:+. makeRefS tolStrDisFac `sAnd` makeRefS aspRat `sC` S "respectively")
S "are defined in" +:+. makeRef2S tolStrDisFac `sAnd` makeRef2S aspRat `sC` S "respectively")

qHtTlTolRef :: Sentence
qHtTlTolRef = (ch tolLoad +:+ S "is the tolerable load defined in" +:+. makeRefS tolPre)
qHtTlTolRef = (ch tolLoad +:+ S "is the tolerable load defined in" +:+. makeRef2S tolPre)

qRef :: Sentence
qRef = (ch demand +:+ S "is the 3 second equivalent pressure, as given in" +:+. makeRefS calOfDemandL)

gtfRef :: Sentence
gtfRef = (ch gTF +:+ S "is the" +:+. (phrase gTF `sC` S "as given by" +:+ makeRefS glaTyFac))
gtfRef = (ch gTF +:+ S "is the" +:+. (phrase gTF `sC` S "as given by" +:+ makeRef2S glaTyFac))

qHtRef :: Sentence
qHtRef = (ch dimlessLoad +:+ S "is the" +:+ phrase dimlessLoad +:+ S "defined in" +:+. makeRefS dimLL)
qHtRef = (ch dimlessLoad +:+ S "is the" +:+ phrase dimlessLoad +:+ S "defined in" +:+. makeRef2S dimLL)

jRef2 :: Sentence
jRef2 = (ch stressDistFac +:+ S "is the" +:+ phrase stressDistFac `sC`
Expand All @@ -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)
8 changes: 4 additions & 4 deletions code/drasil-example/Drasil/GlassBR/IMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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, makeRef2S risk]

{--}

Expand All @@ -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, makeRef2S glaTyFac, makeRef2S nonFL]

{--}

Expand All @@ -80,4 +80,4 @@ calofDemandDesc =
(ch eqTNTWeight), S "as" +:+. plural parameter,
(ch eqTNTWeight), S "is defined as" +:+.
E (wtntWithEqn^.equat), (ch standOffDist) `isThe`
(phrase standOffDist), S "as defined in", makeRefS standOffDis]
(phrase standOffDist), S "as defined in", makeRef2S standOffDis]
14 changes: 7 additions & 7 deletions code/drasil-example/Drasil/GlassBR/Requirements.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ sysSetValsFollowingAssumpsDesc = foldlSent_ [S "The", phrase system, S "shall se

sysSetValsFollowingAssumpsList :: [Sentence]
sysSetValsFollowingAssumpsList = [foldlList Comma List (map ch (take 4 assumptionConstants)) `followA` standardValues,
ch loadDF +:+ S "from" +:+ makeRefS loadDF,
ch loadDF +:+ S "from" +:+ makeRef2S loadDF,
short lShareFac `followA` glassLite,
ch hFromt +:+ S "from" +:+ makeRefS hFromt,
ch glaTyFac +:+ S "from" +:+ makeRefS glaTyFac,
ch standOffDis +:+ S "from" +:+ makeRefS standOffDis,
ch aspRat +:+ S "from" +:+ makeRefS aspRat]
ch hFromt +:+ S "from" +:+ makeRef2S hFromt,
ch glaTyFac +:+ S "from" +:+ makeRef2S glaTyFac,
ch standOffDis +:+ S "from" +:+ makeRef2S standOffDis,
ch aspRat +:+ S "from" +:+ makeRef2S aspRat]

--FIXME:should constants, LDF, and LSF have some sort of field that holds
-- the assumption(s) that're being followed? (Issue #349)
Expand All @@ -112,8 +112,8 @@ outputValsAndKnownQuantsDesc = foldlSent [titleize output_, S "the", plural inQt
S "from", makeRef2S sysSetValsFollowingAssumps]

checkGlassSafetyDesc cmd = foldlSent_ [S "If", (ch is_safePb), S "", (ch is_safeLR),
sParen (S "from" +:+ (makeRefS pbIsSafe)
`sAnd` (makeRefS lrIsSafe)), S "are true" `sC`
sParen (S "from" +:+ (makeRef2S pbIsSafe)
`sAnd` (makeRef2S lrIsSafe)), S "are true" `sC`
phrase cmd, S "the", phrase message, Quote (safeMessage ^. defn),
S "If the", phrase condition, S "is false, then", phrase cmd,
S "the", phrase message, Quote (notSafe ^. defn)]
Expand Down
10 changes: 5 additions & 5 deletions code/drasil-example/Drasil/GlassBR/TMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ lrIsSafe_RC = makeRC "safetyReqLR" (nounPhraseSP "Safety Req-LR")
lrIsSafeDesc :: Sentence
lrIsSafeDesc = tModDesc (is_safeLR) s ending
where
s = ((ch is_safePb) +:+ sParen (S "from" +:+ (makeRefS pbIsSafe)) `sAnd` (ch is_safeLR))
s = ((ch is_safePb) +:+ sParen (S "from" +:+ (makeRef2S pbIsSafe)) `sAnd` (ch is_safeLR))
ending = (short lResistance) `isThe` (phrase lResistance) +:+
sParen (S "also called capacity") `sC` S "as defined in" +:+.
(makeRefS calofCapacity) +:+ (ch demand) +:+ sParen (S "also referred as the" +:+
(makeRef2S calofCapacity) +:+ (ch demand) +:+ sParen (S "also referred as the" +:+
(titleize demandq)) `isThe` (demandq ^. defn) `sC` S "as defined in" +:+
makeRefS calofDemand
makeRef2S calofDemand

pbIsSafe :: TheoryModel
pbIsSafe = tm (cw pbIsSafe_RC)
Expand All @@ -63,9 +63,9 @@ pbIsSafeDesc :: Sentence
pbIsSafeDesc = tModDesc (is_safePb) s ending
where
s = (ch is_safePb) `sAnd` (ch is_safeLR) +:+ sParen (S "from" +:+
(makeRefS lrIsSafe))
(makeRef2S lrIsSafe))
ending = ((ch prob_br) `isThe` (phrase prob_br)) `sC` S "as calculated in" +:+.
(makeRefS probOfBreak) +:+ (ch pb_tol) `isThe` (phrase pb_tol) +:+ S "entered by the user"
(makeRef2S probOfBreak) +:+ (ch pb_tol) `isThe` (phrase pb_tol) +:+ S "entered by the user"

tModDesc :: QuantityDict -> Sentence -> Sentence -> Sentence
tModDesc main s ending = foldlSent [S "If", ch main `sC` S "the glass is" +:+.
Expand Down
5 changes: 3 additions & 2 deletions code/drasil-lang/Data/Drasil/IdeaDicts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Language.Drasil.Chunk.NamedIdea (IdeaDict, mkIdea)
import Language.Drasil.NounPhrase (cn')

compScience, softEng, mathematics, progLanguage, idglass, physics, civilEng
, materialEng, documentc :: IdeaDict
, materialEng, documentc, knowledgemng :: IdeaDict
-------------------------------------------------------------------------------
-- IdeaDict | | id | term | abbreviation
-------------------------------------------------------------------------------
Expand All @@ -16,4 +16,5 @@ idglass = mkIdea "glass" (cn' "Glass") Nothing
physics = mkIdea "physics" (cn' "Physics") Nothing
civilEng = mkIdea "civilEng" (cn' "Civil Engineering") Nothing
materialEng = mkIdea "materialEng" (cn' "Material Engineering") Nothing
documentc = mkIdea "documentc" (cn' "Document") (Just "Doc")
documentc = mkIdea "documentc" (cn' "Document") (Just "Doc")
knowledgemng = mkIdea "knowledgemng" (cn' "Knowledge Management") Nothing
4 changes: 2 additions & 2 deletions code/drasil-lang/Language/Drasil/Chunk/Citation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Language.Drasil.Chunk.Citation
, cProceedings, cTechReport, cUnpublished
) where

import Data.Drasil.IdeaDicts (softEng)
import Data.Drasil.IdeaDicts (knowledgemng)
import Language.Drasil.People (People)
import Language.Drasil.Sentence (Sentence)
import Language.Drasil.UID (UID)
Expand Down Expand Up @@ -52,7 +52,7 @@ instance CommonIdea Citation where abrv = abrv . view ci


citation :: CI
citation = commonIdeaWithDict "citation" (cn' "citation") "Citation" [softEng]
citation = commonIdeaWithDict "citation" (cn' "citation") "Citation" [knowledgemng]

-- | Smart constructor which implicitly uses EntryID as chunk i.
cite :: EntryID -> CitationKind -> [CiteField] -> Label -> Citation
Expand Down
3 changes: 2 additions & 1 deletion code/drasil-lang/Language/Drasil/Chunk/DataDefinition.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Language.Drasil.Derivation (Derivation)
import Language.Drasil.Classes (HasUID(uid), NamedIdea(term), Idea(getA),
HasSymbol(symbol), DefiningExpr(defnExpr), Quantity, HasSpace(typ),
HasDerivation(derivations), HasReference(getReferences), HasAdditionalNotes(getNotes),
HasShortName(shortname), HasLabel(getLabel), ConceptDomain(cdom))
HasShortName(shortname), HasLabel(getLabel), ConceptDomain(cdom), CommonIdea(abrv))
import Language.Drasil.Development.Unit(MayHaveUnit(getUnit))
import Language.Drasil.Expr (Expr)
import Language.Drasil.Label.Core (Label)
Expand Down Expand Up @@ -50,6 +50,7 @@ instance MayHaveUnit DataDefinition where getUnit = getUnit . view qd
instance HasLabel DataDefinition where getLabel = lbl
instance HasShortName DataDefinition where shortname = lbl . shortname
instance ConceptDomain DataDefinition where cdom = ci . cdom
instance CommonIdea DataDefinition where abrv = abrv . view ci

dataDefn :: CI
dataDefn = commonIdeaWithDict "dataDefn" (cn' "data definition") "DD" [softEng]
Expand Down
6 changes: 4 additions & 2 deletions code/drasil-lang/Language/Drasil/Chunk/GenDefn.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Language.Drasil.Chunk.GenDefn ( GenDefn, gd', gd'') where
import Language.Drasil.Classes (HasUID(uid), NamedIdea(term), Idea(getA),
Definition(defn), ConceptDomain(cdom), Concept, IsUnit,
ExprRelat(relat), HasDerivation(derivations), HasReference(getReferences),
HasLabel(getLabel), HasAdditionalNotes(getNotes), HasShortName(shortname))
HasLabel(getLabel), HasAdditionalNotes(getNotes), HasShortName(shortname),
CommonIdea(abrv))
import Data.Drasil.IdeaDicts (softEng)
import Language.Drasil.Chunk.Relation (RelationConcept)
import Language.Drasil.Derivation (Derivation)
Expand All @@ -24,7 +25,7 @@ data GenDefn = GD { _relC :: RelationConcept
, _refs :: [Reference]
, _lb :: Label
, _notes :: [Sentence]
, ci :: CI
, _ci :: CI
}
makeLenses ''GenDefn

Expand All @@ -41,6 +42,7 @@ instance HasLabel GenDefn where getLabel = lb
instance HasShortName GenDefn where shortname = lb . shortname
instance HasAdditionalNotes GenDefn where getNotes = notes
instance MayHaveUnit GenDefn where getUnit = gdUnit
instance CommonIdea GenDefn where abrv = abrv . view ci

gendef :: CI
gendef = commonIdeaWithDict "gendef" (cn' "General Definition") "GD" [softEng]
Expand Down
5 changes: 3 additions & 2 deletions code/drasil-lang/Language/Drasil/Chunk/InstanceModel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Language.Drasil.Chunk.Quantity (QuantityDict)
import Language.Drasil.Classes (HasUID(uid), NamedIdea(term), Idea(getA), Quantity,
Definition(defn),ConceptDomain(cdom), Concept, ExprRelat(relat),
HasDerivation(derivations), HasReference(getReferences), HasAdditionalNotes(getNotes),
HasLabel(getLabel), HasSymbol(symbol), HasSpace(typ), HasShortName(shortname))
HasLabel(getLabel), HasSymbol(symbol), HasSpace(typ), HasShortName(shortname),CommonIdea(abrv))
import Language.Drasil.Derivation (Derivation)
import Language.Drasil.Development.Unit (MayHaveUnit(getUnit))
import Language.Drasil.Expr (Relation)
Expand Down Expand Up @@ -45,7 +45,7 @@ data InstanceModel = IM { _rc :: RelationConcept
, _deri :: Derivation
, _lb :: Label
, _notes :: [Sentence]
, ci :: CI
, _ci :: CI
}
makeLenses ''InstanceModel

Expand All @@ -65,6 +65,7 @@ instance HasSymbol InstanceModel where symbol = symbol . view imOutput
instance HasSpace InstanceModel where typ = imOutput . typ
instance Quantity InstanceModel where
instance MayHaveUnit InstanceModel where getUnit = getUnit . view imOutput
instance CommonIdea InstanceModel where abrv = abrv . view ci

instanceMod :: CI
instanceMod = commonIdeaWithDict "instanceMod" (cn' "Instance Model") "IM" [softEng]
Expand Down
5 changes: 3 additions & 2 deletions code/drasil-lang/Language/Drasil/Chunk/Theory.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -50,7 +50,7 @@ data TheoryModel = TM
, _ref :: [Reference]
, _lb :: Label
, _notes :: [Sentence]
, ci :: CI
, _ci :: CI
}
makeLenses ''TheoryModel

Expand All @@ -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")
Expand Down
Loading

0 comments on commit c3cf8e0

Please sign in to comment.