module Drasil.Projectile.Body (printSetting, si, srs, projectileTitle, fullSI) where

import Language.Drasil
import Drasil.SRSDocument
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.NounPhrase.Combinators as NP
import qualified Language.Drasil.Sentence.Combinators as S
import qualified Drasil.DocLang.SRS as SRS

import Data.Drasil.Concepts.Computation (inValue, algorithm, inDatum, compcon)
import Data.Drasil.Concepts.Documentation (analysis, doccon, doccon', physics,
  problem, srsDomains, assumption, goalStmt, physSyst, sysCont, software, user,
  requirement, refBy, refName, typUnc, example, softwareSys, system, environment, 
  product_, interface, condition, physical, datum, input_, softwareConstraint, 
  output_, endUser)
import qualified Data.Drasil.Concepts.Documentation as Doc (srs, physics, variable)
import Data.Drasil.Concepts.Math (cartesian, mathcon)
import Data.Drasil.Concepts.PhysicalProperties (mass)
import Data.Drasil.Concepts.Physics (gravity, physicCon, physicCon',
  rectilinear, oneD, twoD, motion)
import Data.Drasil.Concepts.Software (errMsg, program)
import Data.Drasil.Software.Products (sciCompS)

import Data.Drasil.Quantities.Math (pi_, piConst)
import Data.Drasil.Quantities.Physics (acceleration, constAccel,
  gravitationalAccelConst, iPos, iSpeed, iVel, ixPos, iyPos, ixVel, iyVel,
  position, scalarPos, time, velocity, xAccel, xConstAccel, xPos,
  xVel, yAccel, yConstAccel, yPos, yVel, physicscon)

import Data.Drasil.People (brooks, samCrawford, spencerSmith)
import Data.Drasil.SI_Units (metre, radian, second)
import Data.Drasil.Theories.Physics (accelerationTM, velocityTM)
import Data.Drasil.TheoryConcepts (dataDefn, genDefn, inModel, thModel)
import Data.Drasil.Concepts.Education(calculus, educon, undergraduate, 
  highSchoolPhysics, highSchoolCalculus)

import Drasil.Projectile.Assumptions (assumptions)
import Drasil.Projectile.Concepts (concepts, launcher, projectile, target)
import Drasil.Projectile.DataDefs (dataDefs)
import Drasil.Projectile.Figures (figLaunch, sysCtxFig1)
import Drasil.Projectile.GenDefs (genDefns)
import Drasil.Projectile.Goals (goals)
import Drasil.Projectile.IMods (iMods)
import Drasil.Projectile.References (citations)
import Drasil.Projectile.Requirements (funcReqs, nonfuncReqs)
import Drasil.Projectile.Unitals

import Theory.Drasil (TheoryModel)

srs :: Document
srs :: Document
srs = SRSDecl
-> (IdeaDict -> IdeaDict -> Sentence)
-> SystemInformation
-> Document
mkDoc SRSDecl
mkSRS (forall c d.
(c -> Sentence) -> (d -> Sentence) -> c -> d -> Sentence
S.forGen forall n. NamedIdea n => n -> Sentence
titleize forall n. NamedIdea n => n -> Sentence
phrase) SystemInformation
si

fullSI :: SystemInformation
fullSI :: SystemInformation
fullSI = SRSDecl -> SystemInformation -> SystemInformation
fillcdbSRS SRSDecl
mkSRS SystemInformation
si

printSetting :: PrintingInformation
printSetting :: PrintingInformation
printSetting = SystemInformation
-> Stage -> PrintingConfiguration -> PrintingInformation
piSys SystemInformation
fullSI Stage
Equational PrintingConfiguration
defaultConfiguration

mkSRS :: SRSDecl
mkSRS :: SRSDecl
mkSRS = [DocSection
TableOfContents,
  RefSec -> DocSection
RefSec forall a b. (a -> b) -> a -> b
$
    Contents -> [RefTab] -> RefSec
RefProg Contents
intro
      [ RefTab
TUnits
      , [TSIntro] -> RefTab
tsymb [TSIntro
TSPurpose, [TConvention] -> TSIntro
TypogConvention [Emphasis -> TConvention
Vector Emphasis
Bold], TSIntro
SymbOrder, TSIntro
VectorUnits]
      , RefTab
TAandA
      ],
  IntroSec -> DocSection
IntroSec forall a b. (a -> b) -> a -> b
$
    Sentence -> Sentence -> [IntroSub] -> IntroSec
IntroProg Sentence
justification (forall n. NamedIdea n => n -> Sentence
phrase CI
projectileTitle)
      [ [Sentence] -> IntroSub
IPurpose forall a b. (a -> b) -> a -> b
$ CI -> Verbosity -> [Sentence]
purpDoc CI
projectileTitle Verbosity
Verbose
      , Sentence -> IntroSub
IScope Sentence
scope
      , [Sentence] -> [Sentence] -> [Sentence] -> IntroSub
IChar [] [Sentence]
charsOfReader []
      , CI -> Section -> Sentence -> IntroSub
IOrgSec CI
inModel ([Contents] -> [Section] -> Section
SRS.inModel [] []) Sentence
EmptyS],
  GSDSec -> DocSection
GSDSec forall a b. (a -> b) -> a -> b
$ 
      [GSDSub] -> GSDSec
GSDProg 
        [ [Contents] -> GSDSub
SysCntxt [Contents
sysCtxIntro, LabelledContent -> Contents
LlC LabelledContent
sysCtxFig1, Contents
sysCtxDesc, Contents
sysCtxList]
        , [Contents] -> GSDSub
UsrChars [Contents
userCharacteristicsIntro]
        , [Contents] -> [Section] -> GSDSub
SystCons [] []],  
  SSDSec -> DocSection
SSDSec forall a b. (a -> b) -> a -> b
$
    [SSDSub] -> SSDSec
SSDProg
      [ ProblemDescription -> SSDSub
SSDProblem forall a b. (a -> b) -> a -> b
$ Sentence -> [Section] -> [PDSub] -> ProblemDescription
PDProg Sentence
purp []
        [ forall c. Concept c => Maybe Sentence -> [c] -> PDSub
TermsAndDefs forall a. Maybe a
Nothing [ConceptChunk]
terms
        , forall a.
Idea a =>
a -> [Sentence] -> LabelledContent -> [Contents] -> PDSub
PhySysDesc CI
projectileTitle [Sentence]
physSystParts LabelledContent
figLaunch []
        , [Sentence] -> PDSub
Goals [(forall n. NamedIdea n => n -> Sentence
phrase UnitalChunk
iVel Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"vector") Sentence -> Sentence -> Sentence
`S.the_ofThe` forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
projectile, 
                  String -> Sentence
S String
"geometric layout" Sentence -> Sentence -> Sentence
`S.the_ofThe` forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
launcher Sentence -> Sentence -> Sentence
`S.and_` forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
target]]
      , SolChSpec -> SSDSub
SSDSolChSpec forall a b. (a -> b) -> a -> b
$ [SCSSub] -> SolChSpec
SCSProg
        [ SCSSub
Assumptions
        , [Sentence] -> Fields -> SCSSub
TMs [] (Field
Label forall a. a -> [a] -> [a]
: Fields
stdFields)
        , [Sentence] -> Fields -> DerivationDisplay -> SCSSub
GDs [] ([Field
Label, Field
Units] forall a. [a] -> [a] -> [a]
++ Fields
stdFields) DerivationDisplay
ShowDerivation
        , [Sentence] -> Fields -> DerivationDisplay -> SCSSub
DDs [] ([Field
Label, Field
Symbol, Field
Units] forall a. [a] -> [a] -> [a]
++ Fields
stdFields) DerivationDisplay
ShowDerivation
        , [Sentence] -> Fields -> DerivationDisplay -> SCSSub
IMs [] ([Field
Label, Field
Input, Field
Output, Field
InConstraints, Field
OutConstraints] forall a. [a] -> [a] -> [a]
++ Fields
stdFields) DerivationDisplay
ShowDerivation
        , forall c.
(HasUncertainty c, Quantity c, Constrained c, HasReasVal c,
 MayHaveUnit c) =>
Sentence -> [c] -> SCSSub
Constraints Sentence
EmptyS [UncertQ]
inConstraints
        , forall c.
(Quantity c, Constrained c) =>
[c] -> [Contents] -> SCSSub
CorrSolnPpties [UncertQ]
outConstraints []
        ]
      ],
  ReqrmntSec -> DocSection
ReqrmntSec forall a b. (a -> b) -> a -> b
$
    [ReqsSub] -> ReqrmntSec
ReqsProg
      [ Sentence -> [LabelledContent] -> ReqsSub
FReqsSub Sentence
EmptyS []
      , ReqsSub
NonFReqsSub
      ],
  TraceabilitySec -> DocSection
TraceabilitySec forall a b. (a -> b) -> a -> b
$ [TraceConfig] -> TraceabilitySec
TraceabilityProg forall a b. (a -> b) -> a -> b
$ SystemInformation -> [TraceConfig]
traceMatStandard SystemInformation
si,
  AuxConstntSec -> DocSection
AuxConstntSec forall a b. (a -> b) -> a -> b
$
    CI -> [ConstQDef] -> AuxConstntSec
AuxConsProg CI
projectileTitle [ConstQDef]
constants,
  DocSection
Bibliography
  ]

