Skip to content
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

Theory as an instance of the ExprRelat class? #891

Closed
niazim3 opened this issue Jul 16, 2018 · 30 comments
Closed

Theory as an instance of the ExprRelat class? #891

niazim3 opened this issue Jul 16, 2018 · 30 comments
Assignees
Labels
design Related to the current design of Drasil (not artifacts). help wanted High Priority

Comments

@niazim3
Copy link
Collaborator

niazim3 commented Jul 16, 2018

As I'm currently working through the errors that the shift from using Contents to LabelledContent is causing in the addLabels branch, I ran into the following error:

Drasil\GlassBR\Body.hs:172:24:
    • No instance for (ExprRelat TheoryModel)
        arising from a use of ‘relToQD’
    • In the first argument of ‘map’, namely ‘(relToQD gbSymbMap)’
      In the first argument of ‘(++)’, namely
        ‘(map (relToQD gbSymbMap) gbrTMods)’
      In the second argument of ‘(++)’, namely
        ‘(map (relToQD gbSymbMap) gbrTMods) ++ [wtntWithEqn, sdWithEqn]’

, where the code causing said error can be viewed at commit dab1afa and relToQD is defined as follows:

-- medium hacks ---
relToQD :: (ExprRelat c, HasShortName c, HasSymbolTable ctx) => ctx -> c -> QDefinition
relToQD sm r = convertRel sm (r ^. relat) (shortname r)
convertRel :: (HasSymbolTable ctx) => ctx -> Expr -> ShortName -> QDefinition
convertRel sm (BinaryOp Eq (C x) r) sn = ec (symbLookup x (sm ^. symbolTable)) r sn
convertRel _ _ _ = error "Conversion failed"
. Since TheoryModels are not instances of the class ExprRelat (please see Theory.hs here), the error above is being produced.


@szymczdm I had asked if TheoryChunk should be reworked to be built off of a RelationConcept like InstanceModel is in issue #695, and @JacquesCarette mentioned that it is good as is it is.
Do you have any suggestions on how to approach this issue?

I feel that I should also point out that the current implementation of TheoryModel shows quite a bit of duplication (see below from GlassBR/TMods.hs).

t1IsSafe :: TheoryModel
t1IsSafe = tm' (cw t1SafetyReq) 
  (tc' "isSafe" [qw is_safe1, qw prob_br, qw pb_tol] ([] :: [ConceptChunk])
  [] [TCon Invariant $ (sy is_safe1) $= (sy prob_br) $< (sy pb_tol)] [])
  (mkLabelRA'' "isSafeLabel") [t1descr]

t1SafetyReq :: RelationConcept
t1SafetyReq = makeRC "t1SafetyReq" (nounPhraseSP "Safety Requirement-1")
  t1descr ((sy is_safe1) $= (sy prob_br) $< (sy pb_tol)) Nothing--label

This issue is related to #628 and #387.

@niazim3 niazim3 added help wanted question design Related to the current design of Drasil (not artifacts). labels Jul 16, 2018
@niazim3 niazim3 changed the title Theory an an instance of the ExprRelat class? Theory as an instance of the ExprRelat class? Jul 16, 2018
@szymczdm
Copy link
Collaborator

The constructor for TheoryModel could likely be updated, but I think the real problem here is ExprRelat. It is a pretty big hack that should be removed eventually.

I need to figure out exactly why we need relToQD. It looks like it just wants a defining equation for a chunk, and to convert that to a QDefinition and that seems weird (other than Theories defining a number of QDefs). I'll need to look at this in more depth.

@niazim3
Copy link
Collaborator Author

niazim3 commented Jul 17, 2018

As of commit d788d4b, all examples (except GlassBR) are compiling with the use of LabelledContents and Labels. Since this was the case, I'm going to continue working on #695 (i.e. adding labels) with the Makefile on my machine removing all instances/calls for GlassBR.

Since adding labels was fairly high priority, I guess this issue also becomes somewhat of a high priority since the labels implementation cannot be merged into master until all examples are at least functioning.


