-- | Defines concepts used in computing.
module Data.Drasil.Concepts.Computation where

import Language.Drasil (dcc, nc, cn', commonIdeaWithDict, Sentence,
  ConceptChunk, CI, IdeaDict, dccWDS)
import Language.Drasil.Chunk.Concept.NamedCombinators

import Data.Drasil.Concepts.Documentation (datum, input_, literacy, output_, 
  quantity, type_, value, variable)
import Data.Drasil.Concepts.Math (parameter)
import Data.Drasil.Domains (compScience)

algorithm, absTolerance, relTolerance:: ConceptChunk
algorithm :: ConceptChunk
algorithm = String -> NP -> String -> ConceptChunk
dcc String
"algorithm" (String -> NP
cn' String
"algorithm")
  String
"a series of steps to be followed in calculations and problem-solving operations"
absTolerance :: ConceptChunk
absTolerance = String -> NP -> String -> ConceptChunk
dcc String
"absTolerance"   (String -> NP
cn' String
"Absolute tolerance") String
"a fixed number that is used to make direct comparisons"
relTolerance :: ConceptChunk
relTolerance = String -> NP -> String -> ConceptChunk
dcc String
"relTolerance"   (String -> NP
cn' String
"Relative tolerance") String
" maximum amount of error that the user is willing to allow in the solution"

modCalcDesc :: Sentence -> ConceptChunk
modCalcDesc :: Sentence -> ConceptChunk
modCalcDesc = String -> NP -> Sentence -> ConceptChunk
dccWDS String
"modCalcDesc" (String -> NP
cn' String
"calculation")

-- | Collects all computing-related named chunks (not concept-level yet).
compcon :: [IdeaDict]
compcon :: [IdeaDict]
compcon = [IdeaDict
application, IdeaDict
computer, IdeaDict
structure, IdeaDict
dataStruct, IdeaDict
dataStruct', IdeaDict
dataType, IdeaDict
dataType', 
  IdeaDict
inDatum, IdeaDict
outDatum, IdeaDict
inParam, IdeaDict
inVar, IdeaDict
inValue, IdeaDict
inQty, IdeaDict
computerLiteracy, IdeaDict
computerApp]

application, computer, structure :: IdeaDict
os :: CI
------------------------------------------------------------------------------------
--  NC      |     |      id       |       term             |  abbreviation | domain
-------------------------------------------------------------------------------------s
application :: IdeaDict
application = String -> NP -> IdeaDict
nc   String
"application"      (String -> NP
cn' String
"application") 
computer :: IdeaDict
computer    = String -> NP -> IdeaDict
nc   String
"computer"         (String -> NP
cn' String
"computer") 
structure :: IdeaDict
structure   = String -> NP -> IdeaDict
nc   String
"structure"        (String -> NP
cn' String
"structure")         
os :: CI
os          = String -> NP -> String -> [IdeaDict] -> CI
commonIdeaWithDict String
"os" (String -> NP
cn' String
"operating system")    String
"OS"   [IdeaDict
compScience]


dataStruct, dataStruct', dataType, dataType', 
  inDatum, outDatum, inParam, inVar, inValue, inQty,
  computerLiteracy, computerApp :: IdeaDict

dataStruct :: IdeaDict
dataStruct       = IdeaDict -> IdeaDict -> IdeaDict
compoundNCPSPP IdeaDict
datum IdeaDict
structure
dataStruct' :: IdeaDict
dataStruct'      = IdeaDict -> IdeaDict -> IdeaDict
compoundNCPS IdeaDict
datum IdeaDict
structure
dataType :: IdeaDict
dataType         = IdeaDict -> IdeaDict -> IdeaDict
compoundNCPSPP IdeaDict
datum IdeaDict
type_
dataType' :: IdeaDict
dataType'        = IdeaDict -> IdeaDict -> IdeaDict
compoundNCPS IdeaDict
datum IdeaDict
type_
inDatum :: IdeaDict
inDatum          = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
input_ IdeaDict
datum
outDatum :: IdeaDict
outDatum         = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
output_ IdeaDict
datum
inParam :: IdeaDict
inParam          = IdeaDict -> ConceptChunk -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
input_ ConceptChunk
parameter
inVar :: IdeaDict
inVar            = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
input_ IdeaDict
variable
inValue :: IdeaDict
inValue          = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
input_ IdeaDict
value
inQty :: IdeaDict
inQty            = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
input_ IdeaDict
quantity
computerLiteracy :: IdeaDict
computerLiteracy = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
computer IdeaDict
literacy
computerApp :: IdeaDict
computerApp      = IdeaDict -> IdeaDict -> IdeaDict
forall a b. (NamedIdea a, NamedIdea b) => a -> b -> IdeaDict
compoundNC IdeaDict
computer IdeaDict
application