Skip to content

Commit

Permalink
Merge pull request #618 from AmpersandTarski/development
Browse files Browse the repository at this point in the history
Release 3.8.1
  • Loading branch information
hanjoosten authored Jan 20, 2017
2 parents cccb062 + ad393de commit ed9a602
Show file tree
Hide file tree
Showing 92 changed files with 1,906 additions and 2,855 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ cabal.sandbox.config
StaticFiles_Generated.hs
BuildInfo_Generated.hs

# Visual studio code stuff
###################
/.vscode

# Compiled source #
###################
*.com
Expand Down
2 changes: 1 addition & 1 deletion AmpersandData/FormalAmpersand/ADLTool.adl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PURPOSE CONTEXT RAP IN ENGLISH LATEX
Its purpose is to provide a collaboration platform to groups of designers who work on Ampersand projects.
This document is a step on the way of specifying RAP.
It has largely been generated by the Ampersand toolset.
-}
+}


ENDCONTEXT
28 changes: 7 additions & 21 deletions AmpersandData/FormalAmpersand/AST.adl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CONTEXT RAP IN ENGLISH
CONTEXT RAP IN ENGLISH
--! It is allowed to change texts and/or the order of texts IF AND ONLY IF this is also done in the corresponding Haskell files !--
INCLUDE "Concepts.adl"
--INCLUDE "AST.ifc"
--INCLUDE "MinimalAST.xlsx" -- Contains minimal population. Anything discarded from it must break an invariant
--INCLUDE "MinimalAST.xlsx" -- Contains minimal population. Anything discarded from it must violate an invariant
INCLUDE "Contexts.adl"
INCLUDE "Relations.adl"
INCLUDE "Documentation.adl"
Expand All @@ -14,30 +15,15 @@ INCLUDE "Views.adl"
{-RJ/20150207: Opmerkingen n.a.v. een vluchtige code-inspectie van dit bestand
1) Het is nu nog wel, maar binnen RAP niet meer, mogelijk om een Pattern, Context en/of Concept dezelfde naam te geven (vanwege de INJectiviteit van relaties als name, ptnm). Deze nieuwe beperking lijkt me onwenselijk.
Reactie HJO/20150207: Die snap ik niet. Twee Concepten met dezelfde naam zijn hetzelfde Concept. Een Pattern mag dezelfde naam hebben als een Concept. Daarmee zijn de uiteraard niet identiek. Een Pattern is nou een maal geen Concept. Dit is nu zo geregeld in RAP. Als je punt is, dat twee verschillende Concepten best dezelfde naam zouden mogen hebben, dan hebben we een issue. Maar ik denk niet dat je dit bedoelt.
2) VIEWs (zoals 'VIEW Gen') horen m.i. niet in dit bestand thuis, maar daar waar de UI wordt gespecificeerd. IDENTs horen wel in dit bestand thuis.
2) VIEWs (zoals 'VIEW Isa') horen m.i. niet in dit bestand thuis, maar daar waar de UI wordt gespecificeerd. IDENTs horen wel in dit bestand thuis.
Reactie HJO/20150207: Helemaal mee eens. Gaan we doen.
3) Van "RELATION propertyRule[Relation*PropertyRule]" zou ik denken dat hij niet alleen INJ, maar ook SUR moet zijn.
Reactie HJO/20150207: Dat denk ik ook. Leuk is, dat dit geen invloed heeft op de meatgrinder. Immers, die zorgt alleen maar voor de juiste populatie van Relations. Als blijkt dat we dan overtredingen krijgen, dan gaan we dat meemaken...
-}

REPRESENT Purpose TYPE BIGALPHANUMERIC
REPRESENT Meaning TYPE BIGALPHANUMERIC
REPRESENT ConceptDefinition TYPE BIGALPHANUMERIC

PROCESS Plugs -- This pattern documents the semantics of plugs as of november 2014.
RELATION maintains[Plug*Rule]
RELATION in[Concept*Plug] --TODO: 'Nearly TOT: All concepts are in a plug, except ONE".
RELATION relsInPlug[Plug*Relation] --FIXME [SUR] -- Note: Declared relations only. This excludes I and V relations!

-- Rules
--ROLE Ampersand MAINTAINS "All isas in one plug"
RULE "All isas in one plug" : (-(genspc[Gen*Concept]~;gengen[Gen*Concept];in[Concept*Plug]) \/ in[Concept*Plug]) /\ (-(gengen[Gen*Concept]~;genspc[Gen*Concept];in[Concept*Plug]) \/ in[Concept*Plug])
MEANING "If a concept is stored in a plug, then every generalization of that concept is stored in the same plug."
ENDPROCESS

PATTERN ToDo -- This pattern contains stuff still to be done.
RELATION rrviols[Rule*Violation]
ENDPATTERN
--PATTERN ToDo -- This pattern contains stuff still to be done.
--RELATION rrviols[Rule*Violation]
--ENDPATTERN
ENDCONTEXT


3 changes: 2 additions & 1 deletion AmpersandData/FormalAmpersand/AST.docadl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ CONCEPT String "A string is a pString expected to be less than 256 characters."
--HJO20150420: Uitgezet: CONCEPT Conid "A conid is an identifier starting with an uppercase"
--HJO20150420: Uitgezet: CONCEPT Varid "A varid is an identifier starting with a lowercase"
--HJO20150420: Uitgezet: CONCEPT ADLid "An ADLid is an identifier of type pVarid <|> pConid <|> pString"
CONCEPT Gen "A gen, or generalization rule, is the is-a-relation between a more specific and a more generic concept."
CONCEPT Isa "An Isa, or generalization rule, represents an is-a-relation between two concepts, one of which we call specific and the other generic. It means that any atom of the specific concept is an atom of the generic concept as well."
CONCEPT IsE "An IsE, or generalization rule, is the is-relation between one concept, which is called specific, and other concepts which are called generic. It means that all atoms of the specific concepts are all atoms of the intersection set of the generic concepts. Note that if there is one generic concept, the IsE can be regarded as a synonym definition."
CONCEPT Signature "A signature is a pair of concepts, which are called source concept and target concept."
CONCEPT PropertyRule "A property rule is a rule, that is a property of a user-declared relation"
CONCEPT Property "UNI<|>TOT<|>INJ<|>SUR<|>RFX<|>IRF<|>SYM<|>ASY<|>TRN<|>PROP"
Expand Down
28 changes: 14 additions & 14 deletions AmpersandData/FormalAmpersand/AST.ifc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT "AST Interface" IN ENGLISH
CONTEXT "AST Interface" IN ENGLISH



Expand All @@ -16,23 +16,23 @@ INTERFACE "Context" FOR Ampersand : I[Context] TABS
]
, "Patterns" : context[Pattern*Context]~ BOX
[ "Pattern" : I INTERFACE Pattern]
, "Gens" : context[Concept*Context]~ ;
, "Isas" : context[Concept*Context]~ ;
(I[Concept] /\
gengen[Gen*Concept]~;gengen[Gen*Concept] /\
-(genspc[Gen*Concept]~;genspc[Gen*Concept])
) INTERFACE GenTree
gengen[Isa*Concept]~;gengen[Isa*Concept] /\
-(genspc[Isa*Concept]~;genspc[Isa*Concept])
) INTERFACE IsaTree
, "Concepts defined inside patterns" : context[Pattern*Context]~;concepts[Pattern*Concept]
, "Concepts defined outside patterns" : context[Concept*Context]~
, "Relations" : declaredIn[Relation*Context]~ LINKTO INTERFACE "Relation"
-- , "Roles" : allRoles[Context*Role]
-- , "allConjuncts" : allConjuncts[Context*Conjunct]
, "Rules" : allRules[Context*Rule] INTERFACE "Rule"
]
INTERFACE GenTree FOR Ampersand : I[Concept]
INTERFACE IsaTree FOR Ampersand : I[Concept]
BOX <ROWSNL>
[ concept : I[Concept] LINKTO INTERFACE Concept
, "is a" : genspc[Gen*Concept]~;gengen[Gen*Concept] LINKTO INTERFACE GenTree
, "Kinds" : gengen[Gen*Concept]~;genspc[Gen*Concept] LINKTO INTERFACE GenTree
, "is a" : genspc[Isa*Concept]~;gengen[Isa*Concept] LINKTO INTERFACE IsaTree
, "Kinds" : gengen[Isa*Concept]~;genspc[Isa*Concept] LINKTO INTERFACE IsaTree
]
INTERFACE Pattern FOR Ampersand : I[Pattern]
BOX [ Pattern : name[Pattern*PatternName] cRud
Expand Down Expand Up @@ -73,8 +73,8 @@ INTERFACE "Concept" FOR Ampersand : I[Concept] BOX
-- , ttype : ttype
, "source~" : source[Relation*Concept]~ LINKTO INTERFACE Relation
, "target~" : target[Relation*Concept]~ LINKTO INTERFACE Relation
, "gengen~" : gengen[Gen*Concept]~
, "genspc~" : genspc[Gen*Concept]~
, "gengen~" : gengen[Isa*Concept]~
, "genspc~" : genspc[Isa*Concept]~
-- , "rootConcept~" : rootConcept~
, "src of expression~" : src[Expression*Concept]~
, "tgt of expression~" : tgt[Expression*Concept]~
Expand Down Expand Up @@ -138,10 +138,10 @@ BOX [ "declaredthrough": declaredthrough[PropertyRule*Property]



INTERFACE Gen FOR Ampersand : I[Gen]
BOX [ "gens~" : gens[Context*Gen]~
, "gengen" : gengen[Gen*Concept]
, "genspc" : genspc[Gen*Concept]
INTERFACE Isa FOR Ampersand : I[Isa]
BOX [ "gens~" : gens[Context*Isa]~
, "gengen" : gengen[Isa*Concept]
, "genspc" : genspc[Isa*Concept]
]

INTERFACE Relation FOR Ampersand : I[Relation]
Expand Down
30 changes: 27 additions & 3 deletions AmpersandData/FormalAmpersand/Concepts.adl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT AST IN ENGLISH
CONTEXT AST IN ENGLISH

PATTERN Concepts
RELATION name[Concept*ConceptName] [UNI,TOT,SUR]
Expand All @@ -19,13 +19,37 @@ VIEW Concept: Concept(name[Concept*ConceptName])

-- RULE "Identifiability of concepts": name[Concept*ConceptName];name[Concept*ConceptName]~ |- I[Concept]

PATTERN Specialization
-- VIEW Isa: Isa( TXT "CLASSIFY ", genspc;name{-[Concept*ConceptName]-} , TXT " ISA " , gengen;name{-[Concept*ConceptName]-} )
-- RULE "eq gen": gengen;gengen~ /\ genspc;genspc~ |- I
-- MEANING "Two generalization rules are identical when the specific concepts are identical and the generic concepts are identical."
-- HJO, 20160906: Disabled above rule and view, because a generalisation can currently have more than one generic concepts (CLASSIFY A IS B /\ C )
RELATION gengen[Isa*Concept] [UNI,TOT]
MEANING "A generalization rule refers to one or more generic concepts."
RELATION genspc[Isa*Concept] [UNI,TOT]
MEANING "A generalization rule refers to one or more specific concepts."
RELATION gengen[IsE*Concept] [TOT]
MEANING "A generalization rule refers to one or more generic concepts."
RELATION genspc[IsE*Concept] [UNI,TOT]
MEANING "A generalization rule refers to one or more specific concepts."

--PURPOSE RULE specialization
--{+Specialization has the consequence that an atom is not necessarily an instance of one concept only.
--If limes are citrus fruits, then every lime is not only lime but a citrus fruit as well.
---}
--RELATION instanceOf[Atom*Concept] [TOT]
--RULE specialization : instanceOf;genspc~;gengen |- instanceOf
--MEANING "Every instance of a specialized concept is an instance of the generic concept too."

ENDPATTERN

PROCESS "Compute Closures"
RELATION isa[Concept*Concept] [IRF,ASY]
MEANING "s isa g means that each element of concept s is defined to be an element of concept g as well."
RELATION isaStar[Concept*Concept] -- Transitive, reflexive closure of isa, aka isa*
MEANING "s isa g means that s is g or each element of concept s is an element of concept g as well."
MEANING "s isaStar g means that s is g or each element of concept s is an element of concept g as well."
RELATION isaPlus[Concept*Concept] -- Transitive closure of isa, aka isa+
MEANING "s isa g means that each element of concept s is an element of concept g as well."
MEANING "s isaPlus g means that each element of concept s is an element of concept g as well."

RELATION isaCopy[Concept*Concept] -- necessary only for calling the Transitive closure function.
ROLE ExecEngine MAINTAINS "Compute transitive closure of isa"
Expand Down
26 changes: 3 additions & 23 deletions AmpersandData/FormalAmpersand/Contexts.adl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT RAP IN ENGLISH
CONTEXT RAP IN ENGLISH
INCLUDE "Rules.adl"
INCLUDE "Relations.adl"
--! It is allowed to change texts and/or the order of texts IF AND ONLY IF this is also done in the corresponding Haskell files !--
Expand Down Expand Up @@ -40,7 +40,7 @@ PATTERN Context
RELATION name[Concept*ConceptName] [UNI,TOT]
MEANING "Every relation has a name by which it can be referenced within its Context(s)."
REPRESENT ConceptName TYPE ALPHANUMERIC
RELATION gens[Context*Gen]
RELATION gens[Context*Isa]
MEANING "The user-defined generalization rules in a context."
RELATION concepts[Pattern*Concept]
RELATION uses[Context*Pattern]
Expand All @@ -59,7 +59,7 @@ PATTERN Context
RELATION identityRules[Rule*Context] [UNI] -- ^ all identity rules the user has declared within this context. This contains all rules declared inside a context including the patterns it contains.
RELATION allRules[Context*Rule] [INJ] -- This contains all rules declared inside a context. This contains all rules declared inside a context including the patterns it contains.
MEANING "If a rule is declared anywhere in a context, that rule exists in that context. This is registered in the system."
RELATION context[Pattern*Context] [UNI] -- comes from patterns, which is defined in FSpec. This contains all patterns declared inside a context.
RELATION context[Pattern*Context] [UNI] -- comes from patterns, which is defined in FSpec. This contains all patterns declared inside a context.
MEANING "If a pattern is declared inside a context, this is registered in the system."

PURPOSE RULE "rule declared outside pattern"
Expand Down Expand Up @@ -199,26 +199,6 @@ PATTERN Patterns

ENDPATTERN

PATTERN Specialization
-- VIEW Gen: Gen( TXT "CLASSIFY ", genspc;name{-[Concept*ConceptName]-} , TXT " ISA " , gengen;name{-[Concept*ConceptName]-} )
-- RULE "eq gen": gengen;gengen~ /\ genspc;genspc~ |- I
-- MEANING "Two generalization rules are identical when the specific concepts are identical and the generic concepts are identical."
-- HJO, 20160906: Disabled above rule and view, because a generalisation can currently have more than one generic concepts (CLASSIFY A IS B /\ C )
RELATION gengen[Gen*Concept] [TOT]
MEANING "A generalization rule refers to one or more generic concepts."
RELATION genspc[Gen*Concept] [TOT]
MEANING "A generalization rule refers to one or more specific concepts."

--PURPOSE RULE specialization
--{+Specialization has the consequence that an atom is not necessarily an instance of one concept only.
--If limes are citrus fruits, then every lime is not only lime but a citrus fruit as well.
---}
--RELATION instanceOf[Atom*Concept] [TOT]
--RULE specialization : instanceOf;genspc~;gengen |- instanceOf
--MEANING "Every instance of a specialized concept is an instance of the generic concept too."

ENDPATTERN

ENDCONTEXT


8 changes: 4 additions & 4 deletions AmpersandData/FormalAmpersand/Contexts.ifc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ INTERFACE "Context" FOR Ampersand : I[Context] TABS
, "Patterns used" : uses[Context*Pattern] BOX
[ "Pattern" : I CRuD -- INTERFACE Pattern
]
, "Gens" : context[Concept*Context]~ ; (I[Concept]
, "Isas" : context[Concept*Context]~ ; (I[Concept]
/\
(gengen[Gen*Concept]~;gengen[Gen*Concept]) /\
( -(genspc[Gen*Concept]~;genspc[Gen*Concept])))
-- INTERFACE GenTree
(gengen[Isa*Concept]~;gengen[Isa*Concept]) /\
( -(genspc[Isa*Concept]~;genspc[Isa*Concept])))
-- INTERFACE IsaTree
, "Concepts" : context[Concept*Context]~
, "Relations" : declaredIn[Relation*Context]~ -- LINKTO INTERFACE "Relation"
BOX<SCOLS>
Expand Down
25 changes: 15 additions & 10 deletions AmpersandData/FormalAmpersand/Documentation.adl
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@ PURPOSE PATTERN Documentation
{+
+}
PATTERN Documentation
RELATION purpose[Pattern*Purpose] [INJ]
MEANING "The purposes of a pattern."
RELATION propertyRule[Relation*PropertyRule] [INJ,SUR]
MEANING "The properties of a relation."
REPRESENT ConceptDefinition TYPE BIGALPHANUMERIC

REPRESENT Purpose TYPE BIGALPHANUMERIC
REPRESENT Meaning TYPE BIGALPHANUMERIC

RELATION meaning[Rule*Meaning] -- e.g. 'bfOUprop[BusinessFunction] is antisymmetric'
MEANING "The meanings of a relation."
RELATION decmean[Relation * Meaning]
MEANING "The meanings of a relation."
RELATION purpose[Relation * Purpose] [INJ]
RELATION purpose[Pattern*Purpose]
MEANING "The purposes of a pattern."
RELATION purpose[Relation * Purpose]
MEANING "The purposes of a relation."
RELATION meaning[Rule * Meaning]
MEANING "The meanings of a rule."
RELATION purpose[Rule * Purpose] [INJ]
RELATION purpose[Rule * Purpose]
MEANING "The purposes of a rule."
RELATION purpose[Identity * Purpose] [INJ]
RELATION purpose[Identity * Purpose]
MEANING "The purposes of an identity."
RELATION purpose[View * Purpose] [INJ]
RELATION purpose[View * Purpose]
MEANING "The purposes of a view."
RELATION purpose[Concept * Purpose] [INJ]
RELATION purpose[Concept * Purpose]
MEANING "The purposes of a concept."
RELATION purpose[Interface * Purpose] [INJ]
RELATION purpose[Interface * Purpose]
MEANING "The purposes of an interface."
RELATION purpose[Context * Purpose] [{-This is currently *NOT* INJ, see issue https://github.com/AmpersandTarski/Ampersand/issues/46 -}]
MEANING "The purposes of a context."
Expand Down
5 changes: 3 additions & 2 deletions AmpersandData/FormalAmpersand/Expressions.adl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
CONTEXT AST IN ENGLISH LATEX
CONTEXT AST IN ENGLISH LATEX
-- The comments for this script can be found in Atoms.doc
INCLUDE "Concepts.adl"


PROCESS "Expression definitions"
RELATION context[Pattern*Context] -- copied from Contexts.adl
RELATION usedIn[Relation*Expression]
MEANING "The rule expressed in relation algebra."
RELATION src[Expression*Concept]
RELATION tgt[Expression*Concept]
RELATION bind[BindedRelation*Relation][UNI,TOT]
Expand Down
3 changes: 1 addition & 2 deletions AmpersandData/FormalAmpersand/Generics.adl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT Generics IN ENGLISH LATEX
CONTEXT Generics IN ENGLISH LATEX
PURPOSE CONTEXT Generics
{+This context specifies the administration that currrently is, and in future will have been, the contents of GENERICS.PHP+}

Expand All @@ -21,7 +21,6 @@ RELATION name[Rule*RuleID] [UNI,TOT,SUR] -- e.g. 'ASY bfOUprop::BusinessFunction
RELATION ruleAdl[Rule*Adl] [UNI,TOT] -- e.g. 'bfOUprop~ /\\ bfOUprop |- I[BusinessFunction]'
REPRESENT Adl TYPE HUGEALPHANUMERIC
RELATION origin[Rule*Origin] [TOT] -- e.g. 'line 367:10, file "C:\\\\Ampersand\\\\Workspace\\\\NRM\\\\NRM-BasicProcesses.adl"'
RELATION meaning[Rule*Meaning] -- e.g. 'bfOUprop[BusinessFunction] is antisymmetric'
RELATION message[Rule*Message] -- e.g. 'bfOUprop[BusinessFunction] is not antisymmetric'
RELATION srcConcept[Rule*Concept][UNI,TOT] -- e.g. 'BusinessFunction'
RELATION tgtConcept[Rule*Concept][UNI,TOT] -- e.g. 'BusinessFunction'
Expand Down
23 changes: 23 additions & 0 deletions AmpersandData/FormalAmpersand/Modules.adl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CONTEXT RAP IN ENGLISH



PATTERN Modules
CONCEPT Module "A module is a file that contains Ampersand source code."
RELATION filename[Module*FileName] [UNI]
MEANING "Every pattern that is stored in a file system has a FileName."
RELATION filepath[Module*FilePath] [UNI]
MEANING "Every pattern that is stored in a file system has a FilePath."
RELATION includes[Module*Module]
MEANING "Pattern A instantiates B means that all definitions from B are copied into A."
PURPOSE RELATION filename[Module*FileName]
{+ Patterns can be stored in a file system.
To identify a pattern as a file, it has a file name.
The file name follows the conventions of the file system in which the pattern resides.
+}
PURPOSE RELATION filepath[Pattern*FilePath]
{+ For working with file systems that support a folder hierarchy,
patterns can have a file path.
The file path follows the conventions of the file system in which the pattern resides.
+}
ENDCONTEXT
Loading

0 comments on commit ed9a602

Please sign in to comment.