justification, scope :: Sentence
justification :: Sentence
justification = [Sentence] -> Sentence
foldlSent [forall n. NamedIdea n => n -> Sentence
atStart ConceptChunk
projectile, forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
motion, String -> Sentence
S String
"is a common" Sentence -> Sentence -> Sentence
+:+.
  forall n. NounPhrase n => n -> Sentence
phraseNP (IdeaDict
problem forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`in_` IdeaDict
physics), String -> Sentence
S String
"Therefore, it is useful to have a",
  forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
program, String -> Sentence
S String
"to solve and model these types of" Sentence -> Sentence -> Sentence
+:+. forall n. NamedIdea n => n -> Sentence
plural IdeaDict
problem, 
  String -> Sentence
S String
"Common", forall n. NamedIdea n => n -> Sentence
plural IdeaDict
example Sentence -> Sentence -> Sentence
`S.of_` forall n. NounPhrase n => n -> Sentence
phraseNP (forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI ConceptChunk
projectile ConceptChunk
motion), 
  String -> Sentence
S String
"include" Sentence -> Sentence -> Sentence
+:+. SepType -> FoldType -> [Sentence] -> Sentence
foldlList SepType
Comma FoldType
List [Sentence]
projectileExamples,
  forall n. NounPhrase n => n -> Sentence
atStartNP (forall t. NamedIdea t => t -> NP
the ConceptChunk
program), String -> Sentence
S String
"documented here is called", forall n. NamedIdea n => n -> Sentence
phrase CI
projectileTitle]
scope :: Sentence
scope = [Sentence] -> Sentence
foldlSent_ [forall n. NounPhrase n => n -> Sentence
phraseNP (NP -> NP
NP.the (IdeaDict
analysis forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`ofA` CI
twoD)),
  Sentence -> Sentence
sParen (CI -> Sentence
getAcc CI
twoD), forall n. NounPhrase n => n -> Sentence
phraseNP (forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI ConceptChunk
projectile ConceptChunk
motion), forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
problem, 
  String -> Sentence
S String
"with", forall n. NamedIdea n => n -> Sentence
phrase UnitalChunk
constAccel]