Just to reiterate:
The original implementation of

(map (relToQD gbSymbMap) tModels {-[RelationConcept]-}) ++
causes the following error

Drasil\GlassBR\Body.hs:172:24:
• No instance for (HasLabel RelationConcept)
    arising from a use of ‘relToQD’
• In the first argument of ‘map’, namely ‘(relToQD gbSymbMap)’
  In the first argument of ‘(++)’, namely
    ‘(map (relToQD gbSymbMap) tmodels)’
  In the second argument of ‘(++)’, namely
    ‘(map (relToQD gbSymbMap) tmodels) ++ [wtntWithEqn, sdWithEqn]’

because RelationConcept has a Maybe Label instead of a Label

data RelationConcept = RC { _conc :: ConceptChunk
, _rel :: Relation
, _lbl :: Maybe Label
}
makeLenses ''RelationConcept
(see #695 (comment) for rationale).

On the other hand, attempting to replace the tmodels with a list of actual [TheoryModel] results in the error from the above comment.

And finally, removing the line causing issues altogether causes the following:

...
mkdir -p build/GlassBR
cd build/GlassBR && stack exec glassbr
glassbr.EXE: Cannot find path from inputs to outputs
CallStack (from HasCallStack):
  error, called at .\Language\Drasil\CodeSpec.hs:319:20 in drasil-code-0.1.3-Ark8BNkxRlr5tP8V1ppwu:Language.Drasil.CodeSpec
make: *** [glassbr_build] Error 1

.

@szymczdm
Copy link
Collaborator

Alright, I've taken a closer look and it's definitely the use of relToQD for code generation that is causing problems.

I think this is part of a larger problem that the code generation is based on an older version of Drasil than we are currently working with. It makes explicit use of the equat (QDefn only) and relat lenses.

We need to understand more of what exactly the code-gen side is trying to do with these definitions before we can solve the problem.

@JacquesCarette JacquesCarette self-assigned this Jul 23, 2018
@JacquesCarette
Copy link
Owner

I've added my name to this as well. Can't promise I'll be able to look at it on Monday/Tuesday, but it is rather important to figure this out. I've played around with this before, and it is a little tricky. Now is as good a time as any to figure out how to unravel the problems here.

@niazim3
Copy link
Collaborator Author

niazim3 commented Jul 31, 2018

With the referencing infrastructure almost complete in the addLabels branch, this issue is still high priority. @szymczdm @JacquesCarette

@niazim3
Copy link
Collaborator Author

niazim3 commented Jul 31, 2018

Just noting here that the field that's causing errors at the moment (_definitions) eventually will be removed (as evident in the following FIXME comment:

, _definitions :: [QDefinition] --FIXME: will be removed upon migration to use of [DataDefinition] below
, _datadefs :: [DataDefinition]
).

@JacquesCarette
Copy link
Owner

Added to my list of things to do today.

@JacquesCarette
Copy link
Owner

ExprRelat

JacquesCarette added a commit that referenced this issue Aug 1, 2018
…f, but may result in more relToQD being removed, so that the issue may become less important.
@JacquesCarette
Copy link
Owner

This certainly does not fix the big problem in this issue, but it does fix the symptom. Now, the fix may not be fully adequate [this doesn't pull all the definitions from the theory model], but it has the right 'flavour'. One problem seems to be that commenting out the one line of code (that gave rise to this issue) doesn't seem to actually change anything in the output of GlassBR. So I can't quite tell if this 'fix' is sufficient to fully unblock.

The issue should not be closed quite yet. I am not sure that #628 captures everything that actually needs fixed.

@niazim3
Copy link
Collaborator Author

niazim3 commented Aug 1, 2018

I actually still get the error message from CodeSpec.hs

mkdir -p build/GlassBR
cd build/GlassBR && stack exec glassbr
glassbr.EXE: Cannot find path from inputs to outputs
CallStack (from HasCallStack):
  error, called at .\Language\Drasil\CodeSpec.hs:319:20 in drasil-code-0.1.3-Ark8BNkxRlr5tP8V1ppwu:Language.Drasil.CodeSpec
make: *** [glassbr_build] Error 1

.
Can this perhaps be fixed with removing the definitions_ field from SystemInformation (and anywhere else QDefinitions are used in CodeSpec.hs) as mentioned in the comment below?

, _definitions :: [QDefinition] --FIXME: will be removed upon migration to use of [DataDefinition] below
, _datadefs :: [DataDefinition]
)


