Skip to content

Commit

Permalink
worked on getting past SSP when make is run for Label updates
Browse files Browse the repository at this point in the history
  • Loading branch information
niazim3 committed Jul 6, 2018
1 parent ac4bee5 commit 98c674c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 36 deletions.
21 changes: 11 additions & 10 deletions code/drasil-example/Drasil/SSP/Assumptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ newAssumptions :: [AssumpChunk]
newAssumptions = [newA1, newA2, newA3, newA4, newA5, newA6, newA7, newA8, newA9, newA10]

newA1, newA2, newA3, newA4, newA5, newA6, newA7, newA8, newA9, newA10 :: AssumpChunk
newA1 = assump "Slip-Surface-Concave" monotonicF "Slip-Surface-Concave"
newA2 = assump "Geo-Slope-Mat-Props-of-Soil-Inputs" slopeG "Geo-Slope-Mat-Props-of-Soil-Inputs"
newA3 = assump "Soil-Layer-Homogeneous" homogeneousL "Soil-Layer-Homogeneous"
newA4 = assump "Soil-Layers-Isotropic" isotropicP "Soil-Layers-Isotropic"
newA5 = assump "Interslice-Norm-Shear-Forces-Linear" linearS "Interslice-Norm-Shear-Forces-Linear"
newA6 = assump "Base-Norm-Shear-Forces-Linear-on-FS" linearF "Base-Norm-Shear-Forces-Linear-on-FS"
newA7 = assump "Stress-Strain-Curve-interslice-Linear" stressC "Stress-Strain-Curve-interslice-Linear"
newA8 = assump "Plane-Strain-Conditions" planeS "Plane-Strain-Conditions"
newA9 = assump "Effective-Norm-Stress-Large" largeN "Effective-Norm-Stress-Large"
newA10 = assump "Surface-Base-Slice-between-Interslice-Straight-Lines" straightS "Surface-Base-Slice-between-Interslice-Straight-Lines"
newA1 = assump "Slip-Surface-Concave" monotonicF (mkLabelRA'' "Slip-Surface-Concave")
newA2 = assump "Geo-Slope-Mat-Props-of-Soil-Inputs" slopeG (mkLabelRA'' "Geo-Slope-Mat-Props-of-Soil-Inputs")
newA3 = assump "Soil-Layer-Homogeneous" homogeneousL (mkLabelRA'' "Soil-Layer-Homogeneous")
newA4 = assump "Soil-Layers-Isotropic" isotropicP (mkLabelRA'' "Soil-Layers-Isotropic")
newA5 = assump "Interslice-Norm-Shear-Forces-Linear" linearS (mkLabelRA'' "Interslice-Norm-Shear-Forces-Linear")
newA6 = assump "Base-Norm-Shear-Forces-Linear-on-FS" linearF (mkLabelRA'' "Base-Norm-Shear-Forces-Linear-on-FS")
newA7 = assump "Stress-Strain-Curve-interslice-Linear" stressC (mkLabelRA'' "Stress-Strain-Curve-interslice-Linear")
newA8 = assump "Plane-Strain-Conditions" planeS (mkLabelRA'' "Plane-Strain-Conditions")
newA9 = assump "Effective-Norm-Stress-Large" largeN (mkLabelRA'' "Effective-Norm-Stress-Large")
newA10 = assump "Surface-Base-Slice-between-Interslice-Straight-Lines" straightS
(mkLabelRA'' "Surface-Base-Slice-between-Interslice-Straight-Lines")

