{-# Language TupleSections #-}
module Drasil.DocumentLanguage where
import Drasil.DocDecl (SRSDecl, mkDocDesc)
import Drasil.DocumentLanguage.Core (AppndxSec(..), AuxConstntSec(..),
DerivationDisplay(..), DocDesc, DocSection(..), OffShelfSolnsSec(..), GSDSec(..),
GSDSub(..), IntroSec(..), IntroSub(..), LCsSec(..), LFunc(..),
PDSub(..), ProblemDescription(..), RefSec(..), RefTab(..), ReqrmntSec(..),
ReqsSub(..), SCSSub(..), StkhldrSec(..), StkhldrSub(..), SolChSpec(..),
SSDSec(..), SSDSub(..), TraceabilitySec(..), TraceConfig(..),
TSIntro(..), UCsSec(..), getTraceConfigUID)
import Drasil.DocumentLanguage.Definitions (ddefn, derivation, instanceModel,
gdefn, tmodel)
import Drasil.ExtractDocDesc (getDocDesc, egetDocDesc)
import Drasil.TraceTable (generateTraceMap)
import Language.Drasil hiding (kind)
import Language.Drasil.Display (compsy)
import Database.Drasil hiding (cdb)
import SysInfo.Drasil
import Drasil.Sections.TableOfAbbAndAcronyms (tableAbbAccGen)
import Drasil.Sections.TableOfContents (toToC, findToC)
import Drasil.Sections.TableOfSymbols (table, tsIntro)
import Drasil.Sections.TableOfUnits (tOfUnitSIName, tuIntro, defaultTUI)
import qualified Drasil.DocLang.SRS as SRS (appendix,
genSysDes, likeChg, unlikeChg, reference, solCharSpec,
stakeholder, tOfCont, tOfSymb, tOfUnit, userChar, offShelfSol, refMat,
tOfAbbAcc)
import Drasil.DocLang.References (secRefs)
import qualified Drasil.Sections.AuxiliaryConstants as AC (valsOfAuxConstantsF)
import qualified Drasil.Sections.GeneralSystDesc as GSD (genSysIntro,
systCon, usrCharsF, sysContxt)
import qualified Drasil.Sections.Introduction as Intro (charIntRdrF,
introductionSection, orgSec, purposeOfDoc, scopeOfRequirements)
import qualified Drasil.Sections.Requirements as R (reqF, fReqF, nfReqF)
import qualified Drasil.Sections.SpecificSystemDescription as SSD (assumpF,
datConF, dataDefnF, genDefnF, goalStmtF, inModelF, physSystDesc, probDescF,
propCorSolF, solutionCharSpecIntro, specSysDescr, termDefnF, thModF, helperCI,
tmStub, ddStub, gdStub, imStub, pdStub)
import qualified Drasil.Sections.Stakeholders as Stk (stakeholderIntro,
tClientF, tCustomerF)
import qualified Drasil.DocumentLanguage.TraceabilityMatrix as TM (
generateTraceTableView, traceMHeader, layoutUIDs)
import qualified Drasil.DocumentLanguage.TraceabilityGraph as TG (traceMGF)
import Drasil.DocumentLanguage.TraceabilityGraph (traceyGraphGetRefs)
import Drasil.Sections.TraceabilityMandGs (traceMatStandard)
import qualified Data.Drasil.Concepts.Documentation as Doc (likelyChg, section_,
software, unlikelyChg)
import Control.Lens ((^.), set)
import Data.Function (on)
import Data.List (nub, sortBy, sortOn)
import qualified Data.Map as Map (elems, toList, assocs, keys)
import Data.Maybe (maybeToList)
import Drasil.Sections.ReferenceMaterial (emptySectSentPlu)
mkDoc :: SRSDecl -> (IdeaDict -> IdeaDict -> Sentence) -> SystemInformation -> Document
mkDoc :: SRSDecl
-> (IdeaDict -> IdeaDict -> Sentence)
-> SystemInformation
-> Document
mkDoc SRSDecl
dd IdeaDict -> IdeaDict -> Sentence
comb si :: SystemInformation
si@SI {_sys :: ()
_sys = a
sys, _kind :: ()
_kind = b
kind, _authors :: ()
_authors = [c]
authors} =
Sentence
-> Sentence -> ShowTableOfContents -> [Section] -> Document
Document (forall c. Idea c => c -> IdeaDict
nw b
kind IdeaDict -> IdeaDict -> Sentence
`comb` forall c. Idea c => c -> IdeaDict
nw a
sys) (SepType -> FoldType -> [Sentence] -> Sentence
foldlList SepType
Comma FoldType
List forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (String -> Sentence
S forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall n. HasName n => n -> String
name) [c]
authors) ([DocSection] -> ShowTableOfContents
findToC [DocSection]
l) forall a b. (a -> b) -> a -> b
$
SystemInformation -> [DocSection] -> [Section]
mkSections SystemInformation
fullSI [DocSection]
l where
fullSI :: SystemInformation
fullSI = SRSDecl -> SystemInformation -> SystemInformation
fillcdbSRS SRSDecl
dd SystemInformation
si
l :: [DocSection]
l = SystemInformation -> SRSDecl -> [DocSection]
mkDocDesc SystemInformation
fullSI SRSDecl
dd
fillcdbSRS :: SRSDecl -> SystemInformation -> SystemInformation
fillcdbSRS :: SRSDecl -> SystemInformation -> SystemInformation
fillcdbSRS SRSDecl
srsDec SystemInformation
si = SRSDecl -> SystemInformation -> SystemInformation
fillSecAndLC SRSDecl
srsDec forall a b. (a -> b) -> a -> b
$ SRSDecl -> SystemInformation -> SystemInformation
fillReferences SRSDecl
srsDec forall a b. (a -> b) -> a -> b
$ SRSDecl -> SystemInformation -> SystemInformation
fillTraceSI SRSDecl
srsDec SystemInformation
si
fillSecAndLC :: SRSDecl -> SystemInformation -> SystemInformation
fillSecAndLC :: SRSDecl -> SystemInformation -> SystemInformation
fillSecAndLC SRSDecl
dd SystemInformation
si = SystemInformation
si2
where
chkdb :: ChunkDB
chkdb = SystemInformation
si forall s a. s -> Getting a s a -> a
^. Lens' SystemInformation ChunkDB
sysinfodb
allSections :: [Section]
allSections = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Section -> [Section]
findAllSec forall a b. (a -> b) -> a -> b
$ SystemInformation -> [DocSection] -> [Section]
mkSections SystemInformation
si forall a b. (a -> b) -> a -> b
$ SystemInformation -> SRSDecl -> [DocSection]
mkDocDesc SystemInformation
si SRSDecl
dd
allLC :: [LabelledContent]
allLC = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Section -> [LabelledContent]
findAllLC [Section]
allSections
existingSections :: [Section]
existingSections = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (Section, Int))
sectionTable
existingLC :: [LabelledContent]
existingLC = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (LabelledContent, Int))
labelledcontentTable
chkdb2 :: ChunkDB
chkdb2 = forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' ChunkDB (Map UID (LabelledContent, Int))
labelledcontentTable (forall a. HasUID a => [a] -> Map UID (a, Int)
idMap forall a b. (a -> b) -> a -> b
$ forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ [LabelledContent]
existingLC forall a. [a] -> [a] -> [a]
++ [LabelledContent]
allLC)
forall a b. (a -> b) -> a -> b
$ forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' ChunkDB (Map UID (Section, Int))
sectionTable (forall a. HasUID a => [a] -> Map UID (a, Int)
idMap forall a b. (a -> b) -> a -> b
$ forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ [Section]
existingSections forall a. [a] -> [a] -> [a]
++ [Section]
allSections) ChunkDB
chkdb
si2 :: SystemInformation
si2 = forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' SystemInformation ChunkDB
sysinfodb ChunkDB
chkdb2 SystemInformation
si
findAllSec :: Section -> [Section]
findAllSec :: Section -> [Section]
findAllSec s :: Section
s@(Section Sentence
_ [SecCons]
cs Reference
_) = Section
s forall a. a -> [a] -> [a]
: forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap SecCons -> [Section]
findAllSubSec [SecCons]
cs
findAllSubSec :: SecCons -> [Section]
findAllSubSec :: SecCons -> [Section]
findAllSubSec (Sub Section
s) = Section -> [Section]
findAllSec Section
s
findAllSubSec SecCons
_ = []
findAllLC :: Section -> [LabelledContent]
findAllLC :: Section -> [LabelledContent]
findAllLC (Section Sentence
_ [SecCons]
cs Reference
_) = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap SecCons -> [LabelledContent]
findLCSecCons [SecCons]
cs
findLCSecCons :: SecCons -> [LabelledContent]
findLCSecCons :: SecCons -> [LabelledContent]
findLCSecCons (Sub Section
s) = Section -> [LabelledContent]
findAllLC Section
s
findLCSecCons (Con (LlC LabelledContent
lblcons)) = [LabelledContent
lblcons]
findLCSecCons SecCons
_ = []
fillReferences :: SRSDecl -> SystemInformation -> SystemInformation
fillReferences :: SRSDecl -> SystemInformation -> SystemInformation
fillReferences SRSDecl
dd si :: SystemInformation
si@SI{_sys :: ()
_sys = a
sys} = SystemInformation
si2
where
chkdb :: ChunkDB
chkdb = SystemInformation
si forall s a. s -> Getting a s a -> a
^. Lens' SystemInformation ChunkDB
sysinfodb
rfdb :: ReferenceDB
rfdb = SystemInformation -> ReferenceDB
refdb SystemInformation
si
allSections :: [Section]
allSections = SystemInformation -> [DocSection] -> [Section]
mkSections SystemInformation
si forall a b. (a -> b) -> a -> b
$ SystemInformation -> SRSDecl -> [DocSection]
mkDocDesc SystemInformation
si SRSDecl
dd
refsFromSRS :: [Reference]
refsFromSRS = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap Section -> [Reference]
findAllRefs [Section]
allSections
inRefs :: [Reference]
inRefs = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall a. HasDecRef a => a -> [Reference]
dRefToRef [DataDefinition]
ddefs forall a. [a] -> [a] -> [a]
++ forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall a. HasDecRef a => a -> [Reference]
dRefToRef [GenDefn]
gdefs forall a. [a] -> [a] -> [a]
++
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall a. HasDecRef a => a -> [Reference]
dRefToRef [InstanceModel]
imods forall a. [a] -> [a] -> [a]
++ forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap forall a. HasDecRef a => a -> [Reference]
dRefToRef [TheoryModel]
tmods
ddefs :: [DataDefinition]
ddefs = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (DataDefinition, Int))
dataDefnTable
gdefs :: [GenDefn]
gdefs = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (GenDefn, Int))
gendefTable
imods :: [InstanceModel]
imods = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (InstanceModel, Int))
insmodelTable
tmods :: [TheoryModel]
tmods = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (TheoryModel, Int))
theoryModelTable
concIns :: [ConceptInstance]
concIns = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (ConceptInstance, Int))
conceptinsTable
secs :: [Section]
secs = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (Section, Int))
sectionTable
lblCon :: [LabelledContent]
lblCon = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (LabelledContent, Int))
labelledcontentTable
cites :: BibRef
cites = SystemInformation -> BibRef
citeDB SystemInformation
si
conins :: [ConceptInstance]
conins = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ReferenceDB
rfdb forall s a. s -> Getting a s a -> a
^. Lens' ReferenceDB (Map UID (ConceptInstance, Int))
conceptDB
refs :: [Reference]
refs = forall a b. (a -> b) -> [a] -> [b]
map (forall a b. (a, b) -> a
fstforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall a b. (a, b) -> b
snd) forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.assocs forall a b. (a -> b) -> a -> b
$ ChunkDB
chkdb forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (Reference, Int))
refTable
chkdb2 :: ChunkDB
chkdb2 = forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' ChunkDB (Map UID (Reference, Int))
refTable (forall a. HasUID a => [a] -> Map UID (a, Int)
idMap forall a b. (a -> b) -> a -> b
$ forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ [Reference]
refsFromSRS forall a. [a] -> [a] -> [a]
++ [Reference]
inRefs
forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map (forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
refforall b c a. (b -> c) -> (a -> b) -> a -> c
.UID -> Reference
makeTabRef'forall b c a. (b -> c) -> (a -> b) -> a -> c
.TraceConfig -> UID
getTraceConfigUID) (SystemInformation -> [TraceConfig]
traceMatStandard SystemInformation
si) forall a. [a] -> [a] -> [a]
++ [Reference]
secRefs
forall a. [a] -> [a] -> [a]
++ String -> [Reference]
traceyGraphGetRefs (forall c. CommonIdea c => c -> String
programName a
sys) forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref BibRef
cites
forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [ConceptInstance]
conins forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [DataDefinition]
ddefs forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [GenDefn]
gdefs forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [InstanceModel]
imods
forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [TheoryModel]
tmods forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [ConceptInstance]
concIns forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [Section]
secs forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref [LabelledContent]
lblCon
forall a. [a] -> [a] -> [a]
++ [Reference]
refs) ChunkDB
chkdb
si2 :: SystemInformation
si2 = forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' SystemInformation ChunkDB
sysinfodb ChunkDB
chkdb2 SystemInformation
si
dRefToRef :: HasDecRef a => a -> [Reference]
dRefToRef :: forall a. HasDecRef a => a -> [Reference]
dRefToRef a
r = forall a b. (a -> b) -> [a] -> [b]
map forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Reference
ref forall a b. (a -> b) -> a -> b
$ a
r forall s a. s -> Getting a s a -> a
^. forall c. HasDecRef c => Lens' c [DecRef]
getDecRefs
findAllRefs :: Section -> [Reference]
findAllRefs :: Section -> [Reference]
findAllRefs (Section Sentence
_ [SecCons]
cs Reference
r) = Reference
rforall a. a -> [a] -> [a]
: forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap SecCons -> [Reference]
findRefSecCons [SecCons]
cs
where
findRefSecCons :: SecCons -> [Reference]
findRefSecCons :: SecCons -> [Reference]
findRefSecCons (Sub Section
s) = Section -> [Reference]
findAllRefs Section
s
findRefSecCons (Con (LlC (LblC Reference
rf RawContent
_))) = [Reference
rf]
findRefSecCons SecCons
_ = []
fillTraceSI :: SRSDecl -> SystemInformation -> SystemInformation
fillTraceSI :: SRSDecl -> SystemInformation -> SystemInformation
fillTraceSI SRSDecl
dd SystemInformation
si = [DocSection] -> SystemInformation -> SystemInformation
fillTraceMaps [DocSection]
l forall a b. (a -> b) -> a -> b
$ [DocSection] -> SystemInformation -> SystemInformation
fillReqs [DocSection]
l SystemInformation
si
where
l :: [DocSection]
l = SystemInformation -> SRSDecl -> [DocSection]
mkDocDesc SystemInformation
si SRSDecl
dd
fillTraceMaps :: DocDesc -> SystemInformation -> SystemInformation
fillTraceMaps :: [DocSection] -> SystemInformation -> SystemInformation
fillTraceMaps [DocSection]
dd si :: SystemInformation
si@SI{_sysinfodb :: SystemInformation -> ChunkDB
_sysinfodb = ChunkDB
db} = SystemInformation
si {_sysinfodb :: ChunkDB
_sysinfodb =
forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' ChunkDB (Map UID [UID])
refbyTable (Map UID [UID] -> Map UID [UID]
generateRefbyMap Map UID [UID]
tdb) forall a b. (a -> b) -> a -> b
$ forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' ChunkDB (Map UID [UID])
traceTable Map UID [UID]
tdb ChunkDB
db} where
tdb :: Map UID [UID]
tdb = [DocSection] -> Map UID [UID]
generateTraceMap [DocSection]
dd
fillReqs :: DocDesc -> SystemInformation -> SystemInformation
fillReqs :: [DocSection] -> SystemInformation -> SystemInformation
fillReqs [] SystemInformation
si = SystemInformation
si
fillReqs (ReqrmntSec (ReqsProg [ReqsSub]
x):[DocSection]
_) si :: SystemInformation
si@SI{_sysinfodb :: SystemInformation -> ChunkDB
_sysinfodb = ChunkDB
db} = [ReqsSub] -> SystemInformation
genReqs [ReqsSub]
x
where
genReqs :: [ReqsSub] -> SystemInformation
genReqs [] = SystemInformation
si
genReqs (FReqsSub [ConceptInstance]
c [LabelledContent]
_:[ReqsSub]
_) = SystemInformation
si {_sysinfodb :: ChunkDB
_sysinfodb = forall s t a b. ASetter s t a b -> b -> s -> t
set Lens' ChunkDB (Map UID (ConceptInstance, Int))
conceptinsTable Map UID (ConceptInstance, Int)
newCI ChunkDB
db} where
newCI :: Map UID (ConceptInstance, Int)
newCI = forall a. HasUID a => [a] -> Map UID (a, Int)
idMap forall a b. (a -> b) -> a -> b
$ forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ [ConceptInstance]
c forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst (forall b a. Ord b => (a -> b) -> [a] -> [a]
sortOn forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> b
snd forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [(k, a)]
Map.toList forall a b. (a -> b) -> a -> b
$ ChunkDB
db forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID (ConceptInstance, Int))
conceptinsTable)
genReqs (ReqsSub
_:[ReqsSub]
xs) = [ReqsSub] -> SystemInformation
genReqs [ReqsSub]
xs
fillReqs (DocSection
_:[DocSection]
xs) SystemInformation
si = [DocSection] -> SystemInformation -> SystemInformation
fillReqs [DocSection]
xs SystemInformation
si
extractUnits :: DocDesc -> ChunkDB -> [UnitDefn]
[DocSection]
dd ChunkDB
cdb = forall c. Quantity c => ChunkDB -> [c] -> [UnitDefn]
collectUnits ChunkDB
cdb forall a b. (a -> b) -> a -> b
$ [Sentence] -> [ModelExpr] -> ChunkDB -> [QuantityDict]
ccss' ([DocSection] -> [Sentence]
getDocDesc [DocSection]
dd) ([DocSection] -> [ModelExpr]
egetDocDesc [DocSection]
dd) ChunkDB
cdb
mkSections :: SystemInformation -> DocDesc -> [Section]
mkSections :: SystemInformation -> [DocSection] -> [Section]
mkSections SystemInformation
si [DocSection]
dd = forall a b. (a -> b) -> [a] -> [b]
map DocSection -> Section
doit [DocSection]
dd
where
doit :: DocSection -> Section
doit :: DocSection -> Section
doit DocSection
TableOfContents = [DocSection] -> Section
mkToC [DocSection]
dd
doit (RefSec RefSec
rs) = SystemInformation -> [DocSection] -> RefSec -> Section
mkRefSec SystemInformation
si [DocSection]
dd RefSec
rs
doit (IntroSec IntroSec
is) = SystemInformation -> IntroSec -> Section
mkIntroSec SystemInformation
si IntroSec
is
doit (StkhldrSec StkhldrSec
sts) = StkhldrSec -> Section
mkStkhldrSec StkhldrSec
sts
doit (SSDSec SSDSec
ss) = SystemInformation -> SSDSec -> Section
mkSSDSec SystemInformation
si SSDSec
ss
doit (AuxConstntSec AuxConstntSec
acs) = AuxConstntSec -> Section
mkAuxConsSec AuxConstntSec
acs
doit DocSection
Bibliography = BibRef -> Section
mkBib (SystemInformation -> BibRef
citeDB SystemInformation
si)
doit (GSDSec GSDSec
gs') = GSDSec -> Section
mkGSDSec GSDSec
gs'
doit (ReqrmntSec ReqrmntSec
r) = ReqrmntSec -> Section
mkReqrmntSec ReqrmntSec
r
doit (LCsSec LCsSec
lc) = LCsSec -> Section
mkLCsSec LCsSec
lc
doit (UCsSec UCsSec
ulcs) = UCsSec -> Section
mkUCsSec UCsSec
ulcs
doit (TraceabilitySec TraceabilitySec
t) = TraceabilitySec -> SystemInformation -> Section
mkTraceabilitySec TraceabilitySec
t SystemInformation
si
doit (AppndxSec AppndxSec
a) = AppndxSec -> Section
mkAppndxSec AppndxSec
a
doit (OffShelfSolnsSec OffShelfSolnsSec
o) = OffShelfSolnsSec -> Section
mkOffShelfSolnSec OffShelfSolnsSec
o
mkToC :: DocDesc -> Section
mkToC :: [DocSection] -> Section
mkToC [DocSection]
dd = [Contents] -> [Section] -> Section
SRS.tOfCont [Contents
intro, UnlabelledContent -> Contents
UlC forall a b. (a -> b) -> a -> b
$ RawContent -> UnlabelledContent
ulcc forall a b. (a -> b) -> a -> b
$ ListType -> RawContent
Enumeration forall a b. (a -> b) -> a -> b
$ [(ItemType, Maybe String)] -> ListType
Bullet forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map ((, forall a. Maybe a
Nothing) forall b c a. (b -> c) -> (a -> b) -> a -> c
. DocSection -> ItemType
toToC) [DocSection]
dd] []
where
intro :: Contents
intro = Sentence -> Contents
mkParagraph forall a b. (a -> b) -> a -> b
$ String -> Sentence
S String
"An outline of all sections included in this SRS is recorded here for easy reference."
mkRefSec :: SystemInformation -> DocDesc -> RefSec -> Section
mkRefSec :: SystemInformation -> [DocSection] -> RefSec -> Section
mkRefSec SystemInformation
si [DocSection]
dd (RefProg Contents
c [RefTab]
l) = [Contents] -> [Section] -> Section
SRS.refMat [Contents
c] (forall a b. (a -> b) -> [a] -> [b]
map (SystemInformation -> RefTab -> Section
mkSubRef SystemInformation
si) [RefTab]
l)
where
mkSubRef :: SystemInformation -> RefTab -> Section
mkSubRef :: SystemInformation -> RefTab -> Section
mkSubRef SystemInformation
si' RefTab
TUnits = SystemInformation -> RefTab -> Section
mkSubRef SystemInformation
si' forall a b. (a -> b) -> a -> b
$ [TUIntro] -> ([UnitDefn] -> LabelledContent) -> RefTab
TUnits' [TUIntro]
defaultTUI forall s. IsUnit s => [s] -> LabelledContent
tOfUnitSIName
mkSubRef SI {_sysinfodb :: SystemInformation -> ChunkDB
_sysinfodb = ChunkDB
db} (TUnits' [TUIntro]
con [UnitDefn] -> LabelledContent
f) =
[Contents] -> [Section] -> Section
SRS.tOfUnit [[TUIntro] -> Contents
tuIntro [TUIntro]
con, LabelledContent -> Contents
LlC forall a b. (a -> b) -> a -> b
$ [UnitDefn] -> LabelledContent
f (forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ forall a. (a -> a -> Ordering) -> [a] -> [a]
sortBy UnitDefn -> UnitDefn -> Ordering
compUnitDefn forall a b. (a -> b) -> a -> b
$ [DocSection] -> ChunkDB -> [UnitDefn]
extractUnits [DocSection]
dd ChunkDB
db)] []
mkSubRef SI {_quants :: ()
_quants = [e]
v, _sysinfodb :: SystemInformation -> ChunkDB
_sysinfodb = ChunkDB
cdb} (TSymb [TSIntro]
con) =
[Contents] -> [Section] -> Section
SRS.tOfSymb
[[TSIntro] -> Contents
tsIntro [TSIntro]
con,
LabelledContent -> Contents
LlC forall a b. (a -> b) -> a -> b
$ forall s.
(Quantity s, MayHaveUnit s) =>
Stage -> [s] -> (s -> Sentence) -> LabelledContent
table Stage
Equational (forall a. HasSymbol a => [a] -> [a]
sortBySymbol
forall a b. (a -> b) -> a -> b
$ forall a. (a -> Bool) -> [a] -> [a]
filter (forall q. HasSymbol q => q -> Stage -> Bool
`hasStageSymbol` Stage
Equational)
(forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [e]
v forall a. [a] -> [a] -> [a]
++ [Sentence] -> [ModelExpr] -> ChunkDB -> [QuantityDict]
ccss' ([DocSection] -> [Sentence]
getDocDesc [DocSection]
dd) ([DocSection] -> [ModelExpr]
egetDocDesc [DocSection]
dd) ChunkDB
cdb))
forall n. NamedIdea n => n -> Sentence
atStart] []
mkSubRef SI {_sysinfodb :: SystemInformation -> ChunkDB
_sysinfodb = ChunkDB
cdb} (TSymb' LFunc
f [TSIntro]
con) =
forall e.
(Quantity e, Concept e, Eq e, MayHaveUnit e) =>
[e] -> LFunc -> [TSIntro] -> Section
mkTSymb ([Sentence] -> [ModelExpr] -> ChunkDB -> [DefinedQuantityDict]
ccss ([DocSection] -> [Sentence]
getDocDesc [DocSection]
dd) ([DocSection] -> [ModelExpr]
egetDocDesc [DocSection]
dd) ChunkDB
cdb) LFunc
f [TSIntro]
con
mkSubRef SI {_usedinfodb :: SystemInformation -> ChunkDB
_usedinfodb = ChunkDB
db} RefTab
TAandA =
[Contents] -> [Section] -> Section
SRS.tOfAbbAcc [LabelledContent -> Contents
LlC forall a b. (a -> b) -> a -> b
$ forall s. Idea s => [s] -> LabelledContent
tableAbbAccGen forall a b. (a -> b) -> a -> b
$ forall a. Eq a => [a] -> [a]
nub forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst forall a b. (a -> b) -> a -> b
$ forall k a. Map k a -> [a]
Map.elems forall a b. (a -> b) -> a -> b
$ ChunkDB -> TermMap
termTable ChunkDB
db] []
mkTSymb :: (Quantity e, Concept e, Eq e, MayHaveUnit e) =>
[e] -> LFunc -> [TSIntro] -> Section
mkTSymb :: forall e.
(Quantity e, Concept e, Eq e, MayHaveUnit e) =>
[e] -> LFunc -> [TSIntro] -> Section
mkTSymb [e]
v LFunc
f [TSIntro]
c = [Contents] -> [Section] -> Section
SRS.tOfSymb [[TSIntro] -> Contents
tsIntro [TSIntro]
c,
LabelledContent -> Contents
LlC forall a b. (a -> b) -> a -> b
$ forall s.
(Quantity s, MayHaveUnit s) =>
Stage -> [s] -> (s -> Sentence) -> LabelledContent
table Stage
Equational
(forall a. (a -> a -> Ordering) -> [a] -> [a]
sortBy (Symbol -> Symbol -> Ordering
compsy forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` forall q. HasSymbol q => q -> Symbol
eqSymb) forall a b. (a -> b) -> a -> b
$ forall a. (a -> Bool) -> [a] -> [a]
filter (forall q. HasSymbol q => q -> Stage -> Bool
`hasStageSymbol` Stage
Equational) (forall a. Eq a => [a] -> [a]
nub [e]
v))
(forall {n}. (NamedIdea n, Definition n) => LFunc -> n -> Sentence
lf LFunc
f)]
[]
where lf :: LFunc -> n -> Sentence
lf LFunc
Term = forall n. NamedIdea n => n -> Sentence
atStart
lf LFunc
Defn = Sentence -> Sentence
capSent forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall s a. s -> Getting a s a -> a
^. forall c. Definition c => Lens' c Sentence
defn)
lf (TermExcept [DefinedQuantityDict]
cs) = \n
x -> if (n
x forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid) forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` forall a b. (a -> b) -> [a] -> [b]
map (forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid) [DefinedQuantityDict]
cs then
Sentence -> Sentence
capSent (n
x forall s a. s -> Getting a s a -> a
^. forall c. Definition c => Lens' c Sentence
defn) else forall n. NamedIdea n => n -> Sentence
atStart n
x
lf (DefnExcept [DefinedQuantityDict]
cs) = \n
x -> if (n
x forall s a. s -> Getting a s a -> a
^. forall c. HasUID c => Lens' c UID
uid) forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` forall a b. (a -> b) -> [a] -> [b]
map (forall s a. s -> Getting a s a -> a
^.forall c. HasUID c => Lens' c UID
uid) [DefinedQuantityDict]
cs then
forall n. NamedIdea n => n -> Sentence
atStart n
x else Sentence -> Sentence
capSent (n
x forall s a. s -> Getting a s a -> a
^. forall c. Definition c => Lens' c Sentence
defn)
lf LFunc
TAD = \n
tDef -> forall n. NamedIdea n => n -> Sentence
titleize n
tDef Sentence -> Sentence -> Sentence
+: Sentence
EmptyS Sentence -> Sentence -> Sentence
+:+. Sentence -> Sentence
capSent (n
tDef forall s a. s -> Getting a s a -> a
^. forall c. Definition c => Lens' c Sentence
defn)
mkIntroSec :: SystemInformation -> IntroSec -> Section
mkIntroSec :: SystemInformation -> IntroSec -> Section
mkIntroSec SystemInformation
si (IntroProg Sentence
probIntro Sentence
progDefn [IntroSub]
l) =
Sentence -> Sentence -> [Section] -> Section
Intro.introductionSection Sentence
probIntro Sentence
progDefn forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (SystemInformation -> IntroSub -> Section
mkSubIntro SystemInformation
si) [IntroSub]
l
where
mkSubIntro :: SystemInformation -> IntroSub -> Section
mkSubIntro :: SystemInformation -> IntroSub -> Section
mkSubIntro SystemInformation
_ (IPurpose [Sentence]
intro) = [Sentence] -> Section
Intro.purposeOfDoc [Sentence]
intro
mkSubIntro SystemInformation
_ (IScope Sentence
main) = Sentence -> Section
Intro.scopeOfRequirements Sentence
main
mkSubIntro SI {_sys :: ()
_sys = a
sys} (IChar [Sentence]
assumed [Sentence]
topic [Sentence]
asset) =
forall a.
Idea a =>
a -> [Sentence] -> [Sentence] -> [Sentence] -> Section -> Section
Intro.charIntRdrF a
sys [Sentence]
assumed [Sentence]
topic [Sentence]
asset ([Contents] -> [Section] -> Section
SRS.userChar [] [])
mkSubIntro SystemInformation
_ (IOrgSec CI
b Section
s Sentence
t) = forall c. NamedIdea c => c -> Section -> Sentence -> Section
Intro.orgSec CI
b Section
s Sentence
t
mkStkhldrSec :: StkhldrSec -> Section
mkStkhldrSec :: StkhldrSec -> Section
mkStkhldrSec (StkhldrProg [StkhldrSub]
l) = [Contents] -> [Section] -> Section
SRS.stakeholder [Contents
Stk.stakeholderIntro] forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map StkhldrSub -> Section
mkSubs [StkhldrSub]
l
where
mkSubs :: StkhldrSub -> Section
mkSubs :: StkhldrSub -> Section
mkSubs (Client CI
kWrd Sentence
details) = forall a. Idea a => a -> Sentence -> Section
Stk.tClientF CI
kWrd Sentence
details
mkSubs (Cstmr CI
kWrd) = forall a. Idea a => a -> Section
Stk.tCustomerF CI
kWrd
mkGSDSec :: GSDSec -> Section
mkGSDSec :: GSDSec -> Section
mkGSDSec (GSDProg [GSDSub]
l) = [Contents] -> [Section] -> Section
SRS.genSysDes [Contents
GSD.genSysIntro] forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map GSDSub -> Section
mkSubs [GSDSub]
l
where
mkSubs :: GSDSub -> Section
mkSubs :: GSDSub -> Section
mkSubs (SysCntxt [Contents]
cs) = [Contents] -> Section
GSD.sysContxt [Contents]
cs
mkSubs (UsrChars [Contents]
intro) = [Contents] -> Section
GSD.usrCharsF [Contents]
intro
mkSubs (SystCons [Contents]
cntnts [Section]
subsec) = [Contents] -> [Section] -> Section
GSD.systCon [Contents]
cntnts [Section]
subsec
mkSSDSec :: SystemInformation -> SSDSec -> Section
mkSSDSec :: SystemInformation -> SSDSec -> Section
mkSSDSec SystemInformation
si (SSDProg [SSDSub]
l) =
[Section] -> Section
SSD.specSysDescr forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (SystemInformation -> SSDSub -> Section
mkSubSSD SystemInformation
si) [SSDSub]
l
where
mkSubSSD :: SystemInformation -> SSDSub -> Section
mkSubSSD :: SystemInformation -> SSDSub -> Section
mkSubSSD SystemInformation
sysi (SSDProblem ProblemDescription
pd) = SystemInformation -> ProblemDescription -> Section
mkSSDProb SystemInformation
sysi ProblemDescription
pd
mkSubSSD SystemInformation
sysi (SSDSolChSpec SolChSpec
scs) = SystemInformation -> SolChSpec -> Section
mkSolChSpec SystemInformation
sysi SolChSpec
scs
mkSSDProb :: SystemInformation -> ProblemDescription -> Section
mkSSDProb :: SystemInformation -> ProblemDescription -> Section
mkSSDProb SystemInformation
_ (PDProg Sentence
prob [Section]
subSec [PDSub]
subPD) = Sentence -> [Section] -> Section
SSD.probDescF Sentence
prob ([Section]
subSec forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map PDSub -> Section
mkSubPD [PDSub]
subPD)
where mkSubPD :: PDSub -> Section
mkSubPD (TermsAndDefs Maybe Sentence
sen [c]
concepts) = forall c. Concept c => Maybe Sentence -> [c] -> Section
SSD.termDefnF Maybe Sentence
sen [c]
concepts
mkSubPD (PhySysDesc a
prog [Sentence]
parts LabelledContent
dif [Contents]
extra) = forall a.
Idea a =>
a -> [Sentence] -> LabelledContent -> [Contents] -> Section
SSD.physSystDesc a
prog [Sentence]
parts LabelledContent
dif [Contents]
extra
mkSubPD (Goals [Sentence]
ins [ConceptInstance]
g) = [Sentence] -> [Contents] -> Int -> Section
SSD.goalStmtF [Sentence]
ins (forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD [ConceptInstance]
g) (forall (t :: * -> *) a. Foldable t => t a -> Int
length [ConceptInstance]
g)
mkSolChSpec :: SystemInformation -> SolChSpec -> Section
mkSolChSpec :: SystemInformation -> SolChSpec -> Section
mkSolChSpec SystemInformation
si (SCSProg [SCSSub]
l) =
[Contents] -> [Section] -> Section
SRS.solCharSpec [forall a. Idea a => a -> Section -> Contents
SSD.solutionCharSpecIntro (SystemInformation -> IdeaDict
siSys SystemInformation
si) Section
SSD.imStub] forall a b. (a -> b) -> a -> b
$
forall a b. (a -> b) -> [a] -> [b]
map (SystemInformation -> SCSSub -> Section
mkSubSCS SystemInformation
si) [SCSSub]
l
where
mkSubSCS :: SystemInformation -> SCSSub -> Section
mkSubSCS :: SystemInformation -> SCSSub -> Section
mkSubSCS SystemInformation
si' (TMs [Sentence]
intro Fields
fields [TheoryModel]
ts) =
forall a. Idea a => a -> [Contents] -> Section
SSD.thModF (SystemInformation -> IdeaDict
siSys SystemInformation
si') forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map (LabelledContent -> Contents
LlC forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fields -> SystemInformation -> TheoryModel -> LabelledContent
tmodel Fields
fields SystemInformation
si') [TheoryModel]
ts
mkSubSCS SystemInformation
si' (DDs [Sentence]
intro Fields
fields [DataDefinition]
dds DerivationDisplay
ShowDerivation) =
Sentence -> [Contents] -> Section
SSD.dataDefnF Sentence
EmptyS forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++ forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap DataDefinition -> [Contents]
f [DataDefinition]
dds
where f :: DataDefinition -> [Contents]
f DataDefinition
e = LabelledContent -> Contents
LlC (Fields -> SystemInformation -> DataDefinition -> LabelledContent
ddefn Fields
fields SystemInformation
si' DataDefinition
e) forall a. a -> [a] -> [a]
: forall a. Maybe a -> [a]
maybeToList (forall c.
(MayHaveDerivation c, HasShortName c, Referable c) =>
c -> Maybe Contents
derivation DataDefinition
e)
mkSubSCS SystemInformation
si' (DDs [Sentence]
intro Fields
fields [DataDefinition]
dds DerivationDisplay
_) =
Sentence -> [Contents] -> Section
SSD.dataDefnF Sentence
EmptyS forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map DataDefinition -> Contents
f [DataDefinition]
dds
where f :: DataDefinition -> Contents
f DataDefinition
e = LabelledContent -> Contents
LlC forall a b. (a -> b) -> a -> b
$ Fields -> SystemInformation -> DataDefinition -> LabelledContent
ddefn Fields
fields SystemInformation
si' DataDefinition
e
mkSubSCS SystemInformation
si' (GDs [Sentence]
intro Fields
fields [GenDefn]
gs' DerivationDisplay
ShowDerivation) =
[Contents] -> Section
SSD.genDefnF forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++ forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\GenDefn
x -> LabelledContent -> Contents
LlC (Fields -> SystemInformation -> GenDefn -> LabelledContent
gdefn Fields
fields SystemInformation
si' GenDefn
x) forall a. a -> [a] -> [a]
: forall a. Maybe a -> [a]
maybeToList (forall c.
(MayHaveDerivation c, HasShortName c, Referable c) =>
c -> Maybe Contents
derivation GenDefn
x)) [GenDefn]
gs'
mkSubSCS SystemInformation
si' (GDs [Sentence]
intro Fields
fields [GenDefn]
gs' DerivationDisplay
_) =
[Contents] -> Section
SSD.genDefnF forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map (LabelledContent -> Contents
LlC forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fields -> SystemInformation -> GenDefn -> LabelledContent
gdefn Fields
fields SystemInformation
si') [GenDefn]
gs'
mkSubSCS SystemInformation
si' (IMs [Sentence]
intro Fields
fields [InstanceModel]
ims DerivationDisplay
ShowDerivation) =
Section -> Section -> Section -> Section -> [Contents] -> Section
SSD.inModelF Section
SSD.pdStub Section
SSD.ddStub Section
SSD.tmStub Section
SSD.gdStub forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (\InstanceModel
x -> LabelledContent -> Contents
LlC (Fields -> SystemInformation -> InstanceModel -> LabelledContent
instanceModel Fields
fields SystemInformation
si' InstanceModel
x) forall a. a -> [a] -> [a]
: forall a. Maybe a -> [a]
maybeToList (forall c.
(MayHaveDerivation c, HasShortName c, Referable c) =>
c -> Maybe Contents
derivation InstanceModel
x)) [InstanceModel]
ims
mkSubSCS SystemInformation
si' (IMs [Sentence]
intro Fields
fields [InstanceModel]
ims DerivationDisplay
_) =
Section -> Section -> Section -> Section -> [Contents] -> Section
SSD.inModelF Section
SSD.pdStub Section
SSD.ddStub Section
SSD.tmStub Section
SSD.gdStub forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Contents
mkParagraph [Sentence]
intro forall a. [a] -> [a] -> [a]
++
forall a b. (a -> b) -> [a] -> [b]
map (LabelledContent -> Contents
LlC forall b c a. (b -> c) -> (a -> b) -> a -> c
. Fields -> SystemInformation -> InstanceModel -> LabelledContent
instanceModel Fields
fields SystemInformation
si') [InstanceModel]
ims
mkSubSCS SystemInformation
si' (Assumptions [ConceptInstance]
ci) =
[Contents] -> Section
SSD.assumpF forall a b. (a -> b) -> a -> b
$ forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (ConceptInstance -> SystemInformation -> ConceptInstance
`SSD.helperCI` SystemInformation
si') [ConceptInstance]
ci
mkSubSCS SystemInformation
_ (Constraints Sentence
end [c]
cs) = forall c.
(HasUncertainty c, Quantity c, Constrained c, HasReasVal c,
MayHaveUnit c) =>
Sentence -> [c] -> Section
SSD.datConF Sentence
end [c]
cs
mkSubSCS SystemInformation
_ (CorrSolnPpties [c]
c [Contents]
cs) = forall c.
(Quantity c, Constrained c) =>
[c] -> [Contents] -> Section
SSD.propCorSolF [c]
c [Contents]
cs
siSys :: SystemInformation -> IdeaDict
siSys :: SystemInformation -> IdeaDict
siSys SI {_sys :: ()
_sys = a
sys} = forall c. Idea c => c -> IdeaDict
nw a
sys
mkReqrmntSec :: ReqrmntSec -> Section
mkReqrmntSec :: ReqrmntSec -> Section
mkReqrmntSec (ReqsProg [ReqsSub]
l) = [Section] -> Section
R.reqF forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map ReqsSub -> Section
mkSubs [ReqsSub]
l
where
mkSubs :: ReqsSub -> Section
mkSubs :: ReqsSub -> Section
mkSubs (FReqsSub [ConceptInstance]
frs [LabelledContent]
tbs) = [Contents] -> Section
R.fReqF (forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD [ConceptInstance]
frs forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map LabelledContent -> Contents
LlC [LabelledContent]
tbs)
mkSubs (FReqsSub' [ConceptInstance]
frs [LabelledContent]
tbs) = [Contents] -> Section
R.fReqF (forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD [ConceptInstance]
frs forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map LabelledContent -> Contents
LlC [LabelledContent]
tbs)
mkSubs (NonFReqsSub [ConceptInstance]
nfrs) = [Contents] -> Section
R.nfReqF (forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD [ConceptInstance]
nfrs)
mkLCsSec :: LCsSec -> Section
mkLCsSec :: LCsSec -> Section
mkLCsSec (LCsProg [ConceptInstance]
c) = [Contents] -> [Section] -> Section
SRS.likeChg (forall n. NamedIdea n => n -> [ConceptInstance] -> Contents
introChgs CI
Doc.likelyChg [ConceptInstance]
cforall a. a -> [a] -> [a]
: forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD [ConceptInstance]
c) []
mkUCsSec :: UCsSec -> Section
mkUCsSec :: UCsSec -> Section
mkUCsSec (UCsProg [ConceptInstance]
c) = [Contents] -> [Section] -> Section
SRS.unlikeChg (forall n. NamedIdea n => n -> [ConceptInstance] -> Contents
introChgs CI
Doc.unlikelyChg [ConceptInstance]
c forall a. a -> [a] -> [a]
: forall c.
(Referable c, HasShortName c, Definition c) =>
[c] -> [Contents]
mkEnumSimpleD [ConceptInstance]
c) []
introChgs :: NamedIdea n => n -> [ConceptInstance] -> Contents
introChgs :: forall n. NamedIdea n => n -> [ConceptInstance] -> Contents
introChgs n
xs [] = Sentence -> Contents
mkParagraph forall a b. (a -> b) -> a -> b
$ forall n. NamedIdea n => [n] -> Sentence
emptySectSentPlu [n
xs]
introChgs n
xs [ConceptInstance]
_ = [Sentence] -> Contents
foldlSP [String -> Sentence
S String
"This", forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
Doc.section_, String -> Sentence
S String
"lists the",
forall n. NamedIdea n => n -> Sentence
plural n
xs, String -> Sentence
S String
"to be made to the", forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
Doc.software]
mkTraceabilitySec :: TraceabilitySec -> SystemInformation -> Section
mkTraceabilitySec :: TraceabilitySec -> SystemInformation -> Section
mkTraceabilitySec (TraceabilityProg [TraceConfig]
progs) si :: SystemInformation
si@SI{_sys :: ()
_sys = a
sys} = [LabelledContent]
-> [Sentence] -> [Contents] -> String -> [Section] -> Section
TG.traceMGF [LabelledContent]
trace
(forall a b. (a -> b) -> [a] -> [b]
map (\(TraceConfig UID
_ [Sentence]
pre Sentence
_ [TraceViewCat]
_ [TraceViewCat]
_) -> SepType -> FoldType -> [Sentence] -> Sentence
foldlList SepType
Comma FoldType
List [Sentence]
pre) [TraceConfig]
fProgs)
(forall a b. (a -> b) -> [a] -> [b]
map LabelledContent -> Contents
LlC [LabelledContent]
trace) (forall c. CommonIdea c => c -> String
programName a
sys) []
where
trace :: [LabelledContent]
trace = forall a b. (a -> b) -> [a] -> [b]
map (\(TraceConfig UID
u [Sentence]
_ Sentence
desc [TraceViewCat]
cols [TraceViewCat]
rows) -> UID
-> Sentence
-> [TraceViewCat]
-> [TraceViewCat]
-> SystemInformation
-> LabelledContent
TM.generateTraceTableView
UID
u Sentence
desc [TraceViewCat]
cols [TraceViewCat]
rows SystemInformation
si) [TraceConfig]
fProgs
fProgs :: [TraceConfig]
fProgs = forall a. (a -> Bool) -> [a] -> [a]
filter (\(TraceConfig UID
_ [Sentence]
_ Sentence
_ [TraceViewCat]
cols [TraceViewCat]
rows) -> Bool -> Bool
not forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t a -> Bool
null
(([UID] -> [UID]) -> SystemInformation -> [Sentence]
header ([TraceViewCat] -> ChunkDB -> [UID] -> [UID]
TM.layoutUIDs [TraceViewCat]
rows ChunkDB
sidb) SystemInformation
si) Bool -> Bool -> Bool
|| forall (t :: * -> *) a. Foldable t => t a -> Bool
null (([UID] -> [UID]) -> SystemInformation -> [Sentence]
header ([TraceViewCat] -> ChunkDB -> [UID] -> [UID]
TM.layoutUIDs [TraceViewCat]
cols ChunkDB
sidb) SystemInformation
si)) [TraceConfig]
progs
sidb :: ChunkDB
sidb = SystemInformation -> ChunkDB
_sysinfodb SystemInformation
si
header :: ([UID] -> [UID]) -> SystemInformation -> [Sentence]
[UID] -> [UID]
f = (ChunkDB -> [UID]) -> SystemInformation -> [Sentence]
TM.traceMHeader ([UID] -> [UID]
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Eq a => [a] -> [a]
nub forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k a. Map k a -> [k]
Map.keys forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall s a. s -> Getting a s a -> a
^. Lens' ChunkDB (Map UID [UID])
refbyTable))
mkOffShelfSolnSec :: OffShelfSolnsSec -> Section
mkOffShelfSolnSec :: OffShelfSolnsSec -> Section
mkOffShelfSolnSec (OffShelfSolnsProg [Contents]
cs) = [Contents] -> [Section] -> Section
SRS.offShelfSol [Contents]
cs []
mkAuxConsSec :: AuxConstntSec -> Section
mkAuxConsSec :: AuxConstntSec -> Section
mkAuxConsSec (AuxConsProg CI
key [ConstQDef]
listOfCons) = forall a. Idea a => a -> [ConstQDef] -> Section
AC.valsOfAuxConstantsF CI
key forall a b. (a -> b) -> a -> b
$ forall a. HasSymbol a => [a] -> [a]
sortBySymbol [ConstQDef]
listOfCons
mkBib :: BibRef -> Section
mkBib :: BibRef -> Section
mkBib BibRef
bib = [Contents] -> [Section] -> Section
SRS.reference [UnlabelledContent -> Contents
UlC forall a b. (a -> b) -> a -> b
$ RawContent -> UnlabelledContent
ulcc (BibRef -> RawContent
Bib BibRef
bib)] []
mkAppndxSec :: AppndxSec -> Section
mkAppndxSec :: AppndxSec -> Section
mkAppndxSec (AppndxProg [Contents]
cs) = [Contents] -> [Section] -> Section
SRS.appendix [Contents]
cs []