-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Design] De-embedding ALUR and Friends #562
Comments
A lot of this is great. But you'll need to do another pass, as there are a few misconceptions, which then leads in a weird direction. Without further ado:
|
Well, there go all the nicely formatted comments I was writing up. |
I'm sure some of them make different points! |
Only thing I have to add to @JacquesCarette's comments is that the FormattedNumeric list is a great idea, but if we're not keeping track (somehow) of which number gets assigned to which assumption, ref, etc. we lose some of the traceability. This can be easily remedied (as mentioned below), but it requires that we can differentiate the meanings of these chunks (ex. is it a Functional requirement or assumption?) If you look at the RefDB stuff, you'll see that the assumptions, requirements, etc. are currently stored as pairs that keep track of the chunk and its numeric identifier. Then we can always have the option of creating references that look like "See A1 for more details" or "SomeActualAssumption for more details". Also, the current implementation is by no means great, since (I believe) it's got an implicit ordering that must be used for creating both the refDB entry and the associated list. So, for example, if we had: ourAssumps = [a1, a2, a3] then we need to explicitly pass |
Thanks both of you for the feedback. I was hoping to have something more concrete worked out by now, but I haven’t traced through everything or worked out all the details just yet, so this is more informal rather than an update to the original proposal (for the time being). Thought I’d post an update so if there’s any issue I can correct course before I finish working out all the details. With the feedback and the introduction of data ReferableChunk =
{ id: String
, body :: Sentence
, labeluid: String
, semuid: String
}
At the moment, I haven’t fully worked out what belongs in These I also liked @szymczdm suggestion of automating the refDB entry as well to help ensure consistency. assumps = [assump1, assump2, ...]
assumpgroup = group (ChunkSemantics ...) assumps
All feedback is welcome. |
Thinking of this as a We desperately need to introduce a So the above makes me think of In other words, I think an assumption could be "just" a referable So I think this discussion bring out the following things that need done (first!):
|
Thanks for the feedback. I’m going to add myself to the assignees of this issue and start working on those first steps mentioned now. I’ll also work to update the proposal accordingly. |
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
…the implementation of UID. (Comment 6, Bullet 1, Issue #562)
Edited June 27th 2018 to be more accurate based on what was discussed during the Drasil meeting on June 26th, 2018 Preface: Prior to the below proposal, Now that most of the infrastructure is present to build
Replacing
|
Read this. Digesting it. Will hopefully comment on it later today. |
@JacquesCarette Comment 8 updated. |
Yes, I think this is close enough to start implementing. Certainly the parts having to do with As far as replacing Main things:
|
Yes, I think so. |
* Added drasil.lang.cabal * Branched drasil-code from drasil-lang and removed both from drasil * Split drasil into -example and -data and fixed information of -code * Moved cabal files to appropriate directories * Fixed parse errors * Changed drasil to drasil-code * Moved Language.Drasil.Code.Imperative.Import from drasil-code to -lang * Moved .cabal from build to code and changed file paths in drasil-data.cabal * Undid file path modification and moved files around to preserve module names * Moved /Code files and reworked /Expr/Extract and /DataDesc as per #558 * Reworked .cabal files and module name to facilitate DataDesc move in 1d75a42 as per #558 * Changed type of RefName from Sentence to String (#553) * started update of RefName type; stuck on Title as a Sentence mismatch * Added noSpaces as requested in 73d16d3 comments * added another field specifically for shortname for the section datatype (as discussed in issue #551); Example files broken * Re-added ShortName.hs (oops) * make runs fine; removed some warnings wrt redundant imports; logs no longer empty * hack closes #551 * Added RefAff to Language.Drasil to specify type signature of section' * Formatting and removing Rationale in this branch * Removed D Derivation from Attribute.hs as per issue #537 (#556) * Removed Warnings in Make (#557) * Removed redundancies and unused variables * Removed unused code and renamed shadowed bindings * Reverted changes on ufixme1 and ufixme2 * Started to remove and replace acroDD in SSP (#540) * Started to remove and replace acroDD in SSP * Reverted back to detailed import lists * Moved re-usable Expr functions into BasicExprs.hs * transferred re-usaeable Expr functions into BasicExprs.hs * Moved re-useable Expr functions into BasicExprs.hs * Added BasicExprs.hs to drasil.cabal * Re-did replacement of acroDD with less redundancy * Removed the defintion of acroDD from Data/Drasil/SentenceStructure * Updated stable to matches changes brought about the replacement of acroDD * Moved ShortName.hs to correct place after merge with master * Moved Chunk/Code * Resolved some issues with move of Chunk/Code * Fixed erroneous merge changes * Correct file path to DataDesc in import statement * Moved CodeSpec and Generate - now breaks in Drasil.hs (#558) * Removed wrong imports from Language.Drasil and 'fixed' Code.Imperative.Lang * Removed Language.Drasil.Code.Imperative.Lang * Removed Language.Drasil.Code.Imperative.Lang imports * Improved imports in SWHS/Body.hs * Change instances of String to UID to make progress towards obscuring the implementation of UID. (Comment 6, Bullet 1, Issue #562) * Change DefnAndDomain from a recursive (when used) definition to one which only stores UID. * Add lookup function for definition table. * Improved imports in SWHS/DataDefs.hs * Improved imports in SWHS/GenDefs.hs * Improved imports for Sections/Intorduction.hs * Import game phys (#601) * added specific import statements in GamePhysics/Body * alphabetized list of imports and ensured make runs * Improved imports in SSP/Requirements.hs, TMods.hs, and Unitals.hs (#600) * Alphabetized imports of Requirements.hs * Alphabetized and specified imports of TMods.hs * Alphabetized imports of Unitals.hs * Specified and alphabetized imports in Units.hs * Improved imports in Sections/AuxilaryConstants * Alphabetized both and specified GenDefs.hs * Improved imports in SPP/IMods.hs, Main.hs, and References.hs (#599) * Alphabetized and specified imports of IMods.hs * Alphabetized Main.hs * Alphabetized References.hs * Improved import Sections/GeneralSystDesc (#598) * Improved imports in SSP/DataDefs.hs and Defs.hs (#595) * Specified and alphabetized imports in DataDefs.hs and added a type definition * Alphabetized imports for Defs.hs * Improved imports in SSP/Assumptions.hs, BasicExprs.hs, and Body.hs (#594) * Alphabetize imports for Assumptions.hs * Alphabetize imports for BasicExprs.hs * Specify and alphabetize imports for Body.hs * Improved imports in SWHS/IMods.hs * Improved import statments * Improved imports in NoPCM/Unitals * Improved imports in GlassBR/Main.hs, TMods.hs, and Unitals.hs (#592) * Alphabetized imports in Main.hs * Alphabetized imports in TMods.hs * Specified and alphabetized imports in Unitals.hs * Improved imports in GlassBR/ModuleDefs.hs, References.hs, and Symbols.hs (#590) * Alphabetized ModuleDefs.hs * Alphabetized References.hs * Specified and alphabetized imports in Symbols.hs * Specified and alphabetized imports * Imporved imports in NoPCM/Body.hs * Improved imports in NoPCM/IMods.hs * Improved imports in GlassBR/Concepts.hs, DataDefs.hs, and IMods.hs (#588) * Alphabetized Concepts.hs * Alphabetized DataDefs.hs * Specified and alphabetized imports in IMods.hs * Moved UID.hs and tried to add drasil-lang to dependencies of drasil-code * Made sure drasil-lang was installed and changed 'drasil' to 'drasil-lang' in cabal * drasil-code now works! (#558) * Started work on drasil-data * Reverted some changes - code breaks in Chunk/Code.hs because it can't find imports from Language.Drasil * Changed drasil-lang.cabal to update locations of Derivation, Reference, and ShortName * Reworked Language.Drasil and Chunk.Code to fix erroneous imports * Fixed import issue in Chunk.Code * Fixed import error in Code.DataDesc * Fixed import error in CodeSpec and formatting in NounPhrase * Removed commented out imports in Code.Code and CodeSpec * Fixed import errors in Imperative.Import * Fixed imports in Generate * Added package locations to stack.yaml of drasil-data * Commented out second uid lensing in mkDataDef and mkDataDef' * Fixed makefile so drasil-data works? * Updated stack.yaml to actually find Data package * Moved Language.Drasil to drasil-lang * Moved Language.Drasil.Code to drasil-code * Moved Data.Drasil to drasil-data * Started creating drasil-dev - Breaks in Language.Drasil.Spec (needs drasil-dev?) * Implemented Language.Drasil.Development * Created Language.Drasil.Development * Finished manual merge * Moved Label.Core * Moved Label.Core * Removed import from Expr.Extract from merge * Formatting * Updated version number to 0.1.0 * Added compoundPhraseP1 and compoundNCP1 as per #558 comments; getting a variable not in scope error * Undid commenting out (cncpt ^. uid) - apparently it's needed? * Added compoundNCPlPh and compoundNCPlPl to fix Concepts/Computation * Removed old comments from SI_Units * Reverted file path change in generated code * Reverted file path change in stable * Reverting resource path for troubleshooting * Restoring resource path for troubleshooting * Moved noSpaces to Utils (#558) * Specified imports of Sentence (#558) * Specified Utils module and added Utils to cabal (#558) * Moved noSpaces from Utils to Misc * Updated lts-resolver * Added build_exam to Makefile - getting 'Unknown package: drasil-example' * Update package building, example does not compile (but does begin building!) * Added drasil-data dependency to drasil-example; started fixing issues * added filler data to modelTraceTable function to avoid type mismatch errors in TraceabilityMatrix.hs * Fixed error in SRS.hs * Hiding Vector from Language.Drasil (Ambiguous) * Fixed merge of master * Fixed Mod and Func not in scope? * Trying to import CodeSpec into HGHC/HGHC.hs * Cleaned up make a bit - shadowing and imports * Fixed codeSpec import * Added stack clean in all dirs to make clean * HGHC now compiles * SWHS now compiles * Updated Makefile as per comments on b350622 * Specified import in HGHC * Removed redundant imports * NoPCM compiles and finished SWHS * Removed redundant imports * SSP now compiles * Added drasil-code to dependencies of all examples * GamePhysics now compiles * Fixed redundant import and imports in SWHS\Generate * Fixed GlassBR ModuleDefs * Finished fixing GlassBR ModuleDefs * Fixed GlassBR Symbols * Fixed redundent import in Glass IMods * Fixed GlassBR Body * Added missing imports * Removed redundant imports * Added spaces to fix parse error - Travis CI build should pass now? * Added type definition for ddRef * Bumped version number * Removed comment that broke haddock * Improved import list in CodeSpec.hs
Yesterday during the Drasil meeting, @szymczdm and I talked about adding referencing to individual items in enumerations. We concluded that |
This commit is incomplete and will be amended. This commit translates the functional requirements in NoPCM to ones using ConceptInstance. The previous version of the requirements are still present for use with SWHS but should be removed once the dependency is no longer present. Two slight modifications have been performed to the requirements. 1. The table for requirement one has been moved to after the table and wording in requirement one has been tweaked to reflect that. A combination of limitations has led to this being needed at the moment. Paragraph is not referable so using paragraphs instead of an enum at the moment would mean the traceability matrix would not be able to reference individual requirements. LabelledContent has not been stabilized yet, so it is not an option. And Enums only allow Sentences for their body. 2. The equation for requirement two has been inlined into the Sentence. In addition to the above rational for the table, equations can be displayed by EqnBlock, however, EqnBlock does not contain a visual caption for the equation, and the RefAdd which can be passed in to the EqnBlock constructor is silently dropped in LayoutObj. View #562 for a visual comparison of the old and new requirements. TODO: - Add prefix to shortname based on the immediate parent node (ie. “FR:<Some Req>” instead of “<Some Req>” - Undo table being external? - Undo inline equation (Req 2 with fixme) - Update stable [ci: skip]
Commit 62939f7 contains a demo of Below are screenshots comparing the HTML output of the old requirements and the new NewOld |
I actually sort of prefer the New ordering of information. I definitely dislike that the reason it had to change is because of (hopefully temporary) weaknesses in the infrastructure. |
This commit translates the functional requirements in NoPCM to ones using ConceptInstance. The previous version of the requirements are still present for use with SWHS but should be removed once the dependency is no longer present. Two slight modifications have been performed to the requirements. 1. The table for requirement one has been moved to after the table and wording in requirement one has been tweaked to reflect that. A combination of limitations has led to this being needed at the moment. Paragraph is not referable so using paragraphs instead of an enum at the moment would mean the traceability matrix would not be able to reference individual requirements. LabelledContent has not been stabilized yet, so it is not an option. And Enums only allow Sentences for their body. 2. The equation for requirement two has been inlined into the Sentence. In addition to the above rational for the table, equations can be displayed by EqnBlock, however, EqnBlock does not contain a visual caption for the equation, and the RefAdd which can be passed in to the EqnBlock constructor is silently dropped in LayoutObj. View #562 for a visual comparison of the old and new requirements.
This commit translates the functional requirements in NoPCM to ones using ConceptInstance. The previous version of the requirements are still present for use with SWHS but should be removed once the dependency is no longer present. Two slight modifications have been performed to the requirements. 1. The table for requirement one has been moved to after the table and wording in requirement one has been tweaked to reflect that. A combination of limitations has led to this being needed at the moment. Paragraph is not referable so using paragraphs instead of an enum at the moment would mean the traceability matrix would not be able to reference individual requirements. LabelledContent has not been stabilized yet, so it is not an option. And Enums only allow Sentences for their body. 2. The equation for requirement two has been inlined into the Sentence. In addition to the above rational for the table, equations can be displayed by EqnBlock, however, EqnBlock does not contain a visual caption for the equation, and the RefAdd which can be passed in to the EqnBlock constructor is silently dropped in LayoutObj. View #562 for a visual comparison of the old and new requirements.
This commit translates the functional requirements in NoPCM to ones using ConceptInstance. The previous version of the requirements are still present for use with SWHS but should be removed once the dependency is no longer present. Two slight modifications have been performed to the requirements. 1. The table for requirement one has been moved to after the table and wording in requirement one has been tweaked to reflect that. A combination of limitations has led to this being needed at the moment. Paragraph is not referable so using paragraphs instead of an enum at the moment would mean the traceability matrix would not be able to reference individual requirements. LabelledContent has not been stabilized yet, so it is not an option. And Enums only allow Sentences for their body. 2. The equation for requirement two has been inlined into the Sentence. In addition to the above rational for the table, equations can be displayed by EqnBlock, however, EqnBlock does not contain a visual caption for the equation, and the RefAdd which can be passed in to the EqnBlock constructor is silently dropped in LayoutObj. View #562 for a visual comparison of the old and new requirements.
This commit translates the functional requirements in NoPCM to ones using ConceptInstance. The previous version of the requirements are still present for use with SWHS but should be removed once the dependency is no longer present. Two slight modifications have been performed to the requirements. 1. The table for requirement one has been moved to after the table and wording in requirement one has been tweaked to reflect that. A combination of limitations has led to this being needed at the moment. Paragraph is not referable so using paragraphs instead of an enum at the moment would mean the traceability matrix would not be able to reference individual requirements. LabelledContent has not been stabilized yet, so it is not an option. And Enums only allow Sentences for their body. 2. The equation for requirement two has been inlined into the Sentence. In addition to the above rational for the table, equations can be displayed by EqnBlock, however, EqnBlock does not contain a visual caption for the equation, and the RefAdd which can be passed in to the EqnBlock constructor is silently dropped in LayoutObj. View #562 for a visual comparison of the old and new requirements.
* Expose mkConCC and mkEnumCC from DocLang subpackage. * Use ConceptInstance in NoPCM for functional requirements. This commit translates the functional requirements in NoPCM to ones using ConceptInstance. The previous version of the requirements are still present for use with SWHS but should be removed once the dependency is no longer present. Two slight modifications have been performed to the requirements. 1. The table for requirement one has been moved to after the table and wording in requirement one has been tweaked to reflect that. A combination of limitations has led to this being needed at the moment. Paragraph is not referable so using paragraphs instead of an enum at the moment would mean the traceability matrix would not be able to reference individual requirements. LabelledContent has not been stabilized yet, so it is not an option. And Enums only allow Sentences for their body. 2. The equation for requirement two has been inlined into the Sentence. In addition to the above rational for the table, equations can be displayed by EqnBlock, however, EqnBlock does not contain a visual caption for the equation, and the RefAdd which can be passed in to the EqnBlock constructor is silently dropped in LayoutObj. View #562 for a visual comparison of the old and new requirements. * Fix list formatting in TeX backend to be consistent with output pre-mlref.
This is a small proposal to add support for prefixes to ProblemWhen Context
|
And apparently #470 as well |
This issue is getting ridiculously long. [Though it has lots of good stuff in it!] Maybe we should think of documenting the parts that still need to be done in new issues and close this one? It feels like the bulk of the work, not just the design, has been done and merged in. |
Agreed. Tracking what's remaining in #985. |
Rationale
Drasil knows too much about
AssumpChunk
,ReqChunk
, andChanges
. This propagates through most of the Language. This should be abstracted away.Existing Implementation
Introduction
This proposal is considering three different chunks:
AssumpChunk
,ReqChunk
, andChange
(Chunk), with primary design being driven byAssumpChunk
.AssumpChunk
DefinitionWhere
aid
becomes theuid
forHasUID
.assuming
is the assumption.refName
is used to allow "links" to the assumption.attribs
is used to store a list ofAttributes
. This field is going to be largely ignored in its current state because of its removal (#537), and insteadshortname
will be considered as that is allattribs
is used for in these chunks.shortname
is the displayed text that is hyperlinked in the resulting document.Similarities
Both
ReqChunk
andChange
contain similar fields asAssumpChunk
, however both add a "switch" to toggle functional/nonfunctional and likely/unlikely respectively.Field Uses
To make this cleaner, the "switch" fields are going to be ignored from
ReqChunk
andChanges
, and common names will be introduced for the remaining fields for the rest of this document.Fields
id
=aid
(AssumpChunk
),id
(ReqChunk
),id
(Changes
)body
=assuming
(AssumpChunk
),requires
(ReqChunk
),chng
(Changes
)refName
is named the same across all three.shortname
is an adaptation ofAttributes
across all three.High Level Use
id
is used both to implementHasUID
and equality of chunks.body
stores aSentence
which becomes the "body" of the generated output.refName
becomes the hyperlink the backends use to reference a given chunk. There are restrictions on this field as indicated by the comment in theAssumpChunk
definition above.shortname
becomes the text whichrefName
will hyperlink.Use Observations
AssumpChunk
id
andrefName
seem to always be instantiated to the same value.DocumentLanguage wraps
assump
asmkAssump
such thatrefName
andshortname
are instantiated to the same value (as of this commit).ReqChunk
id
is "some" unique value. (ex. req1, req2, ..., reqn)DocumentLanguage wraps
frc
constructor asmkRequirements
which makes therefName
field the same as theshortname
.Changes
id
is "some" unique value. (ex. likeChg1, likeChg2, ..., likeChgn)Document language wraps
lc
asmkLklyChnk
such thatshortname
andrefName
are the same value.Embedding Propagation
Where does this chunk embedding propagate to in the Language?
ReferenceDB
Each different chunk "type" (ie.
AssunpChunk
,ReqChunk
, andChanges
) becomes its own field inReferenceDB
.Document
Each one of the chunks has its own constructor in
Document
LayoutObj
The
ALUR
constructor forLayoutObj
is a hack and is how these chunks eventually end up being rendered.De-embedding Proposal
With all the uses enumerated, it is possible to see how the chunks are used and how these chunks can be de-embedded from the backend.
Backend Data Structure
Based on the three chunks, and how they're instantiated and used, a "new" generic chunk could be created as:
body
is carried over from the old chunks, and holds the bulk of the information associated with a requirement, assumption, change, or really any "list" item.sn
is theshortname
referred to above. Ifsn
isNothing
we will see how the hyperlink text is generated below.Where are
id
andrefName
?id
, as seen from the uses mentioned above, is not important in what its value is, only that it is unique. This could be auto-generated or derived fromshortname
(which I'm assuming is unique, please correct me if my analysis is wrong.)refName
this is an odd field as it is the same asshortname
but places restrictions on its value such that it is compatible for linking by the TeX and HTML backends. I believerefName
is a derivable value fromshortname
as well, and each backend should perform the transformation to an acceptable character set allowed for hyperlinks. It should not be the responsibility (or care) of the user that the field is an acceptable character set.Example Use
The examples as they exist, could be easily converted to use
ReferableChunk
with the existing information.Document Use
The simplest implementation is groups of
ReferableChunk
s are wrapped inEnumerations
withListType
Desc
.An even better implementation is to add a new
ListType
which is a hybrid betweenDesc
andNumeric
called something such asFormattedNumeric
.FormattedNumeric
with fieldsprefix :: String
andsuffix :: String
such that instantiation may look like (in Haskell-ish pseudocode):Enumeration (FormattedNumeric "A" "") ...
.Resulting in assumptions being formatted as
This would allow backends to use existing infrastructure for counting (and abstracting the need to explicitly count elements in the
Enumeration
as withDesc
) while being more complex than just a simple list and allowing formatting around the numeric value.This
FormattedNumeric
ListType
can also acts as ashortname
iffsn
isNothing
as long asEnumeration
are not directly used, but insteadDocument
gains a constructorRefChunkGroup [ReferableChunk] String String
instead. If this new constructor is used there would be an intermediate step so all chunks have theirshortname
known before separating them and transforming them into just anEnumeration
. This approach would allow for all ALUR type chunks to be reference-able by default and maintain a meaningful name regardless if one is specified.Backend Generation
This proposal aids in #541 as it largely removes the need for
ALUR
. Ideally theReferableChunk's are rendered using existing
LayoutObjinfrastructure. The only change to the backend, is performing an as-needed transformation on
shortname` into something that isImplementation Order
ReferableChunk
Document
and friends to handleReferableChunk
shortname
ofReferableChunk
ReferenceDB
to handleReferableChunk
Alternatives
shortname
if not explicitly given. Instead raise an error if it is referenced.This option was considered, however a lot of the caseStudies use reference labels such as
A1
which is something that can't be autogenerated in a reliable way.refName
inReferableChunk
but heavily restrict the character set. Make that theuid
instead ofshortname
.The reason this was not chosen was the hyperlink largely "doesn't matter". As long as it is unique for the generated document and a valid hyperlink.
shortname
implements uniqueness and the backend implements transformation to acceptable hyperlink (and a second uniqueness check on the transformedshortname
).Conclusion
This proposal seems to cover all aspects needed to de-embed ALUR chunks from Drasil while retaining and improving their functionality. While I have tried to be thorough with analyzing how ALUR components are embedded, used, and how they should be used (caseStudies), I may have missed something along the way that may affect this proposal.
As always any feedback, suggestions, or criticism on incorrect choices, bad design, or anything I've missed is welcome.
The text was updated successfully, but these errors were encountered: