-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Small steps to understanding System
Understanding the kinds of Systems that exist:
- Add a
SystemKindthat enumerates the kinds of systems we can build with Drasil. -- Draft implementation ofSystemKind. #4274 - Convert case studies that can produce code into
RunnableSoftware. - Use
SystemKinds enough such that we can close a few related tickets (mentioned in What is aSystem? #3260 (comment)) - Analyze what's left.
Helpful side-steps:
- Switch to using a smart constructor to forming
System. -- Use smart constructors forSystem#4296 - Instantiate
IdeaforSystem - Make record fields slightly less polymorphic (?).
- Switch to using lenses.
- Fix how
Drasil.System-related things are re-exported through not-drasil-systempackages.
Original Post:
Related code:
Drasil/code/drasil-sysinfo/lib/SysInfo/Drasil/SystemInformation.hs
Lines 37 to 66 in e4b3354
| -- | Data structure for holding all of the requisite information about a system | |
| -- to be used in artifact generation. | |
| data SystemInformation where | |
| --FIXME: | |
| --There should be a way to remove redundant "Quantity" constraint. | |
| -- I'm thinking for getting concepts that are also quantities, we could | |
| -- use a lookup of some sort from their internal (Drasil) ids. | |
| SI :: (CommonIdea a, Idea a, Idea b, HasName c, | |
| Quantity e, Eq e, MayHaveUnit e, Quantity f, MayHaveUnit f, Concept f, Eq f, | |
| Quantity h, MayHaveUnit h, Quantity i, MayHaveUnit i, | |
| HasUID j, Constrained j) => | |
| { _sys :: a | |
| , _kind :: b | |
| , _authors :: [c] | |
| , _purpose :: Purpose | |
| , _background :: Background | |
| , _quants :: [e] | |
| , _concepts :: [f] | |
| , _instModels :: [InstanceModel] | |
| , _datadefs :: [DataDefinition] | |
| , _configFiles :: [String] | |
| , _inputs :: [h] | |
| , _outputs :: [i] | |
| , _defSequence :: [Block SimpleQDef] | |
| , _constraints :: [j] --TODO: Add SymbolMap OR enough info to gen SymbolMap | |
| , _constants :: [ConstQDef] | |
| , _sysinfodb :: ChunkDB | |
| , _usedinfodb :: ChunkDB | |
| , refdb :: ReferenceDB | |
| } -> SystemInformation |
It's very difficult to pin down a definition of what SystemInformation is, and I'm hoping this ticket will help us understand it a bit. Let's go through the fields:
{ _sys :: aa "system" (?) has a common idea & idea,
continuing, an SI has:
, _kind :: ba kind/type, which is just an "idea",
, _authors :: [c]a list of authors, which should be extracted from some polymorphic type,
, _purpose :: Purposea Purpose,
, _background :: Backgrounda Background,
, _quants :: [e]quantity-like things that can be boiled down to quantities (Quantity e, Eq e, MayHaveUnit e,),
, _concepts :: [f]quantity-like things that can be boiled down to concepts?, (Quantity f, MayHaveUnit f, Concept f, Eq f)
, _instModels :: [InstanceModel]a list of instance models (this should likely be replaced with ChunkDB usage -- my problem! Oops!),
, _datadefs :: [DataDefinition]a list of data definitions (this should likely be replaced with ChunkDB usage too),
, _configFiles :: [String]a list of configuration files, provided as Strings?,
, _inputs :: [h]some list of things that can be boiled down to quantities (Quantity h, MayHaveUnit h),
, _outputs :: [i]some list of things that can be boiled down to quantities (Quantity i, MayHaveUnit i)
, _defSequence :: [Block SimpleQDef]I'm not fully sure what this is, but I would hope it is something that we could automatically pull from the composed instance models and data definitions?
, _constraints :: [j] --TODO: Add SymbolMap OR enough info to gen SymbolMapa list of "constraints", a list of things that have a UID and are "constrained" (HasUID j, Constrained j)
(is this another thing that should be moved to chunkdb usage?)
, _constants :: [ConstQDef]a list of constant quantitydicts,
(I think this another thing that should be moved to chunkdb usage?)
, _sysinfodb :: ChunkDBthe related "chunkdb",
, _usedinfodb :: ChunkDBsomething marked for deletion (#1661) some time in the future,
, refdb :: ReferenceDBa database of references (can likely be replaced with chunkdb usage + a bit of magic to sort citations per order of appearance in the SRS)
I think that simplifying the types on the fields in SystemInformation might help with pinning down a definition of what it is. Additionally, I think there are a few things we might want to try to remove, which will help us generally get closer to defining it, but I think we're getting closer 😄