projectileExamples :: [Sentence]
projectileExamples :: [Sentence]
projectileExamples = [String -> Sentence
S String
"ballistics" Sentence -> Sentence -> Sentence
+:+ forall n. NamedIdea n => n -> Sentence
plural IdeaDict
problem Sentence -> Sentence -> Sentence
+:+ Sentence -> Sentence
sParen (String -> Sentence
S String
"missiles" Sentence -> Sentence -> Sentence
`sC` 
  String -> Sentence
S String
"bullets" Sentence -> Sentence -> Sentence
`sC` String -> Sentence
S String
"etc."), String -> Sentence
S String
"the flight" Sentence -> Sentence -> Sentence
`S.of_` String -> Sentence
S String
"balls" Sentence -> Sentence -> Sentence
`S.in_` 
  String -> Sentence
S String
"various sports" Sentence -> Sentence -> Sentence
+:+ Sentence -> Sentence
sParen (String -> Sentence
S String
"baseball" Sentence -> Sentence -> Sentence
`sC` String -> Sentence
S String
"golf" Sentence -> Sentence -> Sentence
`sC` String -> Sentence
S String
"football" Sentence -> Sentence -> Sentence
`sC`
  String -> Sentence
S String
"etc.")]

projectileTitle :: CI
projectileTitle :: CI
projectileTitle = String -> NP -> String -> [UID] -> CI
commonIdea String
"projectileTitle" (String -> NP
pn String
"Projectile") String
"Projectile" []

si :: SystemInformation
si :: SystemInformation
si = SI {
  _sys :: CI
_sys         = CI
projectileTitle,
  _kind :: CI
_kind        = CI
Doc.srs,
  _authors :: [Person]
_authors     = [Person
samCrawford, Person
brooks, Person
spencerSmith],
  _purpose :: [Sentence]
_purpose     = [Sentence
purp],
  _background :: [Sentence]
_background  = [],
  _quants :: [QuantityDict]
_quants      = [QuantityDict]
symbols,
  _concepts :: [DefinedQuantityDict]
_concepts    = [] :: [DefinedQuantityDict],
  _instModels :: [InstanceModel]
_instModels  = [InstanceModel]
iMods,
  _datadefs :: [DataDefinition]
_datadefs    = [DataDefinition]
dataDefs,
  _configFiles :: [String]
_configFiles = [],
  _inputs :: [QuantityDict]
_inputs      = [QuantityDict]
inputs,
  _outputs :: [QuantityDict]
_outputs     = [QuantityDict]
outputs,
  _defSequence :: [Block SimpleQDef]
_defSequence = [] :: [Block SimpleQDef],
  _constraints :: [ConstrainedChunk]
_constraints = forall a b. (a -> b) -> [a] -> [b]
map forall c.
(Quantity c, Constrained c, HasReasVal c, MayHaveUnit c) =>
c -> ConstrainedChunk
cnstrw [ConstrConcept]
constrained,
  _constants :: [ConstQDef]
_constants   = [ConstQDef]
constants,
  _sysinfodb :: ChunkDB
_sysinfodb   = ChunkDB
symbMap,
  _usedinfodb :: ChunkDB
_usedinfodb  = ChunkDB
usedDB,
   refdb :: ReferenceDB
refdb       = ReferenceDB
refDB
}

purp :: Sentence
purp :: Sentence
purp = [Sentence] -> Sentence
foldlSent_ [String -> Sentence
S String
"predict whether a launched", forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
projectile, String -> Sentence
S String
"hits its", forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
target]

tMods :: [TheoryModel]
tMods :: [TheoryModel]
tMods = [TheoryModel
accelerationTM, TheoryModel
velocityTM]

symbMap :: ChunkDB
symbMap :: ChunkDB
symbMap = forall q t c u.
(Quantity q, MayHaveUnit q, Idea t, Concept c, IsUnit u) =>
[q]
-> [t]
-> [c]
-> [u]
-> [DataDefinition]
-> [InstanceModel]
-> [GenDefn]
-> [TheoryModel]
-> [ConceptInstance]
-> [Section]
-> [LabelledContent]
-> [Reference]
-> ChunkDB
cdb (forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw DefinedQuantityDict
pi_ forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [UnitalChunk]
physicscon forall a. [a] -> [a] -> [a]
++ [QuantityDict]
unitalQuants forall a. [a] -> [a] -> [a]
++ [QuantityDict]
symbols)
  (forall c. Idea c => c -> IdeaDict
nw CI
projectileTitle forall a. a -> [a] -> [a]
: forall c. Idea c => c -> IdeaDict
nw ConceptChunk
mass forall a. a -> [a] -> [a]
: forall c. Idea c => c -> IdeaDict
nw IdeaDict
inValue forall a. a -> [a] -> [a]
: [forall c. Idea c => c -> IdeaDict
nw ConceptChunk
errMsg, forall c. Idea c => c -> IdeaDict
nw ConceptChunk
program] forall a. [a] -> [a] -> [a]
++
    forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [IdeaDict]
doccon forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [CI]
doccon' forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [ConceptChunk]
physicCon forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [CI]
physicCon' forall a. [a] -> [a] -> [a]
++
    forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [UnitalChunk]
physicscon forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [ConceptChunk]
mathcon forall a. [a] -> [a] -> [a]
++ [forall c. Idea c => c -> IdeaDict
nw ConceptChunk
algorithm] forall a. [a] -> [a] -> [a]
++ [IdeaDict]
concepts forall a. [a] -> [a] -> [a]
++ 
    [forall c. Idea c => c -> IdeaDict
nw IdeaDict
sciCompS] forall a. [a] -> [a] -> [a]
++ [IdeaDict]
unitalIdeas forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [CI]
acronyms forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [QuantityDict]
symbols forall a. [a] -> [a] -> [a]
++ 
    forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [IdeaDict]
educon forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [UnitDefn
metre, UnitDefn
radian, UnitDefn
second] forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [IdeaDict]
compcon) 
  (forall c. Concept c => c -> ConceptChunk
cw DefinedQuantityDict
pi_ forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall c. Concept c => c -> ConceptChunk
cw [ConstrConcept]
constrained forall a. [a] -> [a] -> [a]
++ [ConceptChunk]
srsDomains) (forall a b. (a -> b) -> [a] -> [b]
map forall u. IsUnit u => u -> UnitDefn
unitWrapper [UnitDefn
metre, UnitDefn
radian, UnitDefn
second]) 
  [DataDefinition]
dataDefs [InstanceModel]
iMods [GenDefn]
genDefns [TheoryModel]
tMods [ConceptInstance]
concIns [] [] []

usedDB :: ChunkDB
usedDB :: ChunkDB
usedDB = forall q t c u.
(Quantity q, MayHaveUnit q, Idea t, Concept c, IsUnit u) =>
[q]
-> [t]
-> [c]
-> [u]
-> [DataDefinition]
-> [InstanceModel]
-> [GenDefn]
-> [TheoryModel]
-> [ConceptInstance]
-> [Section]
-> [LabelledContent]
-> [Reference]
-> ChunkDB
cdb ([] :: [QuantityDict]) (forall c. Idea c => c -> IdeaDict
nw DefinedQuantityDict
pi_ forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [CI]
acronyms forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [QuantityDict]
symbols)
  (forall c. Concept c => c -> ConceptChunk
cw DefinedQuantityDict
pi_ forall a. a -> [a] -> [a]
: [ConceptChunk]
srsDomains) ([] :: [UnitDefn]) [] [] [] [] [] [] [] ([] :: [Reference])

stdFields :: Fields
stdFields :: Fields
stdFields = [Field
DefiningEquation, Verbosity -> InclUnits -> Field
Description Verbosity
Verbose InclUnits
IncludeUnits, Field
Notes, Field
Source, Field
RefBy]

refDB :: ReferenceDB
refDB :: ReferenceDB
refDB = BibRef -> [ConceptInstance] -> ReferenceDB
rdb BibRef
citations [ConceptInstance]
concIns