sspAssumptions :: [Sentence]
sspAssumptions = [monotonicF, slopeG, homogeneousL, isotropicP,
Expand Down
4 changes: 2 additions & 2 deletions code/drasil-example/Drasil/SSP/DataDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ soilStiffnessEqn = (case_ [case1,case2])
-----------------

fixme1 :: QDefinition
fixme1 = ec ufixme1 (inxi intNormForce + inxiM1 intNormForce) (shortname' "ufixme1")
fixme1 = ec ufixme1 (inxi intNormForce + inxiM1 intNormForce) (mkLabelRA'' "ufixme1")

fixme2 :: QDefinition
fixme2 = ec ufixme2 (inxi watrForce + inxiM1 watrForce) (shortname' "ufixme2")
fixme2 = ec ufixme2 (inxi watrForce + inxiM1 watrForce) (mkLabelRA'' "ufixme2")

-----------------
-- Derivations --
Expand Down
20 changes: 11 additions & 9 deletions code/drasil-example/Drasil/SSP/GenDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sspGenDefs = [normForcEq, bsShrFEq, resShr, mobShr,
--
normForcEq :: RelationConcept
normForcEq = makeRC "normForcEq" (nounPhraseSP "normal force equilibrium")
nmFEq_desc nmFEq_rel
nmFEq_desc nmFEq_rel Nothing --label

nmFEq_rel :: Relation
nmFEq_rel = inxi totNrmForce $= eqlExpr cos sin
Expand All @@ -67,7 +67,7 @@ nmFEq_desc = foldlSent [S "For a", phrase slice, S "of", phrase mass,
--
bsShrFEq :: RelationConcept
bsShrFEq = makeRC "bsShrFEq" (nounPhraseSP "base shear force equilibrium")
bShFEq_desc bShFEq_rel
bShFEq_desc bShFEq_rel Nothing --label

bShFEq_rel :: Relation
bShFEq_rel = inxi mobShrI $= eqlExpr sin cos
Expand Down Expand Up @@ -95,7 +95,7 @@ shrResEqn = inxi nrmFSubWat * tan (inxi fricAngle) + inxi cohesion *

resShr :: RelationConcept
resShr = makeRC "resShr" (nounPhraseSP "resistive shear force")
resShr_desc resShr_rel
resShr_desc resShr_rel Nothing --label

resShr_rel :: Relation
resShr_rel = inxi shrResI $= shrResEqn
Expand All @@ -118,7 +118,8 @@ resShr_desc = foldlSent [S "The Mohr-Coulomb resistive shear strength of a",
--
mobShr :: RelationConcept
mobShr = makeRC "mobShr"
(nounPhraseSP "mobile shear force") mobShr_desc mobShr_rel
(nounPhraseSP "mobile shear force") mobShr_desc mobShr_rel
Nothing --label

mobShr_rel :: Relation
mobShr_rel = inxi mobShrI $= inxi shrResI / sy fs $= shrResEqn / sy fs
Expand All @@ -135,6 +136,7 @@ mobShr_desc = foldlSent [
normShrR :: RelationConcept
normShrR = makeRC "normShrR"
(nounPhraseSP "interslice normal/shear relationship") nmShrR_desc nmShrR_rel
Nothing --label

nmShrR_rel :: Relation
nmShrR_rel = sy intShrForce $= sy normToShear * sy scalFunc * sy intNormForce
Expand All @@ -155,7 +157,7 @@ nmShrR_desc = foldlSent [S "The", phrase assumption,
--
momentEql :: RelationConcept
momentEql = makeRC "momentEql" (nounPhraseSP "moment equilibrium")
momEql_desc momEql_rel
momEql_desc momEql_rel Nothing --label

momEql_rel :: Relation
momEql_rel = 0 $= momExpr (\ x y -> x -
Expand All @@ -176,7 +178,7 @@ momEql_desc = foldlSent [S "For a", phrase slice, S "of", phrase mass,
--
netForcex :: RelationConcept
netForcex = makeRC "netForce" (nounPhraseSP "net x-component force")
EmptyS fNetx_rel
EmptyS fNetx_rel Nothing --label

fNetx_rel :: Relation
fNetx_rel = inxi fx $= (negate $ inxi watrForceDif) -
Expand All @@ -187,7 +189,7 @@ fNetx_rel = inxi fx $= (negate $ inxi watrForceDif) -

netForcey :: RelationConcept
netForcey = makeRC "netForce" (nounPhraseSP "net y-component force")
fNet_desc fNety_rel
fNet_desc fNety_rel Nothing --label

fNety_rel :: Relation
fNety_rel = inxi fy $= (negate $ inxi slcWght) +
Expand Down Expand Up @@ -222,7 +224,7 @@ fNet_desc = foldlSent [S "These equations show the net sum of the",
--
hookesLaw2d :: RelationConcept
hookesLaw2d = makeRC "hookesLaw2d" (nounPhraseSP "Hooke's law 2D")
hooke2d_desc hooke2d_rel
hooke2d_desc hooke2d_rel Nothing --label

hooke2d_rel :: Relation
hooke2d_rel = vec2D (inxi genPressure) (inxi genPressure) $=
Expand Down Expand Up @@ -255,7 +257,7 @@ hooke2d_desc = foldlSent [
--
displVect :: RelationConcept
displVect = makeRC "displVect" (nounPhraseSP "displacement vectors")
disVec_desc disVec_rel
disVec_desc disVec_rel Nothing --label

disVec_rel :: Relation
disVec_rel = inxi rotatedDispl $= vec2D (inxi shrDispl) (inxi nrmDispl) $=
Expand Down
11 changes: 6 additions & 5 deletions code/drasil-example/Drasil/SSP/IMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sspIMods = [fctSfty, nrmShrFor, intsliceFs, forDisEqlb, rfemFoS, crtSlpId]

--
fctSfty :: RelationConcept
fctSfty = makeRC "fctSfty" factorOfSafety fcSfty_desc fcSfty_rel
fctSfty = makeRC "fctSfty" factorOfSafety fcSfty_desc fcSfty_rel Nothing --label

--FIXME: first shearRNoIntsl should have local index v, not i,
-- last occurence should have index n
Expand All @@ -73,7 +73,7 @@ fcSfty_desc = foldlSent [S "Equation for the", titleize fs `isThe` S "ratio",
--
nrmShrFor :: RelationConcept
nrmShrFor = makeRC "nrmShrFor" (nounPhraseSP "normal/shear force ratio")
nrmShrF_desc nrmShrF_rel
nrmShrF_desc nrmShrF_rel Nothing --label

nrmShrF_rel :: Relation
nrmShrF_rel = (sy normFunc) $= case_ [case1,case2,case3] $=
Expand Down Expand Up @@ -113,7 +113,7 @@ nrmShrF_desc = foldlSent [getES normToShear `isThe` S "magnitude ratio",
--
intsliceFs :: RelationConcept
intsliceFs = makeRC "intsliceFs" (nounPhraseSP "interslice forces")
sliceFs_desc sliceFs_rel
sliceFs_desc sliceFs_rel Nothing --label

sliceFs_rel :: Relation
sliceFs_rel = inxi intNormForce $= case_ [
Expand All @@ -136,6 +136,7 @@ sliceFs_desc = foldlSent [S "The value of the interslice normal force",
forDisEqlb :: RelationConcept
forDisEqlb = makeRC "forDisEqlb"
(nounPhraseSP "force displacement equilibrium") fDisEq_desc fDisEq_rel
Nothing --label

fDisEq_rel :: Relation --FIXME: split into two IMOD
fDisEq_rel = negate (inxi watrForceDif) - (sy earthqkLoadFctr)*(inxi slcWght) -
Expand Down Expand Up @@ -181,7 +182,7 @@ fDisEq_desc = foldlSent [
--
rfemFoS :: RelationConcept
rfemFoS = makeRC "rfemFoS" (nounPhraseSP "RFEM factor of safety")
rfemFoS_desc rfemFoS_rel
rfemFoS_desc rfemFoS_rel Nothing --label

rfemFoS_rel :: Relation
rfemFoS_rel = (inxi fsloc) $= fosFracLoc $= fosFracSum
Expand Down Expand Up @@ -211,7 +212,7 @@ rfemFoS_desc = foldlSent [
--
crtSlpId :: RelationConcept
crtSlpId = makeRC "crtSlpId" (nounPhraseSP "critical slip identification")
crtSlpId_desc crtSlpId_rel
crtSlpId_desc crtSlpId_rel Nothing --label

-- FIXME: horrible hack. This is short an argument... that was never defined!
crtSlpId_rel :: Relation
Expand Down
7 changes: 5 additions & 2 deletions code/drasil-example/Drasil/SSP/Requirements.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ readAndStore, generateCSS, testSlipSrf, prepareSlipS,

readAndStore = foldlSent [S "Read the", phrase input_,
S "file, and store the" +:+. plural datum, S "Necessary",
plural inDatum, S "summarized in", makeRef sspInputDataTable]
plural inDatum, S "summarized in", makeRef sspInputDataTableLC]

generateCSS = foldlSent [S "Generate potential", phrase crtSlpSrf :+:
S "'s for the", phrase input_, phrase slope]
Expand Down Expand Up @@ -65,4 +65,7 @@ displayGraph = foldlSent [S "Display the", phrase crtSlpSrf, S "and the",
------------------
sspInputDataTable :: Contents
sspInputDataTable = mkInputDatTb ([dqdWr coords] ++ map dqdWr sspInputs)
--FIXME: this has to be seperate since coords is a different type
--FIXME: this has to be seperate since coords is a different type

sspInputDataTableLC :: LabelledContent
sspInputDataTableLC = llcc "sspInputDataTable" (mkLabelRA'' "sspInputDataTable") sspInputDataTable
9 changes: 5 additions & 4 deletions code/drasil-example/Drasil/SSP/TMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sspTMods = [fs_rc, equilibrium, mcShrStrgth, effStress, hookesLaw]
--

fs_rc :: RelationConcept
fs_rc = makeRC "fs_rc" factorOfSafety fs_desc fs_rel
fs_rc = makeRC "fs_rc" factorOfSafety fs_desc fs_rel Nothing --label

fs_rel :: Relation
fs_rel = (sy fs) $= (sy shearRes) / (sy mobShear)
Expand All @@ -49,7 +49,7 @@ fs_desc = foldlSent [
--

equilibrium :: RelationConcept
equilibrium = makeRC "equilibrium" (nounPhraseSP "equilibrium") eq_desc eq_rel
equilibrium = makeRC "equilibrium" (nounPhraseSP "equilibrium") eq_desc eq_rel Nothing --label

-- FIXME: Atomic "i" is a hack. But we need to sum over something!
eq_rel :: Relation
Expand All @@ -67,7 +67,7 @@ eq_desc = foldlSent [S "For a body in static equilibrium, the net",
--
mcShrStrgth :: RelationConcept
mcShrStrgth = makeRC "mcShrStrgth" (nounPhraseSP "Mohr-Coulumb shear strength")
mcSS_desc mcSS_rel
mcSS_desc mcSS_rel Nothing --label

mcSS_rel :: Relation
mcSS_rel = (sy shrStress) $= ((sy normStress) * (tan (sy fricAngle)) + (sy cohesion))
Expand Down Expand Up @@ -95,7 +95,7 @@ mcSS_desc = foldlSent [S "For a", phrase soil, S "under", phrase stress,

effStress :: RelationConcept
effStress = makeRC "effStress"
(nounPhraseSP "effective stress") effS_desc effS_rel
(nounPhraseSP "effective stress") effS_desc effS_rel Nothing --label

effS_rel :: Relation
effS_rel = (sy normStress) $= (sy normStress) - (sy porePressure)
Expand All @@ -118,6 +118,7 @@ effS_desc = foldlSent [getES normStress, S "is the total", phrase stress,
hookesLaw :: RelationConcept
hookesLaw = makeRC "hookesLaw"
(nounPhraseSP "Hooke's law") hksLw_desc hksLw_rel
Nothing --label

hksLw_rel :: Relation
hksLw_rel = (sy genForce) $= (sy stffness) * (sy genDisplace)
Expand Down
5 changes: 2 additions & 3 deletions code/drasil-lang/Language/Drasil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ module Language.Drasil (
, HasReasVal(reasVal)
, ExprRelat(relat)
, HasDerivation(derivations)
, HasLabel(getLabel)
-- Chunk.VarChunk
, VarChunk, codeVC
, vc, implVar
Expand Down Expand Up @@ -145,7 +144,7 @@ module Language.Drasil (
-- Document
, Referable(..), Document(..), DType(..), Section(..), Contents(..)
, SecCons(..), ListType(..), ItemType(..), ListPair
, LabelledContent
, LabelledContent, llcc
, section, fig, figWithWidth, section''
, datadefn, reldefn
-- Reference
Expand Down Expand Up @@ -234,7 +233,7 @@ import Language.Drasil.Document (Document(..), DType(..)
, section, fig, figWithWidth, section''
, datadefn, reldefn
, ListPair
, LabelledContent)
, LabelledContent, llcc)
import Language.Drasil.Unicode -- all of it
import Language.Drasil.Development.UnitLang -- all of it
import Language.Drasil.Development.Unit -- all of it
Expand Down
2 changes: 1 addition & 1 deletion code/drasil-lang/drasil-lang.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: drasil-lang
Version: 0.1.8
Version: 0.1.9
Cabal-Version: >= 1.18
Author: Dan Szymczak, Steven Palmer, Jacques Carette, Spencer Smith
build-type: Simple
Expand Down

4 comments on commit 98c674c

@JacquesCarette
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the intent is that a bunch of labels be created as independent entities 'first', and then used in creating chunks, rather than inlining them.

@niazim3
Copy link
Collaborator Author

@niazim3 niazim3 commented on 98c674c Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, so a Labels.hs file should be made in both the Data folder (for labels that are common to all examples) and for each of the Example subfolders.

@niazim3
Copy link
Collaborator Author

@niazim3 niazim3 commented on 98c674c Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JacquesCarette Is it alright to inline them for now in this branch and divide up the task of making labels for each of the sections into the "label database" once this branch is merged?

@JacquesCarette
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't necessarily need to put them in a separate file, at least not all the time. But sometimes that will help with circular dependencies. Definitely a good idea for common labels.

It is fine to inline them for now.

Please sign in to comment.