I've been looking into this error for a while now:

error is defined in getExecOrder

getExecOrder :: HasSymbolTable ctx => [Def] -> [Known] -> [Need] -> ctx -> [Def]
getExecOrder d k' n' sm = getExecOrder' [] d k' (n' \\ k')
where getExecOrder' ord _ _ [] = ord
getExecOrder' ord defs' k n =
let new = filter ((`subsetOf` k) . flip (codevars') sm . codeEquat) defs'
cnew = map codevar new
kNew = k ++ cnew
nNew = n \\ cnew
in if null new
then error "Cannot find path from inputs to outputs"
else getExecOrder' (ord ++ new) (defs' \\ new) kNew nNew

which is called in CodeSpec here

execOrder = getExecOrder rels (allInputs ++ map codevar const') outs' db,

where outs' for GlassBR is

image

and db for GlassBR is

image

and rels is a combined list of GlassBR's QDefinitions and DataDefinitions.

@JacquesCarette @szymczdm Is there a method you suggest to fixing this error?

Edit: Is this error better as a new issue?

@JacquesCarette
Copy link
Owner

I think this error is a different issue. It is related to the current issue, but the fix will be different. I will look at this problem right now.

@JacquesCarette
Copy link
Owner

You are correct that the right fix is to migrate to using datadefs instead of definitions. However, this used to work, so there might be another bug. I'm investigating that.

@JacquesCarette
Copy link
Owner

Ok, some progress. By making the error message more informative, I now get

MacBook-Air-2:GlassBR carette$ stack exec glassbr
glassbr: Cannot find path from inputs to outputs: ["is_safePb","is_safeLR"] 
  given Defs as [] and 
  Knowns as ["plate_len","plate_width","standOffDist","char_weight","aspect_ratio","pb_tol",
    "tNT","glass_type","nom_thick","sdx","sdy","sdz","min_thick","loadDurFactor",
    "gTF","sflawParamM","sflawParamK","mod_elas","load_dur","loadDurFactor",
    "lShareFac","dim_max","dim_min","ar_max","cWeightMax","cWeightMin",
    "sd_max","sd_min","eqTNTWeight","sdf_tol","standOffDist","demand","tolLoad",
    "nFL","dimlessLoad","lResistance","stressDistFac","risk_fun","prob_br"]
CallStack (from HasCallStack):
  error, called at ./Language/Drasil/CodeSpec.hs:319:20 in drasil-code-0.1.3-GeRzK6TAC038pgEk2bVLJK:Language.Drasil.CodeSpec

So the problem is that the things we want to output have no known definitions! I think that this is because these used to be included in the definitions but now no longer are.

@JacquesCarette

This comment has been minimized.

@JacquesCarette
Copy link
Owner

@niazim3 question: does code generation for glassbr work on the master branch? If so, that would definitely help me debug what's going on here. Or if not on current master, when do I have to rewind to?

@szymczdm
Copy link
Collaborator

szymczdm commented Aug 2, 2018

@JacquesCarette master is still generating code for GlassBR as far as I can tell.

@JacquesCarette
Copy link
Owner

@szymczdm thanks. It is actually quite tricky how these have diverged. I've checked in more stuff in the addLabels branch to move this forward.

It basically used to work because things were built 'by hand' as it were. The theory models, as built, actually forget information (such as the definitions of exactly the 2 variables needed in GlassBR). The 'invariant' thing was a red herring. [It's weird, but is not the source of the problem.]

@samm82
Copy link
Collaborator

samm82 commented Aug 2, 2018

@JacquesCarette @szymczdm 5461058 seems to have fixed it - I added the missing quantities to the inputs in SystemInformation. Is this a viable solution for now?

@JacquesCarette
Copy link
Owner

Unfortunately not. Both quantities should be computed, and are in fact part of the output. I am fairly sure that if you add them to the input, the generated code will not be what we want [or at least, it shouldn't be; it could still be ok, but that might be because of further hacks].

@samm82
Copy link
Collaborator

samm82 commented Aug 3, 2018

@JacquesCarette The error message on my machine is

glassbr.EXE: Cannot find path from inputs to outputs: ["is_safePb","is_safeLR","prob_br"] 
  given Defs as ["risk_fun","stressDistFac","dimlessLoad"] and 
  Knowns as ["plate_len", "plate_width", "standOffDist", "char_weight", "aspect_ratio", "pb_tol", "tNT", 
     "glass_type", "nom_thick", "sdx", "sdy", "sdz", "min_thick", "loadDurFactor", "gTF", "sflawParamM", 
     "sflawParamK", "mod_elas", "load_dur", "loadDurFactor" , "lShareFac", "dim_max", "dim_min", 
     "ar_max", "cWeightMax", "cWeightMin", "sd_max", "sd_min", "sdf_tol", "tolLoad", "nFL"]

I just noticed our errors were different; not sure what the significance of this is.

@JacquesCarette
Copy link
Owner

Something else must have changed to have made those 3 items (instead of the previous 2) 'output's. But that's fine.

The problem is that those 3 outputs should also be in Knowns, because they are defined by formulas. That is the real issue to fix, to make sure those 3 formulas end up in Known. They used to be, but no longer are. You can see how (in master branch) tModel is added to what will eventually be Known; and in the addLabels branch, those equations are no longer added. That is the real source of the bug, as far as I can tell.

@samm82

This comment has been minimized.

@samm82
Copy link
Collaborator

samm82 commented Aug 7, 2018

Based on your comments, @JacquesCarette, I made a change in b85dbfb that I think fixed it. Can you take a look? It's a bit of a hack, but it could work for now.

@JacquesCarette
Copy link
Owner

Right, I'll comment on that issue.

JacquesCarette pushed a commit that referenced this issue Aug 8, 2018
* Work In Progress

* Changes to previous commit as discussed in comments within the commit

* W.I.P Update with Section as record type and removal of HasShortName instance of Contents

* W.I.P adjusted relToQD and convertRel to take Label

* reduced errors in Utils.hs; still breaking (see #695 for error message and potential solutions)

* added Maybe Label field to RelationConcept

* update RefFromType temporarily to be the same as makeRef

* started adding labels to get past errors resulting from missing Labels

* continued work on adding labels to example

* made makeRA' and makeRA'' constructors; updated more examples to not break

* added labels to SSP references

* fixed typos (whoops)

* worked on getting past SSP when make is run for Label updates

* broken; added LabelledContent as a SecCons; started to implement datCon as LabelledContent instead of Contents

* updated some definitions to be of correct types; inlined labelled will need to be pulled out

* continued updating Contents use to LablledContent use

* made Label an instance of Referable class to allow use of just labels for referencing (removes some uses of missingP hack)

* updated SSP for PSD as labelledcontents

* continued work on DataConstraints section update; fixed some typos; added a crucial(?) fixme as a reminder

* created Labels.hs file for SWHS to avoid import cycles created from attempt to inter-reference TM and IM (removes another hack)

* continued work on labels/referencing for SWHS; new issues will be opened soon with regard to Fixmes

* removed use of refFromType that was causing errors from expecting Contents to have a Label

* work on SWHS continued; some errors removed that resulted from previous merge

* updated traceGIntro to not include text that is not related to SRS content

* WIP: clearing errors from SWHS

* finally breaks outside of SWHS (with uncomment of horrible swhsIMods' hack)

* started work on NoPCM; will be pausing work on this branch until yuzhi branch is merged in

* removed redundant imports; fixing up implementation to break where it was breaking before merge of master into this branch; adding labels to SSP

* removed decrepit code from SSP body; cleaned up import lists; working on getting make to run past SWHS

* removed duplicate function from SWHS; make now breaks in GamePhysics

* GamePhysics Tmods and References updated for labels

* GamePhysics Imodels updated for labels

* shortened lines of code in GamePhysics Body

* updating NoPCM and SWHS for label updates

* continuing work on label integration; breaking in GlassBR

* removed definition of ref from GlassBR TMods

* continued work on GlassBR

* continued work on getting examples to run through use of LabelledContent instead of Contents

* replaced testing1 function use with that of gbrIMods for referencing purposes

* GlassBR broken due to TheoryModels and referencing infrastructure

* temporarily commented out line causing error in GlassBR; cleaned up imports; moving onto SSP example

* cleaned up NoPCM asssumptions; Examples compile

* worked on rendering labels; still need to view if implementation works

* general definition implementation updated for LabelledContent type instead of Contents

* cleaned up some examples; updated some functions for Label updates

* running make now gets to logs after GlassBR is completely commented out in makefile

* removed appearance of fixmelabel0 in all logs; hardcoded missing "Table:" so that logs reduce slightly

* created DataDefinitions for HGHC example; no more occurrences of "fixmelabel4" in logs

* updated Tiny stable for changes made in previous commit

* updated Assumptions section to expect [LabelledContent] instead of [Contents]; need to determine why lay is being used instead of lay prime

* removed find' and acroTest

* reset makefile to not have commented out code

* updated examples for change made to assumpF; "fixmelabel8" no longer shows up in logs

* dataDefnF now expects [LabelledContent] instead of [Contents]; attempting to determine how to remove presence of "fixmelabel3" from logs

* removed hardcoded "LC"s as discussed in previous commit comment discussions; made IOrgSec accept a label instead of a section for referencing; removed accidentally added wreq.png file

* merge issue321 branch into addLabels

* removed errors and warnings so that original errors show up

* updated accessContents definitions as suggested

* started use of HasMaybeLabel instead of HasLabel for LabelledContent; broken

* made updates in files (some makeRef -> makeRefSec)

* updated definition of ModRow to use LabelledContent instead of Contents; mkIMField updated for these changes

* finished updated functions for new ModRow definition; occurrences of "fixmelabel3" in logs has reduced

* makefile revert

* updated inModel section generation to use LabelledContents; further reduces appearance of "fixmelabel3" in logs

* removed all appearances of "fixmelabel3" in logs

* removed missingP hack; relates to #374

* Fix the bug in symbol collecting.

* fixing errors that resulted from mrege; currently breaking in GlassBR

* GlassBR updated for merged implementation; working on compiling SWHS successfully

* multiple fixmes and some obsolete code removed from SWHS; SWHS now compiles; working on NoPCM

* NoPCM fixed; few fixmes worked on; working on Tiny example

* tiny example compiles; moving onto fixing SSP

* SSP example compiles; working on GamePhysics updates

* examples now compile

* removed datadefn from Drasil

* updated stable to be the same as it was before the merge of PR #962; removed some mkEmptyLabels from implementation

* small implementation fixes suggested in pr #962

* removed some mkEmptyLabel instances

* W.I.P. correcting generated

* removed some more mkEmptyLabel instances from implementation

* mkEmptyLabel removed from reldefn

* [Small PR] Improved GlassBR Code (#965)

* Moved functional_requirements_req6_pulledList as per #902

* Changed underscores in function names to camelCase in Body

* Changed is_safe1 and is_safe2 to is_safePb and is_safeLR

* removed a series of warnings in Drasil

* Attempt at assumption referencing in Chipmunk and make Glass compile

* replaced some empty labels with an UnlabelledContent where appropriate

* removed enumitem from stable that was accidentally reinserted (originally removed in PR #958)

* Creating mkRawLC to append prefixes to labels

* Finished mkRawLC

* removed decrepit RefAdd fields from RawContents

* fixed error; replaced one more instance of mkEmptyLabel

* Implementing mkRawLC for LikelyChanges

* Update stable?

* Removed '_Label' from labels in SWHS

* updated tiny stable equation labels, removed another mkEmptyLabel

* made labels of sections not have the same refadd and shortname; reduces "Sec:"-related discrepancies in the logs; reintroduced repUnd hack since its removal was causing unrelated discrepancies

* updated definition of ddefn' and mkRawLC; tiny log now empty

* updated Definitions.hs to use mkRawLC more; updated intro in CP to match that of manual version

* updated stable GamePhysics Assumptions to remove redundant 'A's in labels of some assumptions

* updated labels in TMods and IMods for GamePhysics to match stable

* slightly cleaned up implementation of mkRawLC

* Fixed Chipmunk Assumption links

* updated stable SSP netforce labels to match generated; fixed error from merge and removed some duplication from chipmunk

* W.I.P. reintroducing repUnd

* displays updated in stable to the desired output as mentioned in #970

* more updates in stable SSP for changes in label display

* reduced discrepancies in SSP_log

* Reduced Chipmunk log significantly

* Removed space in stable

* trivial updates to NoPCM SRS

* some trivial updates to stable; removal of the use of UID for labels for Requirement and Change LabelledContents

* Fix the symptom of #891. It does not fix the issue of ExprRelat itself, but may result in more relToQD being removed, so that the issue may become less important.

* updated stable for trivial updates in NoPCM stable

* Finished emptying Chipmunk log

* Updated SSP stable with equation labels

* more trivial updates to stable for NoPCM

* removed reldefn from Drasil completely; insuccessfully attempted to run GlassBR

* 1. improve error message for when things fail. 2. add defined_fun to definition too, just in case.

* Fixing SWSW log

* Make RelationConcept have a full Label (this is a bit of a hack, but since RelationConcept is likely to disappear, not so bad). Propagate this change throughout the code and the examples. Still not quite right, but it feels closer.

* some comments as to next steps

* cleaned up implementation of mkRawLC by creating setLabel function; implemented a function's use from makeRef; removes discrepancies occurring from underscores that were not being replaced with periods upon makeRef use

* removed refAdd field from Goal and PSD

* moved DType and makePairs for use in shortname setting hack; removed Data, Data', Theory that were causing import cycles with move (#926)

* implemented extra space after some shortname acronyms as mentioned in #970; logs need cleaning

* Corrected melfFrac issue in SWHS

* Updated Chipmunk stable

* Updated SSP stable

* Updated NoPCM stable except for 'Sec:' issue

* Generating different prefixes for Functional/Non-Functional requirements

* no longer exports lbl field for Goal or PhysSystDesc

* NoPCM stable updated for trivial fixes; refaddresses now no longer depend on UIDs of chunks for refaddresses

* minor typo fix

* Correcting SWHS log

* GlassBR compiles - updated Makefile and added missing quantities to gbInputs

* added RefType as a field to Label; feels like a very roundabout and messy implementation that I'd like some feedback on before propagating changes to remaining chunks

* Started clearing GlassBR log

* Fixed trivial diffs in GlassBR log

* label constructor created for AssumpChunk Labels; generated HTML list of assumptions currently has prepended A: that was asked about in issue #970

* SWHS log fixed

* reverted changes that caused A: to be appended to the shortname upon creation of label; fixed typo in NoPCM

* replaced mkLabelRA'' with mkLabelSame as suggested

* Updating stable for NoPCM log

* NoPCM stable update

* Completed NoPCM stable update

* implemented newer design implementation; <<loop>> error is back; looking into it

* replaced mkLabelRA'' with mkLabelSame as suggested

* implemented newer design implementation; <<loop>> error is back; looking into it

* Fix #961 loop issue (again). This had a different cause

* Remove tab characters and fix whitespace

* updated package version numbers and dependencies; working on logs

* removed obsolete mkLabelRA

* removed duplicate tags that were being printed with some refaddresses; continue to clear log

* removed unitToEmptyS function accidentally added

* workaround for traceability infrmation in reference addresses

* shortnames displayed with acronyms and spaces when appropriate (#970)

* GlassBR DDs' shortnames now appear in traceability matrices

* trivial updates made to stable versions of examples

* GlassBR now generates

* Fixed some referencing in SWHS and NoPCM

* Removed warnings

* R6 in glassbr now displayed in output; has a working link to it as well

* Removed warnings

* added reftype as a field to Label as a hack; clears logs; ready for merge to master

* Fixed GlassBR inputs hack

* Minor updates to Makefile
@JacquesCarette
Copy link
Owner

More progress on this (in a branch to be merged). _definition is gone. relToQD is gone too. ExprRelat is still around, but not used in a crucial way. As soon as that branch is merged, this can be marked as fixed.

@samm82
Copy link
Collaborator

samm82 commented May 21, 2019

@JacquesCarette Has the branch been merged in? relToQD is still used in the TMods of GlassBR, so I think there's still some more work to do here.

lrIsSafe :: TheoryModel
lrIsSafe = tm (cw lrIsSafeRC)
[qw isSafeLR, qw lRe, qw demand] ([] :: [ConceptChunk])
[relToQD locSymbMap lrIsSafeRC] [(sy isSafeLR) $= (sy lRe) $> (sy demand)] [] [makeCite astm2009]
"isSafeLR" [lrIsSafeDesc]
where locSymbMap = cdb (thisSymbols) ([] :: [IdeaDict]) glassBRsymb
([] :: [UnitDefn]) Map.empty Map.empty [] [] [] [] []
[] []
lrIsSafeRC :: RelationConcept
lrIsSafeRC = makeRC "safetyReqLR" (nounPhraseSP "Safety Req-LR")
lrIsSafeDesc ( (sy isSafeLR) $= (sy lRe) $> (sy demand))

pbIsSafe :: TheoryModel
pbIsSafe = tm (cw pbIsSafeRC)
[qw isSafePb, qw probBr, qw pbTol] ([] :: [ConceptChunk])
[relToQD locSymbMap pbIsSafeRC] [(sy isSafePb) $= (sy probBr) $< (sy pbTol)] [] [makeCite astm2009]
"isSafePb" [pbIsSafeDesc]
where locSymbMap = cdb (thisSymbols) ([] :: [IdeaDict]) glassBRsymb
([] :: [UnitDefn]) Map.empty Map.empty [] [] [] [] []
[] []
pbIsSafeRC :: RelationConcept
pbIsSafeRC = makeRC "safetyReqPb" (nounPhraseSP "Safety Req-Pb")
pbIsSafeDesc ((sy isSafePb) $= (sy probBr) $< (sy pbTol))

@JacquesCarette
Copy link
Owner

It has not. I will have to re-do that work, as that branch is now very stale. I'm hoping to get to it soon.

@JacquesCarette
Copy link
Owner

I don't think there is anything specific to do to take care of this issue beyond what is already being done. In fact, a close reading of the issue makes me think that it is actually already fixed.

@balacij
Copy link
Collaborator

balacij commented Jun 15, 2021

I agree. I don't think we would need to add an ExprRelat instance for TheoryModel -- the Theory class gives much of what we want from TheoryModel nicely as is. Additionally, relToQD is already removed, the _definitions list in SystemInformation is replaced with a list of InstanceModels (which we use to get QDs, and hopefully eventually get the DE solvable methods from), and the QDs for everything else (DataDefinitions) are generated nicely.

Are we missing anything else? Do we perhaps want to change the definition of EquationalModels from EquationalModel QDefinition into EquationalModel DataDefinition?

@JacquesCarette
Copy link
Owner

I think you're right. And EquationModel can stay as QDefinition until we get a compelling reason to change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Related to the current design of Drasil (not artifacts). help wanted High Priority
Projects
None yet
Development

No branches or pull requests

5 participants