concIns :: [ConceptInstance]
concIns :: [ConceptInstance]
concIns = [ConceptInstance]
assumptions forall a. [a] -> [a] -> [a]
++ [ConceptInstance]
funcReqs forall a. [a] -> [a] -> [a]
++ [ConceptInstance]
goals forall a. [a] -> [a] -> [a]
++ [ConceptInstance]
nonfuncReqs

----------------------------------------
-- Characteristics of Intended Reader --
----------------------------------------

charsOfReader :: [Sentence]
charsOfReader :: [Sentence]
charsOfReader = [forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
undergraduate Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"level 1" Sentence -> Sentence -> Sentence
+:+ forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
Doc.physics,
                 forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
undergraduate Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"level 1" Sentence -> Sentence -> Sentence
+:+ forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
calculus]

-----------------
--SystemContext--
-----------------

sysCtxIntro :: Contents
sysCtxIntro :: Contents
sysCtxIntro = [Sentence] -> Contents
foldlSP
  [forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Sentence
refS LabelledContent
sysCtxFig1, String -> Sentence
S String
"shows the" Sentence -> Sentence -> Sentence
+:+. forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
sysCont,
   String -> Sentence
S String
"A circle represents an entity external" Sentence -> Sentence -> Sentence
`S.toThe` forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
software
   Sentence -> Sentence -> Sentence
`sC` forall n. NounPhrase n => n -> Sentence
phraseNP (forall t. NamedIdea t => t -> NP
the IdeaDict
user), String -> Sentence
S String
"in this case. A rectangle represents the",
   forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
softwareSys, String -> Sentence
S String
"itself" Sentence -> Sentence -> Sentence
+:+. Sentence -> Sentence
sParen (forall c. Idea c => c -> Sentence
short CI
projectileTitle),
   String -> Sentence
S String
"Arrows are used to show the data flow between the", forall n. NounPhrase n => n -> Sentence
phraseNP (IdeaDict
system
   forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andIts` IdeaDict
environment)]

sysCtxDesc :: Contents
sysCtxDesc :: Contents
sysCtxDesc = [Sentence] -> Contents
foldlSPCol [String -> Sentence
S String
"The interaction between the", forall n. NounPhrase n => n -> Sentence
phraseNP (IdeaDict
product_
   forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andThe` IdeaDict
user), String -> Sentence
S String
"is through an application programming" Sentence -> Sentence -> Sentence
+:+.
   forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
interface, String -> Sentence
S String
"responsibilities" Sentence -> Sentence -> Sentence
`S.the_ofTheC` forall n. NounPhrase n => n -> Sentence
phraseNP (IdeaDict
user 
   forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`andThe` IdeaDict
system), String -> Sentence
S String
"are as follows"]

sysCtxUsrResp :: [Sentence]
sysCtxUsrResp :: [Sentence]
sysCtxUsrResp = forall a b. (a -> b) -> [a] -> [b]
map [Sentence] -> Sentence
foldlSent [[String -> Sentence
S String
"Provide initial", forall n. NounPhrase n => n -> Sentence
pluralNP (IdeaDict
condition forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`ofThePS`
  IdeaDict
physical), String -> Sentence
S String
"state" Sentence -> Sentence -> Sentence
`S.ofThe` forall n. NamedIdea n => n -> Sentence
phrase ConceptChunk
motion Sentence -> Sentence -> Sentence
`S.andThe` forall n. NamedIdea n => n -> Sentence
plural IdeaDict
inDatum, String -> Sentence
S String
"related" Sentence -> Sentence -> Sentence
`S.toThe`
  forall n. NamedIdea n => n -> Sentence
phrase CI
projectileTitle Sentence -> Sentence -> Sentence
`sC` String -> Sentence
S String
"ensuring no errors" Sentence -> Sentence -> Sentence
`S.inThe` forall n. NamedIdea n => n -> Sentence
plural IdeaDict
datum, String -> Sentence
S String
"entry"], 
  [String -> Sentence
S String
"Ensure that consistent units are used for", forall n. NounPhrase n => n -> Sentence
pluralNP (forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI IdeaDict
input_ IdeaDict
Doc.variable)],
  [String -> Sentence
S String
"Ensure required", forall r.
(HasUID r, HasRefAddress r, HasShortName r) =>
r -> Sentence -> Sentence
namedRef ([Contents] -> [Section] -> Section
SRS.assumpt ([]::[Contents]) ([]::[Section])) 
   (forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
software Sentence -> Sentence -> Sentence
+:+ forall n. NamedIdea n => n -> Sentence
plural CI
assumption), String -> Sentence
S String
"are appropriate for any particular",
  forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
problem, forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
input_ Sentence -> Sentence -> Sentence
`S.toThe` forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
software]]

sysCtxSysResp :: [Sentence]
sysCtxSysResp :: [Sentence]
sysCtxSysResp = forall a b. (a -> b) -> [a] -> [b]
map [Sentence] -> Sentence
foldlSent [[String -> Sentence
S String
"Detect data type mismatch, such as a string of characters",
  forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
input_, String -> Sentence
S String
"instead of a floating point number"],
  [String -> Sentence
S String
"Determine if the", forall n. NamedIdea n => n -> Sentence
plural IdeaDict
input_, String -> Sentence
S String
"satisfy the required",
  forall n. NounPhrase n => n -> Sentence
pluralNP (IdeaDict
physical forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
`and_` IdeaDict
softwareConstraint)],
  [String -> Sentence
S String
"Calculate the required", forall n. NamedIdea n => n -> Sentence
plural IdeaDict
output_]]

sysCtxResp :: [Sentence]
sysCtxResp :: [Sentence]
sysCtxResp = forall a b. (a -> b) -> [a] -> [b]
map (\Sentence
x -> Sentence
x Sentence -> Sentence -> Sentence
+:+ String -> Sentence
S String
"Responsibilities") 
  [forall n. NamedIdea n => n -> Sentence
titleize IdeaDict
user, forall c. Idea c => c -> Sentence
short CI
projectileTitle]

sysCtxList :: Contents
sysCtxList :: Contents
sysCtxList = 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
$ [Sentence] -> [ListType] -> ListType
bulletNested [Sentence]
sysCtxResp forall a b. (a -> b) -> a -> b
$
  forall a b. (a -> b) -> [a] -> [b]
map [Sentence] -> ListType
bulletFlat [[Sentence]
sysCtxUsrResp, [Sentence]
sysCtxSysResp]

-------------------------
--User Characteristics --
-------------------------

userCharacteristicsIntro :: Contents
userCharacteristicsIntro :: Contents
userCharacteristicsIntro = [Sentence] -> Contents
foldlSP
  [String -> Sentence
S String
"The", forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
endUser Sentence -> Sentence -> Sentence
`S.of_` forall c. Idea c => c -> Sentence
short CI
projectileTitle,
   String -> Sentence
S String
"should have an understanding of", 
   forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
highSchoolPhysics Sentence -> Sentence -> Sentence
`S.and_` forall n. NamedIdea n => n -> Sentence
phrase IdeaDict
highSchoolCalculus]

-------------------------
-- Problem Description --
-------------------------

-- The text for the problem description is the same as that of the purpose of
-- this example.

---------------------------------
-- Terminology and Definitions --
---------------------------------

terms :: [ConceptChunk]
terms :: [ConceptChunk]
terms = [ConceptChunk
launcher, ConceptChunk
projectile, ConceptChunk
target, ConceptChunk
gravity, ConceptChunk
cartesian, ConceptChunk
rectilinear]

---------------------------------
-- Physical System Description --
---------------------------------

physSystParts :: [Sentence]
physSystParts :: [Sentence]
physSystParts = forall a b. (a -> b) -> [a] -> [b]
map Sentence -> Sentence
(!.)
  [forall n. NounPhrase n => n -> Sentence
atStartNP (forall t. NamedIdea t => t -> NP
the ConceptChunk
launcher),
  forall n. NounPhrase n => n -> Sentence
atStartNP (forall t. NamedIdea t => t -> NP
the ConceptChunk
projectile) Sentence -> Sentence -> Sentence
+:+ Sentence -> Sentence
sParen (String -> Sentence
S String
"with" Sentence -> Sentence -> Sentence
+:+ forall a. Quantity a => a -> Sentence
getTandS UnitalChunk
iVel Sentence -> Sentence -> Sentence
`S.and_` forall a. Quantity a => a -> Sentence
getTandS ConstrConcept
launAngle),
  forall n. NounPhrase n => n -> Sentence
atStartNP (forall t. NamedIdea t => t -> NP
the ConceptChunk
target)]

----------------------------------------------------
-- Various gathered data that should be automated --
----------------------------------------------------
symbols :: [QuantityDict]
symbols :: [QuantityDict]
symbols = forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw ConstQDef
gravitationalAccelConst forall a. a -> [a] -> [a]
: [QuantityDict]
unitalQuants forall a. [a] -> [a] -> [a]
++ forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [ConstQDef]
constants forall a. [a] -> [a] -> [a]
++
  forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [UnitalChunk
acceleration, UnitalChunk
constAccel, UnitalChunk
iPos, UnitalChunk
iSpeed, UnitalChunk
iVel, UnitalChunk
ixPos,
  UnitalChunk
iyPos, UnitalChunk
ixVel, UnitalChunk
iyVel, UnitalChunk
position, UnitalChunk
scalarPos, UnitalChunk
projPos, UnitalChunk
projSpeed, UnitalChunk
time, UnitalChunk
velocity, UnitalChunk
xAccel,
  UnitalChunk
xConstAccel, UnitalChunk
xPos, UnitalChunk
xVel, UnitalChunk
yAccel, UnitalChunk
yConstAccel, UnitalChunk
yPos, UnitalChunk
yVel]

constants :: [ConstQDef]
constants :: [ConstQDef]
constants = [ConstQDef
gravitationalAccelConst, ConstQDef
piConst, ConstQDef
tol]

inputs :: [QuantityDict]
inputs :: [QuantityDict]
inputs = forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [ConstrConcept
launSpeed, ConstrConcept
launAngle, ConstrConcept
targPos]

outputs :: [QuantityDict]
outputs :: [QuantityDict]
outputs = [QuantityDict
message, forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw ConstrConcept
offset, forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw ConstrConcept
flightDur]

unitalQuants :: [QuantityDict]
unitalQuants :: [QuantityDict]
unitalQuants = QuantityDict
message forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [ConstrConcept]
constrained

unitalIdeas :: [IdeaDict]
unitalIdeas :: [IdeaDict]
unitalIdeas = forall c. Idea c => c -> IdeaDict
nw QuantityDict
message forall a. a -> [a] -> [a]
: forall a b. (a -> b) -> [a] -> [b]
map forall c. Idea c => c -> IdeaDict
nw [ConstrConcept]
constrained

inConstraints :: [UncertQ]
inConstraints :: [UncertQ]
inConstraints = [UncertQ
launAngleUnc, UncertQ
launSpeedUnc, UncertQ
targPosUnc]

outConstraints :: [UncertQ]
outConstraints :: [UncertQ]
outConstraints = [UncertQ
landPosUnc, UncertQ
offsetUnc, UncertQ
flightDurUnc]

constrained :: [ConstrConcept]
constrained :: [ConstrConcept]
constrained = [ConstrConcept
flightDur, ConstrConcept
landPos, ConstrConcept
launAngle, ConstrConcept
launSpeed, ConstrConcept
offset, ConstrConcept
targPos]

acronyms :: [CI]
acronyms :: [CI]
acronyms = [CI
oneD, CI
twoD, CI
assumption, CI
dataDefn, CI
genDefn, CI
goalStmt, CI
inModel,
  CI
physSyst, CI
requirement, CI
Doc.srs, CI
refBy, CI
refName, CI
thModel, CI
typUnc]