9 |
10 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Parsing/shouldSucceed/Issue1537.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1537
2 |
3 |
4 | PATTERN CarGroups
5 | RELATION tier[CarGroup*Tier]
6 | REPRESENT Tier TYPE INTEGER
7 | POPULATION tier CONTAINS
8 | [ ("economy", 0)
9 | , ("compact", 1)
10 | ]
11 | ENDPATTERN
12 |
13 | REPRESENT Age TYPE INTEGER
14 | RELATION age[CarGroup*Age]
15 | POPULATION age CONTAINS
16 | [ ("economy", 0)
17 | , ("compact", 1)
18 | ]
19 |
20 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try18b.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test18
4 | RELATION r[X*Y]
5 | RELATION s[X*A]
6 | RELATION t[B*Y]
7 | RELATION t[Q*Y]
8 | RULE r = s;I[A];t
9 | RULE I[D] = I[A]/\I[B]
10 | ENDPATTERN
11 |
12 | ENDCONTEXT
13 |
14 | {-
15 | Purpose: This script is a more difficult version of try18.adl, as t cannot be matched to I[A] literally
16 | Result: PASS
17 |
18 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/InterfaceTest1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT InterfaceTest1 IN ENGLISH
2 |
3 | INTERFACE Identifier : I[BusinessActor]
4 | BOX[ name : name ]
5 |
6 | PATTERN Business
7 | RELATION name[BusinessActor*Identifier] [UNI]
8 | ENDPATTERN
9 |
10 | ENDCONTEXT
11 |
12 | {-
13 | Purpose: This script tests the mechanism of matching the source of an interface field to the target of the interface term.
14 | Result: PASS
15 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue194.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue194 IN DUTCH
2 | INCLUDE "Issue194.xlsx"
3 | CLASSIFY Auto ISA Voertuig
4 | RELATION eigenaar [Voertuig * Persoon] [UNI,TOT]
5 | RELATION aantalWielen [ Auto * Getal] [UNI,TOT]
6 |
7 | REPRESENT Getal TYPE INTEGER
8 |
9 | RULE ThisShouldHoldForTheGivenExcelSheet
10 | : (I[Voertuig] /\ eigenaar;"Piet";eigenaar~) |- aantalWielen;4;aantalWielen~
11 |
12 | ENDCONTEXT
13 |
14 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/validate/Issue865.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue865
2 |
3 | RELATION isSuccessorOf[Assignment*Assignment] [UNI,INJ,ASY] -- IRF,
4 |
5 | POPULATION isSuccessorOf CONTAINS [ ("Ass2", "Ass1") ]
6 | POPULATION isSuccessorOf CONTAINS [ ("Ass3", "Ass2"), ("aap","aap") ]
7 |
8 |
9 | ROLE Iemand MAINTAINS NietSuccessorVanZichzelf
10 | RULE NietSuccessorVanZichzelf : I[Assignment] |- -isSuccessorOf
11 |
12 | ENDCONTEXT
13 |
14 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/InterfaceTest4.adl:
--------------------------------------------------------------------------------
1 | CONTEXT InterfaceTest4 IN DUTCH
2 |
3 | PATTERN ProefMetView
4 |
5 | RELATION r[A*B] PRAGMA "" " is door " " ingevuld"
6 | VIEW A : A(TXT "(", I, TXT ",", r, TXT ")")
7 | ENDPATTERN
8 |
9 | POPULATION r CONTAINS [ ("Champagne","Hans") ; ("Champagne","Jan") ; ("Champagne","Piet")]
10 |
11 | INTERFACE Proefje : V[ONE*B]
12 | BOX [ B : I
13 | , "rechter element : " : r~
14 | ]
15 |
16 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Sentinel/Tests/NoSentinel/Issue1465Test.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1465Test IN DUTCH
2 | INCLUDE "Issue1465Test.xlsx"
3 | CLASSIFY Auto ISA Voertuig
4 | RELATION eigenaar [Voertuig * Persoon] [UNI,TOT]
5 | RELATION aantalWielen [ Auto * Getal] [UNI,TOT]
6 |
7 | REPRESENT Getal TYPE INTEGER
8 |
9 | ENDCONTEXT
10 |
11 | {* The purpose of this script is to show that the Excel importer (at least the one in Haskell) must be adapted
12 | because this test should succeed.
13 | *}
14 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/ArchiTest5.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ArchiTest5 IN ENGLISH
2 |
3 | PATTERN Business
4 | CLASSIFY BusinessCollaboration ISA BusinessRole
5 |
6 | RELATION comp[BusinessRole*BusinessCollaboration] PRAGMA "Business role " " is a component of Business collaboration ".
7 | RULE R001: comp |- (V[BusinessRole * BusinessRole]-I[BusinessRole]); comp
8 | MEANING "A business collaboration is composed of two or more business roles."
9 |
10 | ENDPATTERN
11 |
12 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Bug335_Kl0Kl1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Bug335Kl0Kl1 IN ENGLISH
2 |
3 | PATTERN SelectExprTest
4 | RELATION r[A*A]
5 | ENDPATTERN
6 |
7 | INTERFACE Overview : I[ONE]
8 | BOX [ as : V[ONE*A]
9 | BOX [ "id" : I
10 | ]
11 | ]
12 |
13 | INTERFACE Id : I[A]
14 | BOX [ "r*" : r*
15 | , "r+" : r+
16 | ]
17 |
18 | POPULATION r CONTAINS
19 | [ ("a", "a")
20 | ]
21 |
22 | ENDCONTEXT
23 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Parsing/xlsxParsing/Issue1056.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1056
2 |
3 | -- This test is about the parsing of multiple atoms in a single cell
4 | INCLUDE "Issue1056.xlsx"
5 |
6 | REPRESENT A,B TYPE ALPHANUMERIC
7 | RELATION r[A * B] [TOT]
8 | POPULATION r CONTAINS [ ("a1", "b1")
9 | -- , ("a1", "b2") -- This is the additional pair that should be read from the .xlsx file
10 | ]
11 | RULE moreThanOne : r |- r;-I[B]
12 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/InvariantViolations/showViolationMessages.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN DUTCH
2 | -- We're testing that violation messages are shown in the way specified in the user's script.
3 | -- For this purpose I added VIOLATION statements to this script.
4 |
5 | RELATION r[A * B]
6 |
7 | RULE TotalR : I |- r;r~
8 | VIOLATION (TXT "For atom ", SRC I, TXT " there is no B in relation r.")
9 |
10 | POPULATION "A" CONTAINS [ "Uiversum" ]
11 |
12 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/InterfaceTest1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT InterfaceTest1 IN ENGLISH
2 |
3 | INTERFACE Identifier : I[BusinessActor]
4 | BOX[ name : name~ ]
5 |
6 | PATTERN Business
7 | RELATION name[BusinessActor*Identifier] [UNI]
8 | ENDPATTERN
9 |
10 | ENDCONTEXT
11 |
12 | {-
13 | Purpose: This script tests the mechanism of matching the source of an interface field to the target of the interface term.
14 | Result: PASS
15 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/ARM-Test12.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARMTest12 IN DUTCH
2 |
3 | RELATION bfGebruiktARM20DefProp[Bedrijfsfunctie*Bedrijfsfunctie] [PROP]
4 |
5 | ENDCONTEXT
6 |
7 | {- This script generates the following erro:
8 | prototype.exe: !fatal error 62 (module RelBinGenSQL, Prototype v2.2.1.2804 (lib: Ampersand v2.2.1.1242))
9 | Multiple plugs for relation RELATION bfGebruiktARM20DefProp [Bedrijfsfunctie*Bedrijfsfunctie] Nothing PRAGMA "" "" ""
10 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue1261.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1261
2 | -- This script generates SQL for a singleton in a term. In such case, single quotes should be used.
3 | -- This can be verified (manually :( ) in conjuncts.json. Search for 'god'. (Aren't we all?)
4 |
5 | -- For system bootstrapping purposes, we need a "God"-account that has all permissions/roles.
6 | POPULATION Account CONTAINS [ "god" ]
7 |
8 | RULE godRule: "god"[Account]
9 |
10 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Try38.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try38 IN ENGLISH
2 | PATTERN Try38
3 |
4 | RELATION property[C*C] [PROP]
5 |
6 | ENDPATTERN
7 | ENDCONTEXT
8 |
9 | {-
10 | Purpose: This script is there to ensure that the following error will be fixed:
11 |
12 | ampersand.exe: !fatal 167 (module Output.ToPandoc.ChapterDataAnalysis) Ampersand v2.2.1.121
13 | This should have become an attribute of this Class!
14 |
15 | Result: PASS
16 | -}
--------------------------------------------------------------------------------
/miscellaneous/Berichten/lib/header.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
Rechtspraak
9 |
10 |
Release ID: 1.1RC02
11 |
Date: 2011-11-25
12 |
13 |
14 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Bugs/Fixed/SQL/Bug_SingletonExpression.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Bugs IN ENGLISH
2 |
3 | RELATION rel[A*B] []
4 | = [ ("a1", "b1"); ("a1", "b2"); ("a2", "b1"); ("a2", "b2")]
5 |
6 | INTERFACE Accounts : V[ONE*B]
7 | BOX [ bug : "b1" ]
8 |
9 | PATTERN Bugs
10 | ROLE tester MAINTAINS singletonBug1, singletonBug2
11 | RULE singletonBug1 : "b1"[B] -- fixed: yields b1b1
12 | RULE singletonBug2 : rel; "b1" -- fixed: yields a1b1 a2b1
13 | ENDPATTERN
14 |
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/Check/ShouldFail/Issue298.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue298 IN DUTCH
2 |
3 | {- This scipt should fail to produce a prototype.
4 | "thisShouldFail" is not in Even and is not in Odd.
5 | -}
6 | RULE ruleOne : I[Natural] |- I[Even] \/ I[Odd]
7 | CLASSIFY Even ISA Natural
8 | CLASSIFY Odd ISA Natural
9 |
10 | POPULATION Natural CONTAINS ["thisShouldFail" , "one" , "two"]
11 | POPULATION Even CONTAINS ["two"]
12 | POPULATION Odd CONTAINS ["one"]
13 |
14 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue192.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue192 IN DUTCH
2 |
3 | INCLUDE "Issue192.xlsx"
4 |
5 | CLASSIFY Auto ISA Voertuig
6 |
7 | RELATION eigenaar [Voertuig * Persoon] [UNI,TOT]
8 | RELATION aantalWielen [ Auto * Aantal] [UNI,TOT]
9 |
10 | --POPULATION eigenaar[Auto*Persoon] CONTAINS
11 | -- [ ("wagen1", "Piet")
12 | -- ]
13 | --POPULATION aantalWielen[Auto*Aantal] CONTAINS
14 | -- [ ( "wagen1", "vier")]
15 |
16 | ENDCONTEXT
17 |
18 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try20.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try20 IN ENGLISH
2 | PATTERN Try20
3 |
4 | RELATION orderedBy[Order*Client]
5 | RELATION orderReceived[Order*Client]
6 | RELATION orderAccepted[Order*Client]
7 |
8 | RULE allReceived: orderedBy |- (orderReceived \/ orderAccepted)
9 | MEANING "All accepted orders have been received"
10 |
11 | ENDPATTERN
12 |
13 | ENDCONTEXT
14 |
15 | {-
16 | Purpose: This file tests the union \/
17 | Desired Result: PASS
18 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try15.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test15
4 | RELATION r[A*A]
5 | RELATION r[B*C]
6 | RULE Test:r[A*A] = r\/I
7 | ENDPATTERN
8 |
9 | ENDCONTEXT
10 |
11 | {-
12 | Purpose: to verify that the checker can deduce that r\/I::[A*A]
13 | Result: PASS
14 | Reason: Relation I takes its type from r,
15 | so the checker deduces that I[A] is meant.
16 | By the way, this should work for r[A*A] = r/\I as well.
17 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try31.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try31 IN ENGLISH
2 |
3 | PATTERN Try31
4 | CLASSIFY Medewerker ISA Persoon
5 | CLASSIFY Student ISA Persoon
6 |
7 | RULE Try31: I[Persoon] - I[Student] |- I[Medewerker]
8 | MEANING "Een persoon die geen student is, is een medewerker"
9 | ENDPATTERN
10 |
11 | ENDCONTEXT
12 |
13 | {-
14 | Purpose: A test to see if the typechecker can handle multiple ISA relations with the same root concept.
15 | Result: PASS
16 |
17 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try9.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test9
4 | RELATION r[A*B]
5 | RULE r;V
6 | ENDPATTERN
7 |
8 | ENDCONTEXT
9 |
10 | {-
11 | Purpose: a superficial check whether type deduction works.
12 | Result: FAIL
13 | Reason: The target of V is ambiguous.
14 | Message:
15 | The pattern named "Test9" contains errors:
16 | line 5:8, file "try9.adl":
17 | The target of V is ambiguous.
18 |
19 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try11.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test1
4 | RELATION r[A*C]
5 | RELATION s[A*B]
6 | RELATION s[A*C]
7 | RELATION t[B*C]
8 | RELATION t[B*D]
9 | RULE Test : r = s;t
10 | ENDPATTERN
11 |
12 | ENDCONTEXT
13 |
14 | {-
15 | Purpose: This script is a simple correct script with = and ;
16 | A bit harder than try1, as both s and t must be matched together
17 | (Possibly easier than try7)
18 | Result: PASS
19 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try30.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try30 IN ENGLISH
2 |
3 | PATTERN Try30
4 | CLASSIFY Medewerker ISA Persoon
5 | CLASSIFY Student ISA Persoon
6 |
7 | RULE Try30: I[Persoon] |- I[Student] \/ I[Medewerker]
8 | MEANING "Een persoon is of een student of een medewerker (of beide)."
9 | ENDPATTERN
10 |
11 | ENDCONTEXT
12 |
13 | {-
14 | Purpose: A test to see if the typechecker can handle multiple ISA relations with the same root concept.
15 | Result: PASS
16 |
17 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/CyclicInterfaceRef.adl:
--------------------------------------------------------------------------------
1 | CONTEXT CyclicInterfaceRef IN ENGLISH
2 | -- Test context that should fail to compile because of cyclic interface references
3 |
4 | INTERFACE GrandParent : I[A]
5 | BOX[ label : V[A*B] INTERFACE Parent
6 | ]
7 |
8 | INTERFACE Parent : I[B]
9 | BOX[ label : V[B*C] INTERFACE Child
10 | ]
11 |
12 | INTERFACE Child : I[C]
13 | BOX[ label : V[C*A] INTERFACE GrandParent
14 | ]
15 |
16 | ENDCONTEXT
17 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try13.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test13
4 | RELATION r[A*A]
5 | -- r[B*C] -- enabled in try15.adl
6 | RULE Test: r[A*A] = r\/I
7 | ENDPATTERN
8 |
9 | ENDCONTEXT
10 |
11 | {-
12 | Purpose: to verify that the checker can deduce that r\/I::[A*A]
13 | Result: PASS
14 | Reason: Relation I takes its type from r,
15 | so the checker deduces that I[A] is meant.
16 | By the way, this should work for r[A*A] = r/\I as well.
17 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try18.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 | CLASSIFY A ISA AOrB
3 | CLASSIFY B ISA AOrB
4 |
5 | PATTERN Test18
6 | RELATION r[X*Y]
7 | RELATION s[X*A]
8 | RELATION t[B*Y]
9 | RELATION t[Q*Y]
10 | RULE Test : r = s;I[B];t
11 | CLASSIFY D IS A/\B
12 | -- was: RULE I[D] = I[A]/\I[B]
13 | ENDPATTERN
14 |
15 | ENDCONTEXT
16 |
17 | {-
18 | Purpose: This script was made a bit easier, this way it is possible to handle the script
19 | Result: PASS
20 |
21 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/ARM_Test10.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARM_Test10 IN DUTCH -- (project ARMisa)
2 | {- This script should produce a compiler error saying that
3 | the source of: critText [Criterium*Blob] does not match the type of the BOX, Gewetensvraag.
4 | -}
5 | RELATION critText[Criterium*Blob] [MAP]
6 | INTERFACE Gewetensvraag : I[Gewetensvraag]
7 | BOX[ gewetensvragen: I[Gewetensvraag]
8 | BOX[ gewetensvraag: I
9 | , criterium : critText
10 | ]
11 | ]
12 | ENDCONTEXT
13 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/phone.adl:
--------------------------------------------------------------------------------
1 | CONTEXT TypExample IN DUTCH
2 |
3 | RELATION reachableBy[Person*PhoneNumber]
4 | RELATION carrier[CellPhone*Person]
5 | RELATION number[Phone*PhoneNumber]
6 | RELATION carrier[PhoneNumber*NetworkProvider]
7 | RULE carrier~ ; number |- reachableBy
8 | CLASSIFY CellPhone ISA Phone
9 |
10 |
11 | {- Het spreekt voor zich dat de regel niet goed is getypeerd. Echter, ampersand versie 1072 klaagt hier niet over.... -}
12 |
13 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try37.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try37 IN ENGLISH
2 | CLASSIFY G ISA GOrEOrF
3 | CLASSIFY E ISA GOrEOrF
4 | CLASSIFY F ISA GOrEOrF
5 |
6 | PATTERN Try37
7 | CLASSIFY B IS G/\E
8 | CLASSIFY D IS B/\F
9 | CLASSIFY C ISA E
10 | ENDPATTERN
11 |
12 | CLASSIFY D ISA A
13 | CLASSIFY A ISA F
14 | CLASSIFY A ISA C
15 |
16 | ENDCONTEXT
17 |
18 | {-
19 | Purpose: This script is there to ensure that the ordering of concepts in the same kernel is handled
20 | Result: PASS
21 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try47.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try47 IN ENGLISH
2 |
3 | IDENT Context: ContextX(name[ContextX*ContextIdentifier])
4 | RELATION name[ContextX*ContextIdentifier] [UNI,TOT,INJ]
5 |
6 | IDENT Pattern: PatternX(name[PatternX*PatternIdentifier])
7 | RELATION name[PatternX*PatternIdentifier] [UNI,TOT,INJ]
8 |
9 | ENDCONTEXT
10 |
11 | {-
12 | Purpose: This script tests the mechanism of matching the source of an IDENT term to the Concept of the IDENT
13 | Result: PASS
14 | -}
15 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Check/ShouldFail/Issue1063.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1063 IN DUTCH
2 |
3 | {- This scipt should fail the standard check, because there are violations of an invariant.
4 | "thisShouldFail" is not in Even and is not in Odd.
5 | -}
6 | RULE ruleOne : I[Natural] |- I[Even] \/ I[Odd]
7 | CLASSIFY Even ISA Natural
8 | CLASSIFY Odd ISA Natural
9 |
10 | POPULATION Natural CONTAINS ["thisShouldFail" , "one" , "two"]
11 | POPULATION Even CONTAINS ["two"]
12 | POPULATION Odd CONTAINS ["one"]
13 |
14 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try4.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test4
4 | RELATION r[X*Y]
5 | RELATION s[X*A]
6 | RELATION t[B*Y]
7 | CLASSIFY B ISA E
8 | CLASSIFY A ISA E
9 | CLASSIFY D ISA B
10 | CLASSIFY D ISA A
11 | RULE r = s;t
12 | ENDPATTERN
13 |
14 | ENDCONTEXT
15 |
16 | {-
17 | Purpose: This script demonstrates how NOT to specify an intersection type between A and B.
18 | Result: FAIL
19 | Reason: the intersection between A and B exists as concept D
20 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try3.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test3
4 | RELATION r[X*Y]
5 | RELATION s[X*A]
6 | RELATION t[B*Y]
7 | RULE Test: r = s;t
8 | CLASSIFY D IS A/\B
9 | CLASSIFY A ISA AOrB
10 | CLASSIFY B ISA AOrB
11 | ENDPATTERN
12 |
13 | ENDCONTEXT
14 |
15 | {-
16 | Purpose: This script shows that a type conflict (between A and B) can be resolved
17 | by defining an intersection type D.
18 | Result: PASS
19 | Reason: the type on ; is inferred as I[D]
20 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/FraakTest1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT FraakTest1 IN ENGLISH
2 |
3 | PATTERN HandleBookings
4 |
5 | RELATION status[Booking*Status] [UNI] PRAGMA "A " " can have a certain status".
6 |
7 | ROLE FacilityDesk MAINTAINS acceptedCancelledOrRejectedBookings
8 |
9 | RULE acceptedCancelledOrRejectedBookings: I |- (status;("Accepted"\/"Cancelled"\/"Rejected");status~)
10 | MESSAGE "All bookings must be accepted, cancelled or rejected"
11 | VIOLATION (SRC I)
12 |
13 | ENDPATTERN
14 |
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/MultipleDeclaredRules.adl:
--------------------------------------------------------------------------------
1 | CONTEXT MultipleDeclaredRules IN ENGLISH
2 | {-
3 | The purpose of this testcase is to verify that it is possible to declare the same relation multiple times.
4 | There is also a propertyrule created because of the UNI. Hence, a (property)rule can be declared in more than a single place.
5 | -}
6 |
7 | RELATION r[A*B][UNI]
8 | PATTERN Foo
9 | RELATION r[A*B][UNI]
10 | ENDPATTERN
11 |
12 | PATTERN Bar
13 | RELATION r[A*B][UNI]
14 | ENDPATTERN
15 |
16 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/Check/ShouldFail/EnforceTest1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT EnforceTest1 IN DUTCH
2 |
3 |
4 | --CLASSIFY NPForm, NPReg ISA NatuurlijkPersoon
5 | --CLASSIFY NatuurlijkPersoon ISA Person
6 | --CLASSIFY Voornaam ISA FirstName
7 | REPRESENT FirstName TYPE ALPHANUMERIC
8 |
9 | RELATION npRoepnaam[NatuurlijkPersoon*Voornaam] [UNI]
10 | RELATION personFirstName[Person*FirstName]
11 |
12 | ENFORCE personFirstName := I[NPReg];npRoepnaam
13 |
14 | -- This test should fail, because the relation npRoepnaam[NPReg*???] is not defined.
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/FuncSpec/Issue1275.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1275
2 |
3 | PATTERN Foo
4 | RELATION r[A*B]
5 | ENDPATTERN
6 |
7 | PATTERN Foo
8 | RELATION s[A*B]
9 | ENDPATTERN
10 |
11 | ENDCONTEXT
12 | {- SJ 2022-02-08
13 | This test demonstrates that duplicate pattern names are allowed. The intended semantics is that there is just one pattern named Foo and the contents of that pattern is the union of the two patterns in the script:
14 | ```
15 | PATTERN Foo
16 | RELATION r[A*B]
17 | RELATION s[A*B]
18 | ENDPATTERN
19 | ```
20 | -}
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Comment / error /typo in the documentation
3 | about: Any suggestion on improving documentation
4 | title: ''
5 | labels: 'status: needs triage'
6 | assignees: ''
7 | ---
8 |
9 |
10 |
11 | # What is the page that your suggestion is about?
12 |
13 | # What Is your comment?
14 |
15 |
16 |
--------------------------------------------------------------------------------
/testing/Sentinel/Tests/ShouldSucceed/OnlyValidation/Issue280.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue280 IN ENGLISH
2 |
3 | RELATION in[Item*Sequence] [UNI,TOT]
4 | RELATION pref[Item*SinText] [UNI]
5 | RELATION spref[Sequence*SinText] [UNI]
6 | RELATION post[Item*SinText] [UNI]
7 | RELATION spost[Sequence*SinText] [UNI]
8 |
9 | RULE Issue280 :
10 | (pref;V /\ in;(I-spref;spref~)) \/ (in /\ pref;-I;spref~)
11 | \/
12 | (post;V /\ in;(I-spost;spost~)) \/ (in /\ post;-I;spost~)
13 | |- -V
14 |
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try2.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test2
4 | RELATION r[X*Y]
5 | RELATION s[X*A]
6 | RELATION t[B*Y]
7 | RULE r = s;t
8 | ENDPATTERN
9 |
10 | ENDCONTEXT
11 |
12 | {-
13 | Purpose: This script is a simply incorrect with = and ;
14 | Result: FAIL
15 | Reason: type error on ;
16 | Error message:
17 |
18 | line 7:11, file "try2.adl":
19 | Inside term s;t,
20 | between the target of s and the source of t,
21 | concepts A and B are in conflict.
22 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue1026.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue1026 IN ENGLISH
2 |
3 | RELATION r[A*B]
4 | RELATION s[A*B]
5 |
6 | PATTERN SameName
7 | RULE ifRthenS : r |- s
8 | PURPOSE RULE ifRthenS IN DUTCH
9 | {+Dit is de tekst voor de regel ifRthenS. Deze staat in het eerste pattern met de naam Try46.+}
10 | ENDPATTERN
11 |
12 | PATTERN SameName
13 | RULE ifSthenR : s |- r
14 | PURPOSE RULE ifSthenR IN DUTCH
15 | {+Dit is de tekst voor de regel ifSthenR. Deze staat in het tweede pattern met de naam Try46.+}
16 | ENDPATTERN
17 |
18 | ENDCONTEXT
19 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try18fail.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 | CLASSIFY A ISA AOrB
3 | CLASSIFY B ISA AOrB
4 |
5 | PATTERN Test18
6 | RELATION r[X*Y]
7 | RELATION s[X*A]
8 | RELATION t[A*Y]
9 | RELATION t[B*Y]
10 | RULE Test:r = s;I[A];t
11 | CLASSIFY D IS A/\B
12 | -- was: RULE I[D] = I[A]/\I[B]
13 | ENDPATTERN
14 |
15 | ENDCONTEXT
16 |
17 | {-
18 | Purpose: Since try18b fails, this script is no longer ambiguous and should succeed.
19 | Reason: can pick t[A*Y] because concept A is closer than concept B.
20 | Result: PASS
21 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try6.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try6 IN ENGLISH
2 |
3 | PATTERN Try6
4 | RELATION r[X*Y]
5 | RELATION s[X*A]
6 | RELATION t[B*Y]
7 | RELATION u[E*Y]
8 | CLASSIFY B IS F /\ B
9 | CLASSIFY B IS B /\ G
10 | CLASSIFY F ISA D
11 | CLASSIFY G ISA D
12 | CLASSIFY E ISA F
13 | CLASSIFY A ISA G
14 | -- CLASSIFY B ISA G
15 | -- CLASSIFY B ISA F
16 | -- CLASSIFY F IS B /\ F
17 | -- CLASSIFY G IS B /\ G
18 | RULE Try6 : r = s!(t\/u)
19 | ENDPATTERN
20 |
21 | ENDCONTEXT
22 |
23 | {-
24 | testing generalisations: the resulting type will be
25 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/Parsing/shouldFail/Issue980.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue980 IN ENGLISH
2 |
3 | CONCEPT Fruit "Most general concept"
4 | CLASSIFY Citrus ISA Fruit
5 | CLASSIFY Orange ISA Citrus
6 | CLASSIFY Lemon ISA Citrus
7 |
8 | RELATION name[Citrus*Name]
9 | RELATION name[A * B] -- This relation's purpose is to distract the typechecker.
10 |
11 | INTERFACE Orange: I[Orange]
12 | BOX [ "I" LABEL "" : I
13 | , "name" : name
14 | ]
15 |
16 | INTERFACE Lemon: I[Lemon]
17 | BOX [ "I" LABEL "" : I
18 | , "name" : name[Citrus*Name]
19 | ]
20 |
21 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/Issue163.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue163 IN ENGLISH
2 |
3 | RELATION r[A*A]
4 | RELATION s[B*B]
5 |
6 | POPULATION A CONTAINS [ 3, 6, 42 ]
7 | -- This example should fail, because A and B are in the same typology, and B has TYPE INTEGER.
8 | -- The target concept of an INTERFACE's expresion must be of type OBJECT (which is the default)
9 | CLASSIFY B ISA A
10 | REPRESENT B TYPE INTEGER
11 |
12 | INTERFACE Issue163 : V[SESSION*A]
13 | BOX [ ie : I
14 | , r : r
15 | , s : s
16 | ]
17 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try17b.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test17b IN ENGLISH
2 |
3 | PATTERN Test17b
4 | RELATION r[A*C]
5 | RELATION s[A*D]
6 | RELATION q[B*C]
7 | CLASSIFY X ISA D
8 | CLASSIFY X ISA B
9 | RULE r = s;q
10 | ENDPATTERN
11 |
12 | ENDCONTEXT
13 |
14 | {-
15 | Purpose: This script is meant to study correct derivation of concept at ;
16 | Result: FAIL
17 | Reason: This requires an intersection type between A and B, which is not there.
18 | The concept X is not sufficient, as atoms in A/\B may not be in X.
19 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Try44.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try44 IN ENGLISH
2 | -----------------------------------------------------------
3 | PATTERN DocumentationByLanguage LABEL "Documentation by Language"
4 |
5 | PURPOSE CONCEPT X IN ENGLISH {+Some english text+}
6 | PURPOSE CONCEPT X IN DUTCH {+Enige nederlandse woorden+}
7 |
8 | ENDPATTERN
9 | -----------------------------------------------------------
10 | ENDCONTEXT
11 |
12 | {-
13 | Purpose: This script should succeed, because any concept can be documented in multiple languages.
14 | Result: PASS
15 | -}
--------------------------------------------------------------------------------
/src/Ampersand/Options/TestOptsParser.hs:
--------------------------------------------------------------------------------
1 | module Ampersand.Options.TestOptsParser (testOptsParser) where
2 |
3 | import Ampersand.Basics
4 | import Ampersand.Misc.HasClasses (TestOpts (..))
5 | import Options.Applicative
6 |
7 | -- | Command-line parser for TestOpts.
8 | testOptsParser :: FilePath -> Parser TestOpts
9 | testOptsParser dir =
10 | TestOpts
11 | <$> strArgument
12 | ( metavar "TESTDIRECTORY"
13 | <> value dir
14 | <> showDefault
15 | <> help "The root of the directory tree where the regression test cases can be found."
16 | )
17 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/IdentTest.adl:
--------------------------------------------------------------------------------
1 | CONTEXT IdentTest1 IN DUTCH
2 |
3 | CLASSIFY Nederlander ISA Europeaan
4 |
5 | IDENT Nederlander : Nederlander(bsn)
6 | RELATION bsn[Nederlander*BSN] [UNI, TOT]
7 | = [ ( "Piet", "12345")
8 | ]
9 | RELATION geboorteland[Europeaan*Land] [UNI]
10 | = [ ( "John Smith" , "Engeland" )
11 | ]
12 | RULE Buitenlander LABEL "een buitenlander heeft geen BSN" : -I[Nederlander] |- -(bsn;bsn~)
13 | {- Met deze test kunnen we aantonen dat het mogelijk is om een IDENT te zetten op een specialisatie-concept.
14 | -}
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Try34.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try34 IN ENGLISH
2 |
3 | PATTERN Try34
4 | CLASSIFY Verplichting ISA Criterium
5 | CLASSIFY Verwachting ISA Criterium
6 | RELATION scope[Criterium*Bedrijfsfunctie]
7 |
8 | RELATION tav[Verplichting*Bedrijfsfunctie]
9 |
10 | RELATION tav[Verwachting*Bedrijfsfunctie]
11 |
12 | RULE Try34: scope/\tav[Verplichting*Bedrijfsfunctie] |- tav[Verwachting*Bedrijfsfunctie]
13 |
14 | ENDPATTERN
15 | ENDCONTEXT
16 | {- This file gave type errors on July 11th, 2013. However, the condensed graph proved that there should be no type errors. -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/DuplicateInterfaces.adl:
--------------------------------------------------------------------------------
1 | CONTEXT DuplicateInterfaces IN ENGLISH
2 |
3 | -- Should yield exactly one error about multiple declarations of InterfaceA for role A, at lines 5 and 9
4 |
5 | INTERFACE InterfaceA FOR A : I[ONE]
6 | BOX [ l : V[ONE]
7 | ]
8 |
9 | INTERFACE InterfaceA FOR A,B : I[ONE]
10 | BOX [ l : V[ONE]
11 | ]
12 |
13 | INTERFACE InterfaceA FOR C : I[ONE]
14 | BOX [ l : V[ONE]
15 | ]
16 |
17 | INTERFACE InterfaceB FOR A : I[ONE]
18 | BOX [ l : V[ONE]
19 | ]
20 |
21 | ENDCONTEXT
22 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/WithMeatgrinder/testinfo.yaml:
--------------------------------------------------------------------------------
1 | testCmds:
2 | # The intention of this testcase is to test the meatgrinder.
3 | # - command: ampersand validate --verbose --build-recipe AtlasComplete
4 | # exitcode: 0
5 | - command: ampersand population --verbose --build-recipe Standard
6 | exitcode: 0
7 | - command: ampersand population --verbose --build-recipe Prototype
8 | exitcode: 0
9 | - command: ampersand population --verbose --build-recipe Grind
10 | exitcode: 0
11 | - command: ampersand population --verbose --build-recipe RAP
12 | exitcode: 0
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/SingleRoot.adl:
--------------------------------------------------------------------------------
1 | CONTEXT SingleRoot IN ENGLISH
2 | {-
3 | To enable the use of tables, each typology should have a single root element (the most generic concept).
4 | If there is none, it is feasable to have & create one automatically. However, then a name must be choosen.
5 | We have decided to have the modeller choose a name for such a largest concept, by adding CLASSIFY statements.
6 | -}
7 |
8 | -- Also see issue https://github.com/AmpersandTarski/ampersand/issues/292
9 | CLASSIFY A ISA B
10 | CLASSIFY A ISA C
11 |
12 |
13 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue174.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue174 IN ENGLISH
2 |
3 | RELATION bfRLIType[BusinessFunction*RLIType] [UNI]
4 | RELATION impactTypeOf[Impact*RLIType]
5 | RELATION likelihoodTypeOf[Likelihood*RLIType]
6 | RELATION riskTypeOf[Risk*RLIType]
7 |
8 | RULE RLIType : -- invariant
9 | bfRLIType |- bfRLIType;(impactTypeOf~;impactTypeOf /\ likelihoodTypeOf~;likelihoodTypeOf /\ riskTypeOf~;riskTypeOf)
10 | MEANING "A BusinessFunction may only use a predefined RLIType"
11 | VIOLATION (SRC I, TXT " attempts to use the non predefined RLIType '", TGT I, TXT "'")
12 |
13 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Sentinel/Tests/ShouldSucceed/OnlyValidation/Ticket580.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Ticket444 IN DUTCH
2 | --------------------------------------------------------
3 | PATTERN Ticket444
4 | RELATION nhIsDashboard[Normenhiërarchie*Normenhiërarchie] [PROP]
5 | RELATION ouDashboardNH[OrgUnit*Normenhiërarchie] [UNI]
6 | RELATION bfDashboardNH[Bedrijfsfunctie*Normenhiërarchie] [UNI]
7 |
8 | --ROLE Developer MAINTAINS Regeltje
9 | RULE Regeltje : I /\ (bfDashboardNH~;bfDashboardNH \/ ouDashboardNH~;ouDashboardNH) |- nhIsDashboard
10 |
11 | ENDPATTERN
12 | ------------------------------------------------------------
13 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/README.md:
--------------------------------------------------------------------------------
1 | # Automatic test functionality
2 |
3 | To increase the quality of the Ampersand software, every time a commit is done in the Git repo, the executable is built from scratch, and a couple of tests are performed. The directory testcases contains those tests.
4 |
5 | The tests consist of one or more Ampersand scripts in a directory. All those scripts are tested based on information from the file `testinfo.yaml` in that directory. An Ampersand script must have the extention `.adl` to be recognized as such. This enables having `INCLUDE` files in the same directory, without them being tested on its own.
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/ComparisonTest2.adl:
--------------------------------------------------------------------------------
1 | CONTEXT CompareBooleans IN DUTCH
2 |
3 | -- This test forces a compare on atoms with TTYPE BOOLEAN. That should not be allowed.
4 |
5 | CONCEPT Boolean ""
6 | REPRESENT Boolean TYPE BOOLEAN
7 |
8 | POPULATION Boolean CONTAINS [ TRUE, FALSE ]
9 |
10 | RELATION toTrue[A*Boolean]
11 | POPULATION toTrue CONTAINS[
12 | ("Foo", TRUE)
13 | ]
14 | RELATION toFalse[A*Boolean]
15 | POPULATION toFalse CONTAINS[
16 | ("Foo", FALSE)
17 | ]
18 |
19 | RULE compareBooleans : "Foo" |- toTrue;>;toFalse~
20 |
21 |
22 |
23 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/Issue757.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue757
2 |
3 | CLASSIFY RegForm1 ISA Form
4 | CLASSIFY RegForm2 ISA Form
5 |
6 | RELATION regFormProcessReq[RegForm1*RegForm1] [PROP]
7 | RELATION registrationform[Person*Form] [UNI] -- Form by which the Person is registered
8 | RELATION sessionRegForm2[SESSION*RegForm2] [UNI] -- Only one registration form allowed in any session.
9 |
10 | RULE Rule2 : registrationform;regFormProcessReq |- -V
11 | VIOLATION (TXT "{EX} DelPair;sessionRegForm2;SESSION;", TGT sessionRegForm2~, TXT ";RegForm2;", TGT I)
12 |
13 | ENDCONTEXT
14 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/FuncSpec/testPredLogic.adl:
--------------------------------------------------------------------------------
1 | CONTEXT TestPredLogic
2 |
3 |
4 | RELATION r[A * B] [UNI,TOT]
5 |
6 | RELATION s[A * B]
7 | PURPOSE RULE s1
8 | {+Rule s1 should be documented with the MEANING, in natural language, without predicate logic.+}
9 | RULE s1 : s~;-I;s |- -I[B]
10 | MEANING "IF a differs from a' then s(a) differs from s(a')."
11 |
12 | RELATION t[A * B]
13 | PURPOSE RULE t1
14 | {+Rule t1 should be documented in predicate logic, because the user did not specify a MEANING.+}
15 | RULE t1 : t~;-I;t |- -I[B]
16 |
17 | RULE s2 : s;t~
18 | RULE r2 : r~;s;t~
19 | RULE r3 : r~;s;t~/\t~
20 |
21 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try17.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test17
4 | RELATION r[X*Y]
5 | RELATION s[X*A]
6 | RELATION t[B*Y]
7 | RULE r = s;t
8 | RULE I[D] = I[A]\/I[B]
9 | ENDPATTERN
10 |
11 | ENDCONTEXT
12 |
13 | {-
14 | Purpose: This script shows that a type conflict (between A and B) can be resolved
15 | by defining a union type D.
16 | Result: FAIL
17 | Reason: This requires an intersection type between A and B, which is not there.
18 | Adding RULE I[E] = I[A]/\I[B] helps, because this yields concept E to be the type between s and t.
19 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/InterfaceTest2.adl:
--------------------------------------------------------------------------------
1 | CONTEXT InterfaceTest2 IN ENGLISH
2 |
3 | PATTERN TryECA1
4 | RELATION r[A*C]
5 | RELATION s[A*C]
6 | ROLE tester MAINTAINS invariant
7 | RULE invariant : r |- s
8 | ENDPATTERN
9 |
10 | POPULATION r[A*C] CONTAINS
11 | [ ("Aap", "Cent") ]
12 |
13 | INTERFACE overview : I[ONE]
14 | BOX [ "As" : V[ONE*A]
15 | , "Cs" : V[ONE*C]
16 | ]
17 |
18 | INTERFACE edit: I[A]
19 | BOX [ "source" : I
20 | , "target of r" : r
21 | , "target of s" : s
22 | ]
23 | ENDCONTEXT
24 |
25 | {-
26 | Purpose: This script tests ECA rules
27 | Result: PASS
28 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try29.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try29 IN ENGLISH
2 |
3 | PATTERN Try29
4 | CLASSIFY Medewerker ISA Persoon
5 | CLASSIFY Student ISA Persoon
6 | RELATION studentNr[Student*StudentNummer] [MAP]
7 | RELATION salNr[Medewerker*SalarisNummer] [MAP]
8 |
9 | RULE identificatie : I[Persoon] |- studentNr;studentNr~ \/ salNr;salNr~
10 | MEANING "Elke persoon moet een studentnummer dan wel een salarisnummer hebben"
11 | ENDPATTERN
12 |
13 | ENDCONTEXT
14 |
15 | {-
16 | Purpose: A test to see if the typechecker can handle multiple ISA relations with the same root concept.
17 | Result: PASS
18 |
19 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/FlipPHPBug.adl:
--------------------------------------------------------------------------------
1 | CONTEXT FlipPHPBug IN ENGLISH
2 |
3 | CLASSIFY Lime ISA Citrus
4 |
5 | RELATION ownsCitrus[Person*Citrus]
6 |
7 | INTERFACE Overview : I[ONE]
8 | BOX [ "All people" : V[ONE*Person]
9 | ]
10 |
11 | INTERFACE Person : I[Person]
12 | BOX [ "php error 1" : (ownsCitrus;(I[Lime];I[Citrus]));(I[Citrus];I[Citrus])~ -- Bug, gives php error
13 | , "php error 2" : (ownsCitrus;I[Citrus]~) -- Same, probably related
14 | ]
15 |
16 | POPULATION ownsCitrus[Person*Citrus] CONTAINS
17 | [ ("martijn", "lime1")
18 | ]
19 |
20 | ENDCONTEXT
21 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue152.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue152 IN ENGLISH
2 |
3 | VIEW SessionProperty: SESSION { value : I } ENDVIEW
4 |
5 | -- For system bootstrapping purposes, we need a "God"-account that has all permissions/roles.
6 | POPULATION Account CONTAINS [ "god" ]
7 |
8 | RELATION sessionLoginAssist[SESSION*SESSION] [PROP]
9 |
10 | INTERFACE Login : "_SESSION"[SESSION]
11 | BOX[ "Please help" : sessionLoginAssist
12 | , " " : sessionLoginAssist;V[SESSION*SESSION];V[SESSION*Account];(-I[Account]!"god");V[Account*Message];"There are no Accounts!!!"[Message]
13 | ]
14 |
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/Bugs/Fixed/Other/Bug_GeneratedTables.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Bugs IN ENGLISH
2 |
3 | RELATION r2[A*C] [UNI,SUR]
4 |
5 | RELATION r1[A*B] [UNI]
6 |
7 | -- The created tables are
8 | -- A B C
9 | -- ____________ __________ ____
10 | -- |A |r2| r1 | |B |fillB| |C |
11 | -- |--+--+----| |--|-----| |--|
12 | -- |a1|c1|NULL| |b1| b1 | |c1|
13 | -- |----------| |--|-----| |--|
14 | --
15 | -- Seems buggy. Why is the concept table of C not a column in A?
16 | -- It may contain duplicates, but some concept tables also contain duplicates (which may instead be the bug here)
17 |
18 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try24.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try24 IN ENGLISH
2 |
3 | CLASSIFY A ISA B
4 | RELATION r[A*C] [UNI]
5 |
6 | RELATION s[A*D]
7 | = [ ( "aap" , "noot")
8 | ; ( "mies", "vuur")
9 | ]
10 |
11 |
12 | {- In version 914 of ampersand (but also long before, e.g. version 699), this script generates an error:
13 |
14 | D:\data\hjo20125\ampersand>prototype -p --haskell try30.adl
15 | Inconsistencies in rule "TOT A[A*B]":
16 | - [("aap","aap"),("mies","mies")]
17 |
18 |
19 | ERROR: No prototype generated because of rule violations.
20 | (Compile with --dev to generate a prototype regardless of violations)
21 |
22 | -}
23 | ENDCONTEXT
--------------------------------------------------------------------------------
/outputTemplates/default.asciidoc:
--------------------------------------------------------------------------------
1 | $if(titleblock)$
2 | = $title$
3 | $if(author)$
4 | $for(author)$$author$$sep$; $endfor$
5 | $endif$
6 | $if(date)$
7 | $date$
8 | $endif$
9 | $if(keywords)$
10 | :keywords: $for(keywords)$$keywords$$sep$, $endfor$
11 | $endif$
12 | $if(lang)$
13 | :lang: $lang$
14 | $endif$
15 | $if(toc)$
16 | :toc:
17 | $endif$
18 |
19 | $endif$
20 | $if(abstract)$
21 | [abstract]
22 | == Abstract
23 | $abstract$
24 |
25 | $endif$
26 | $for(header-includes)$
27 | $header-includes$
28 |
29 | $endfor$
30 | $for(include-before)$
31 | $include-before$
32 |
33 | $endfor$
34 | $body$
35 | $for(include-after)$
36 |
37 | $include-after$
38 | $endfor$
39 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Ticket237.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Ticket237 IN DUTCH
2 |
3 | PATTERN Ticket237
4 | CLASSIFY Citrus ISA Fruit
5 |
6 | RELATION r[Fruit*Citrus]
7 | POPULATION r[Fruit*Citrus] CONTAINS
8 | [ ("1", "2") ; ("2", "2") ; ("3", "1") ]
9 |
10 | RULE Ticket237: I[Fruit] /\ (V[Fruit]-I[Citrus]) = I[Fruit]-I[Citrus]
11 | ENDPATTERN
12 |
13 | PURPOSE CONTEXT Ticket237 MARKDOWN
14 | {+This script should succeed, because `I[Fruit]-I[Citrus]` must
15 | be interpreted as `I[Fruit] /\ (V[Fruit]-I[Citrus])`.
16 | This is to prove that `I[Fruit]-I[Citrus]` may not be interpreted as `I[Fruit] /\ (V[Citrus]-I[Citrus])`
17 | +}
18 |
19 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try28.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try28 IN ENGLISH
2 | RELATION clientName[Client*Name] [MAP]
3 | RELATION clientAddress[Client*Address] [MAP]
4 |
5 | VIEW Client: Client(clientName, TXT ", ", clientAddress)
6 |
7 | {- Purpose This script demonstrates a bug where the relations in a VIEW are not taken into account in the typechecker.
8 | The produced message:
9 | ampersand: !fatal error 1601 (module ADL1.P2A_Converters, Ampersand v2.2.1.986:987M)
10 | Term clientName (line 5:34, file "try28.adl") was not found in 2 bindings.
11 | RELATION clientName[Client*Name]
12 | RELATION clientAddress[Client*Address]
13 | -}
14 | ENDCONTEXT
--------------------------------------------------------------------------------
/AmpersandData/FormalAmpersand/FormalAmpersand.adl:
--------------------------------------------------------------------------------
1 | CONTEXT FormalAmpersand IN ENGLISH LATEX
2 | --! 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 !--
3 | INCLUDE "Concepts.adl"
4 | -- INCLUDE "Conjuncts.adl"
5 | INCLUDE "Contexts.adl"
6 | INCLUDE "Documentation.adl"
7 | INCLUDE "Generics.adl"
8 | INCLUDE "Interfaces.adl"
9 | --INCLUDE "MinimalAST.xlsx" -- Contains minimal population. Anything discarded from it must violate an invariant
10 | INCLUDE "Relations.adl"
11 | INCLUDE "Rules.adl"
12 | -- INCLUDE "Tables.adl"
13 | INCLUDE "Terms.adl"
14 | --INCLUDE "Views.adl"
15 |
16 |
17 | ENDCONTEXT
18 |
--------------------------------------------------------------------------------
/outputTemplates/default.man:
--------------------------------------------------------------------------------
1 | $if(has-tables)$
2 | .\"t
3 | $endif$
4 | $if(pandoc-version)$
5 | .\" Automatically generated by Pandoc $pandoc-version$
6 | .\"
7 | $endif$
8 | $if(adjusting)$
9 | .ad $adjusting$
10 | $endif$
11 | .TH "$title/nowrap$" "$section/nowrap$" "$date/nowrap$" "$footer/nowrap$" "$header/nowrap$"
12 | $if(hyphenate)$
13 | .hy
14 | $else$
15 | .nh
16 | $endif$
17 | $for(header-includes)$
18 | $header-includes$
19 | $endfor$
20 | $for(include-before)$
21 | $include-before$
22 | $endfor$
23 | $body$
24 | $for(include-after)$
25 | $include-after$
26 | $endfor$
27 | $if(author)$
28 | .SH AUTHORS
29 | $for(author)$$author$$sep$; $endfor$.
30 | $endif$
31 |
--------------------------------------------------------------------------------
/src/Ampersand/Commands/Init.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE ConstraintKinds #-}
2 | {-# LANGUAGE FlexibleContexts #-}
3 |
4 | -- | Generate a configuration file for a new project.
5 | module Ampersand.Commands.Init
6 | ( init,
7 | InitOpts (..),
8 | HasInitOpts (..),
9 | )
10 | where
11 |
12 | import Ampersand.Basics
13 | import Ampersand.Misc.HasClasses
14 | import Ampersand.Types.Config
15 |
16 | -- | Generate a configuration file for a new project.
17 | init ::
18 | (HasRunner env) => -- , Show env, HasProtoOpts env, HasAllowInvariantViolations env, HasDirPrototype env, HasRootFile env)
19 | RIO env ()
20 | init = do
21 | logInfo "Still has to be implemented..."
22 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/ARM20-Test1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARM20bug IN DUTCH
2 | ------------------------------------------------------------
3 | PATTERN ARM20bug LABEL "ARM 2.0 bug"
4 |
5 | RELATION oblBF[Verplichting*Bedrijfsfunctie] [MAP]
6 | RELATION expBF[Verwachting*Bedrijfsfunctie] [MAP]
7 | RELATION oblexp[Verplichting*Verwachting]
8 |
9 | RULE Verplichting LABEL "Verplichting and expectation integrity": oblexp |- oblBF;expBF~
10 | VIOLATION (TXT "Verplichting '", SRC I, TXT "' is van '", SRC oblBF, TXT "' terwijl verwachting '", TGT I, TXT "' van '", TGT expBF, TXT "' is.")
11 |
12 | ENDPATTERN
13 | ------------------------------------------------------------
14 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue760.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Bug760 IN ENGLISH
2 |
3 | RELATION myFatherIs[Person*Person] [UNI,INJ] -- (Src) Person has (Tgt) Person as its predecessor
4 |
5 | POPULATION myFatherIs CONTAINS [ ( "Stein", "Rieks" ) ]
6 | POPULATION myFatherIs CONTAINS [ ( "Rieks", "Pierre" ) ]
7 | POPULATION myFatherIs CONTAINS [ ( "Pierre", "Harry" ) ]
8 | POPULATION myFatherIs CONTAINS [ ( "Harry", "Peter" ) ]
9 |
10 | INTERFACE Persons: "_SESSION";V[SESSION*Person] cRud BOX
11 | [ "Me" : I cRud
12 | , "My father" : myFatherIs cRud
13 | , "My son" : myFatherIs~ cRud
14 | ]
15 |
16 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/Simple/Roles.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Roles IN ENGLISH
2 | {- Simple script for explaining and testing roles -}
3 |
4 | INTERFACE All : I[ONE]
5 | BOX [ "one" : I[ONE] ]
6 |
7 | INTERFACE ProducerAndConsumer FOR Producer, Consumer : I[ONE]
8 | BOX [ "one" : V[ONE] ]
9 |
10 | INTERFACE Producer FOR Producer : I[ONE]
11 | BOX [ "one" : V[ONE] ]
12 |
13 | INTERFACE Consumer FOR Consumer : I[ONE]
14 | BOX [ "one" : V[ONE] ]
15 |
16 |
17 | PATTERN Test
18 |
19 | RULE ProducerSignal : V[ONE]
20 |
21 | RULE ConsumerSignal : V[ONE]
22 |
23 | ROLE Producer MAINTAINS ProducerSignal
24 |
25 | ROLE Consumer MAINTAINS ConsumerSignal
26 |
27 | ENDPATTERN
28 |
29 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/ARM_Test10.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARMTest10 IN DUTCH -- (project ARMisa)
2 | CLASSIFY Verplichting ISA Criterium
3 | CLASSIFY Verwachting ISA Criterium
4 | CLASSIFY Gewetensvraag IS Verplichting /\ Verwachting
5 | CLASSIFY Gewetensvraag ISA Criterium
6 | RELATION critText[Criterium*Blob] [MAP]
7 | RELATION afdekking[Criterium*Verwachtingsverzameling] [UNI]
8 | RELATION vvVerwachting[Verwachtingsverzameling*Criterium]
9 | INTERFACE Gewetensvraag : I[Gewetensvraag]
10 | BOX[ afdekking : afdekking
11 | BOX[ gewetensvragen: vvVerwachting;I[Gewetensvraag]
12 | BOX[ gewetensvraag: I
13 | , criterium : critText
14 | ]
15 | ]
16 | ]
17 | ENDCONTEXT
18 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/InterfaceTest3.adl:
--------------------------------------------------------------------------------
1 | CONTEXT InterfaceTest3 IN ENGLISH
2 |
3 | RELATION r[A*C]
4 | RELATION s[B*D]
5 | CLASSIFY B ISA A
6 |
7 | INTERFACE T :I[B]
8 | BOX [ self: I
9 | -- , r : I[B];r
10 | , s : s
11 | ]
12 | ENDCONTEXT
13 |
14 | {-
15 | The type of the box is evident: it must be [B], because of the explicit type of the interface.
16 | Hence, the type of `self:I` must be infered to B
17 | However, in Ampersand v2.2.1.1026 we get the following error message:
18 |
19 | Error(s) found:
20 | line 8:13, file "InterfaceTest3.adl":
21 | the source and target of I
22 | are in conflict with respect to concepts A and B.
23 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/Bugs/Fixed/Other/Bug_ColumnProperties.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Bug IN ENGLISH --ticket #214
2 |
3 | RELATION rel[A*B] [INJ,SUR]
4 |
5 | -- yields column properties: [{-NUL+UNQ} A] [{-NUL+UNQ} B , {+NUL-UNQ} rel]
6 | -- but this should be .. {-NUL-UNQ} ..
7 |
8 | -- compare with UNI and TOT:
9 |
10 | -- rel[A*B] [INJ] [{-NUL+UNQ} A] [{-NUL+UNQ} B , {+NUL-UNQ} rel]
11 | -- rel[A*B] [INJ,SUR] [{-NUL+UNQ} A] [{-NUL+UNQ} B , {+NUL-UNQ} rel] <- wrong
12 | -- rel[A*B] [UNI] [{-NUL+UNQ} A, {+NUL-UNQ} rel] [{-NUL+UNQ} B]
13 | -- rel[A*B] [UNI,TOT] [{-NUL+UNQ} A, {-NUL-UNQ} rel] [{-NUL+UNQ} B]
14 |
15 | ENDCONTEXT
--------------------------------------------------------------------------------
/outputTemplates/default.texinfo:
--------------------------------------------------------------------------------
1 | \input texinfo
2 | @documentencoding UTF-8
3 | $for(header-includes)$
4 | $header-includes$
5 | $endfor$
6 |
7 | $if(strikeout)$
8 | @macro textstrikeout{text}
9 | ~~\text\~~
10 | @end macro
11 |
12 | $endif$
13 | @ifnottex
14 | @paragraphindent 0
15 | @end ifnottex
16 | $if(titlepage)$
17 | @titlepage
18 | @title $title$
19 | $for(author)$
20 | @author $author$
21 | $endfor$
22 | $if(date)$
23 | $date$
24 | $endif$
25 | @end titlepage
26 |
27 | $endif$
28 | $for(include-before)$
29 | $include-before$
30 |
31 | $endfor$
32 | $if(toc)$
33 | @contents
34 |
35 | $endif$
36 | $body$
37 | $for(include-after)$
38 |
39 | $include-after$
40 | $endfor$
41 |
42 | @bye
43 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/DoubleLabel.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | INTERFACE Overview : I[ONE]
4 | BOX [ l : V[ONE]
5 | , l : V[ONE]
6 | ]
7 |
8 | ENDCONTEXT
9 |
10 | {-
11 | Purpose: to examine the error message caused by multiple instances of the same field.
12 | Result: FAIL
13 | Reason: Field names in interfaces must be unique, because they are being referred to.
14 |
15 | Message:
16 | The interface named "Overview" contains errors:
17 | line 3:11, file "DoubleLabel.adl": Different fields have the same name:
18 | (Unknown origin) "l" : V[ONE*ONE]
19 | (Unknown origin) "l" : V[ONE*ONE]
20 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/Ticket237.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Ticket237 IN DUTCH
2 |
3 | PATTERN Ticket237
4 | CLASSIFY Citrus ISA Fruit
5 |
6 | RULE I[Fruit] /\ -I[Citrus] = I[Fruit]-I[Citrus]
7 | ENDPATTERN
8 |
9 | PURPOSE CONTEXT Ticket237 MARKDOWN
10 | {+This script should produce a type error, because `I[Fruit] /\ -I[Citrus]` is ambiguous.
11 | It can be interpreted as `I[Fruit] /\ (V[Citrus]-I[Citrus])` or as `I[Fruit] /\ (V[Fruit]-I[Citrus])`
12 | The ambiguity can be exposed by adding the following population:
13 |
14 | RELATION r[Fruit*Citrus]
15 | POPULATION r[Fruit*Citrus] CONTAINS
16 | [ ("1", "2") ; ("2", "2") ; ("3", "1") ]
17 | -}
18 |
19 | ENDCONTEXT
--------------------------------------------------------------------------------
/outputTemplates/default.asciidoctor:
--------------------------------------------------------------------------------
1 | $if(titleblock)$
2 | = $title$
3 | $if(author)$
4 | $for(author)$$author$$sep$; $endfor$
5 | $endif$
6 | $if(date)$
7 | $date$
8 | $endif$
9 | $if(keywords)$
10 | :keywords: $for(keywords)$$keywords$$sep$, $endfor$
11 | $endif$
12 | $if(lang)$
13 | :lang: $lang$
14 | $endif$
15 | $if(toc)$
16 | :toc:
17 | $endif$
18 | $if(math)$
19 | :stem: latexmath
20 | $endif$
21 |
22 | $endif$
23 | $if(abstract)$
24 | [abstract]
25 | == Abstract
26 | $abstract$
27 |
28 | $endif$
29 | $for(header-includes)$
30 | $header-includes$
31 |
32 | $endfor$
33 | $for(include-before)$
34 | $include-before$
35 |
36 | $endfor$
37 | $body$
38 | $for(include-after)$
39 |
40 | $include-after$
41 | $endfor$
42 |
--------------------------------------------------------------------------------
/src/Ampersand.hs:
--------------------------------------------------------------------------------
1 | module Ampersand
2 | ( module Ampersand.ADL1,
3 | module Ampersand.Basics,
4 | module Ampersand.Classes,
5 | module Ampersand.Misc.Commands,
6 | module Ampersand.Daemon.Daemon,
7 | module Ampersand.FSpec,
8 | module Ampersand.Input,
9 | module Ampersand.Misc.HasClasses,
10 | module Ampersand.Output,
11 | module Ampersand.Test,
12 | )
13 | where
14 |
15 | import Ampersand.ADL1
16 | import Ampersand.Basics hiding (Identity)
17 | import Ampersand.Classes
18 | import Ampersand.Daemon.Daemon
19 | import Ampersand.FSpec
20 | import Ampersand.Input
21 | import Ampersand.Misc.Commands
22 | import Ampersand.Misc.HasClasses
23 | import Ampersand.Output
24 | import Ampersand.Test
25 |
--------------------------------------------------------------------------------
/outputTemplates/default.rst:
--------------------------------------------------------------------------------
1 | $if(titleblock)$
2 | $titleblock$
3 |
4 | $endif$
5 | $for(author)$
6 | :Author: $author$
7 | $endfor$
8 | $if(date)$
9 | :Date: $date$
10 | $endif$
11 | $if(author)$
12 |
13 | $else$
14 | $if(date)$
15 |
16 | $endif$
17 | $endif$
18 | $if(rawtex)$
19 | .. role:: raw-latex(raw)
20 | :format: latex
21 | ..
22 |
23 | $endif$
24 | $for(include-before)$
25 | $include-before$
26 |
27 | $endfor$
28 | $if(toc)$
29 | .. contents::
30 | :depth: $toc-depth$
31 | ..
32 |
33 | $endif$
34 | $if(number-sections)$
35 | .. section-numbering::
36 |
37 | $endif$
38 | $for(header-includes)$
39 | $header-includes$
40 |
41 | $endfor$
42 | $body$
43 | $for(include-after)$
44 |
45 | $include-after$
46 | $endfor$
47 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue746.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue746 IN DUTCH
2 |
3 | RULE sinterklaasBestaatNiet : -("Sinterklaas";I[Persoon])
4 | MEANING "De persoon 'Sinterklaas' bestaat niet."
5 |
6 | RULE sinterklaasBestaat : "Sinterklaas";I[Idee]
7 | MEANING "Het is ondenkbaar dat de idee 'Sinterklaas' niet bestaat."
8 |
9 | POPULATION Idee CONTAINS ["Sinterklaas"]
10 |
11 | INTERFACE Personen : "_SESSION"[SESSION]
12 | BOX [ "Sinterklaas mag hier niet" : V[SESSION*Persoon] ]
13 |
14 | INTERFACE Ideeen : "_SESSION"[SESSION]
15 | BOX [ "Sinterklaas moet hier altijd" : V[SESSION*Idee] ]
16 |
17 | ENDCONTEXT
18 |
19 | {-
20 | This issue is about the sql implementation of terms containing singleton terms.
21 | -}
22 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/FuncSpec/testIssue1183.adl:
--------------------------------------------------------------------------------
1 | CONTEXT TestIssue1183
2 |
3 | PATTERN FOO
4 | CONCEPT A123 "string 1" "ref"
5 | MEANING {+ string 2 +}
6 |
7 | CONCEPT A123L "string 1" "ref"
8 | MEANING LATEX {+ string 2 +}
9 |
10 | CONCEPT A13 "string 1"
11 | MEANING {+ string 2 +}
12 |
13 | CONCEPT A13L "string 1"
14 | MEANING LATEX {+ string 2 +}
15 |
16 | CONCEPT A12 "string 1" "ref"
17 |
18 | CONCEPT A1 "string 1"
19 |
20 | CONCEPT A123 "string 3" "ref"
21 | MEANING {+ string 4 +}
22 |
23 | RELATION foo[A123 * A123L]
24 | RELATION foo[A133 * A13L]
25 | RELATION foo[A1 * A12]
26 | ENDPATTERN
27 |
28 | CONCEPT A3
29 | MEANING {+ string 5 +}
30 |
31 | CONCEPT A3L
32 | MEANING LATEX {+ string 6 +}
33 |
34 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Ticket398.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Ticket398 IN ENGLISH
2 |
3 | PATTERN Ticket398
4 | RELATION actTask[Activity*Task] [MAP] MEANING "Activities are carried out as part of a task"
5 | RELATION actEndTime[Activity*Timestamp] [UNI] MEANING "Activities may be completed at a specific time"
6 | RELATION taskCompleted[Task*Task] [PROP] MEANING "Tasks may have the property of being completed"
7 |
8 | RELATION taskCmpStatIsGreen[Task*Task]
9 | ROLE Developer MAINTAINS CompleteTask
10 | RULE CompleteTask: I[Task] /\ (-actTask~!(I /\ actEndTime;actEndTime~));actTask |- taskCmpStatIsGreen MEANING "When all activities of the task have terminated, the task status must be Green"
11 |
12 | ENDPATTERN
13 | ENDCONTEXT
--------------------------------------------------------------------------------
/docs/the-tools-we-use/building/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: This chapter describes how and why the various items are built.
3 | ---
4 |
5 | # Building
6 |
7 | | Item | build tool | Purpose |
8 | | :--- | :--- | :--- |
9 | | [Ampersand Compiler](haskell.md) | Stack | build a binary on MacOS or Windows |
10 | | [Ampersand Compiler](building-an-ampersand-compiler-as-docker-image.md) | Docker | build a Docker image for the Ampersand compiler |
11 | | Application | Docker | build a Docker image for an application generated by Ampersand. |
12 | | RAP | Docker | build a Docker image for RAP |
13 | | [Automated build](automated-builds.md) | Docker Cloud | explains the automated build process that produces up-to-date images on docker cloud. |
14 |
15 |
--------------------------------------------------------------------------------
/miscellaneous/Berichten/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Rechtspraak
5 |
6 |
7 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/outputTemplates/default.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}}
2 | {\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
3 | \widowctrl\hyphauto
4 | $for(header-includes)$
5 | $header-includes$
6 | $endfor$
7 |
8 | $if(title)$
9 | {\pard \qc \f0 \sa180 \li0 \fi0 \b \fs36 $title$\par}
10 | $endif$
11 | $for(author)$
12 | {\pard \qc \f0 \sa180 \li0 \fi0 $author$\par}
13 | $endfor$
14 | $if(date)$
15 | {\pard \qc \f0 \sa180 \li0 \fi0 $date$\par}
16 | $endif$
17 | $if(spacer)$
18 | {\pard \ql \f0 \sa180 \li0 \fi0 \par}
19 | $endif$
20 | $if(toc)$
21 | $table-of-contents$
22 | $endif$
23 | $for(include-before)$
24 | $include-before$
25 | $endfor$
26 | $body$
27 | $for(include-after)$
28 | $include-after$
29 | $endfor$
30 | }
31 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try14.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try14 IN ENGLISH
2 |
3 | PATTERN Try14
4 | RELATION r[A*C]
5 | RELATION s[A*B]
6 | RELATION q[B*C]
7 | RULE r = -(-s;-q)
8 | ENDPATTERN
9 |
10 | ENDCONTEXT
11 |
12 | {-
13 | Purpose: This script is meant to study the ambiguity of interpretation in terms with complements.
14 | Result: FAIL
15 | An ambiguity arises in type checking. Be more specific in the terms -s and -q.
16 | You could add more types inside the term, or write:
17 | (V[A*B] - s)
18 | (V[B*C] - q)
19 | Error at symbol () in file try14.adl at line 7 : 14
20 |
21 | In issue #241 we have restored the law r-s = r/\-s. In order to achieve this, Bas had to tighten the ambiguity rules.
22 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Try43.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try43 IN ENGLISH
2 |
3 | PATTERN Try43
4 | RELATION z[A*B]
5 | RELATION t[A*A]
6 | RELATION m[A*A]
7 | RELATION b[A*A]
8 | ENDPATTERN
9 |
10 | INTERFACE Try43 : V[ONE*B]
11 | BOX
12 | [
13 | "dossiers" : z~ /\ z~;(t /\ (-m \/ -b))
14 | ]
15 |
16 | ENDCONTEXT
17 |
18 | {- This test case has originated from a bug chase in DemoLamicieCode702.
19 | It produced the error message:
20 | Prototype: !fatal 430 (module Core.AbstractSyntaxTree) Ampersand v3.0.1.1270:1271M
21 | Cannot unite (with operator "\/") term
22 | EFlp (EDcD RELATION z [A*B])
23 | with EUni (ECpl (EDcD RELATION m [A*A]),ECpl (EDcD RELATION b [A*A])).
24 |
25 | This bug has been fixed on Febr 9th, 2014.
26 | -}
27 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.**
10 |
11 |
12 |
13 | **Describe the solution you'd like**
14 |
15 |
16 |
17 | **Describe alternatives you've considered**
18 |
19 |
20 |
21 | **Additional context**
22 |
23 |
--------------------------------------------------------------------------------
/src/Ampersand/Commands/Validate.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE ConstraintKinds #-}
2 | {-# LANGUAGE FlexibleContexts #-}
3 |
4 | -- | Generate a prototype from a project.
5 | module Ampersand.Commands.Validate
6 | ( validate,
7 | ValidateOpts (..),
8 | HasValidateOpts (..),
9 | )
10 | where
11 |
12 | import Ampersand.Basics
13 | import Ampersand.FSpec
14 | import Ampersand.Misc.HasClasses
15 | import Ampersand.Prototype.ValidateSQL (validateRulesSQL)
16 |
17 | -- | Builds a prototype of the current project.
18 | validate ::
19 | (HasLogFunc env) =>
20 | FSpec ->
21 | RIO env ()
22 | validate fSpec = do
23 | logInfo "Validating SQL expressions..."
24 | errMsg <- validateRulesSQL fSpec
25 | unless (null errMsg) (exitWith $ InvalidSQLExpression errMsg)
26 |
--------------------------------------------------------------------------------
/docs/modeling/legal-modeling.md:
--------------------------------------------------------------------------------
1 | # Legal modeling
2 |
3 | ## Purpose
4 |
5 | The purpose of legal modeling is usually software related. The most popular use is to obtain decision rules that can be executed by a computer. A much mentioned problem is the legal language of the legislative domain that is being modeled. A modeler who is unfamiliar with the domain language will require trial and error to formulate decision rules that ar both executable and legally compliant. Another problem is that the modeler is sometimes legally educated, sometimes technically educated, but rarely both. It requires a modeler who is both technically and legally competent to make this trial-and-error process converge. This explains why legal modeling can be very time consuming.
6 |
7 | ### to be continued
8 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Bugs/NoSentinel/TechDataModelTest.adl:
--------------------------------------------------------------------------------
1 | CONTEXT TechDataModelTest IN ENGLISH
2 |
3 | -- Kernel concepts should not get type Bool
4 |
5 | CLASSIFY B ISA A
6 |
7 | CONCEPT E "testconcept E" -- disconnected concept, should not appear in technical data model
8 |
9 | RELATION r1[B*C] [SUR,UNI,INJ]
10 | RELATION r2[A*C] [SUR,UNI,INJ]
11 | RELATION r3[A*D]
12 |
13 | RELATION r5[X*B] -- should not point at sugar cube B, but at its root A
14 |
15 | -- No table should be shown for X and D, as wide tables with one column are basically scalars
16 | -- (fixing this will also remove disconnected concepts like E)
17 |
18 | RELATION x[X*X] -- creates sugar cube for X in old version, as assocs point to concept 'X' but corresponding class has sql name 'X1'
19 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue340.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue340 IN ENGLISH
2 |
3 | {- Checks all 16 combinations of UNI,TOT,INJ,SUR -}
4 |
5 | RELATION r[A*B]
6 |
7 | RELATION rUni[A*B] [UNI]
8 | RELATION rUniTot[A*B] [UNI,TOT]
9 | RELATION rUniInj[A*B] [UNI,INJ]
10 | RELATION rUniSur[A*B] [UNI,SUR]
11 |
12 | RELATION rUniTotInj[A*B] [UNI,TOT,INJ]
13 | RELATION rUniTotSur[A*B] [UNI,TOT,SUR]
14 | RELATION rUniInjSur[A*B] [UNI,INJ,SUR]
15 | RELATION rUniTotInjSur[A*B] [UNI,TOT,INJ,SUR]
16 |
17 | RELATION rTot[A*B] [TOT]
18 | RELATION rTotInj[A*B] [TOT,INJ]
19 | RELATION rTotSur[A*B] [TOT,SUR]
20 | RELATION rTotInjSur[A*B] [TOT,INJ,SUR]
21 |
22 | RELATION rInj[A*B] [INJ]
23 | RELATION rInjSur[A*B] [INJ,SUR]
24 |
25 | RELATION rSur[A*B] [SUR]
26 |
27 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue148.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue148 IN DUTCH
2 |
3 | REPRESENT Boolean TYPE BOOLEAN
4 | POPULATION Boolean CONTAINS [FALSE,TRUE]
5 |
6 | REPRESENT Date TYPE DATE
7 | POPULATION Date CONTAINS [ 2015-10-10 ]
8 | REPRESENT DateTime TYPE DATETIME
9 | POPULATION DateTime CONTAINS [ 2015-10-10T23:59:59Z
10 | , 2015-10-10T23:59:59+05:30
11 | , 2015-10-10T23:59:59-06:15
12 | , 2015-10-10T23:59Z
13 | , 2015-10-10T23:59:59.123Z
14 | ]
15 |
16 | REPRESENT Integer TYPE INTEGER
17 | POPULATION Integer CONTAINS [1 ,44, 3,5]
18 | REPRESENT Float TYPE FLOAT
19 | POPULATION Float CONTAINS [1 ,5.6756 , 3.5]
20 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Issue260.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue260 IN DUTCH
2 |
3 | RELATION r[A*B]
4 | REPRESENT B TYPE INTEGER
5 |
6 | POPULATION r CONTAINS
7 | [( "Foo" , 2 )]
8 |
9 | ENDCONTEXT
10 |
11 | {- This tiny script is perfectly allright. It could be succesfully compiled with Ampersand v3.2.0[master:62e159f*]
12 | However, it fails when using Ampersand v3.3.0[master:91e0569]
13 | It throws the following error:
14 |
15 | Error(s) found:
16 | Representation mismatch
17 | Found: `2`,
18 | as representation of an atom in concept `B`.
19 | However, the representation-type of that concept is (implicitly)
20 | defined as ALPHANUMERIC. The found value does not match that type.
21 | Error at symbol () in file Issue260.adl at line 7 : 15
22 | -}
--------------------------------------------------------------------------------
/src/Ampersand/Options/InputOutputOpts.hs:
--------------------------------------------------------------------------------
1 | module Ampersand.Options.InputOutputOpts (outputFileOptsParser) where
2 |
3 | import Ampersand.Basics
4 | import Ampersand.Misc.HasClasses (InputOutputOpts (..))
5 | import Ampersand.Options.FSpecGenOptsParser
6 | import Options.Applicative
7 |
8 | -- | Command-line parser for OutputFileOpts.
9 | outputFileOptsParser :: FilePath -> Parser InputOutputOpts
10 | outputFileOptsParser defOutputFile =
11 | InputOutputOpts
12 | <$> fSpecGenOptsParser False
13 | <*> outputfileP
14 | where
15 | outputfileP :: Parser FilePath
16 | outputfileP =
17 | strArgument
18 | ( metavar "OUTPUTFILE"
19 | <> value defOutputFile
20 | <> showDefault
21 | <> help "The name of the output file."
22 | )
23 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/ArchiTest3.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ArchiTest3 IN ENGLISH
2 |
3 | {- RJ/20130308: Als je de tweede definitie van 'connect' weggooit (regel 11), dan doet-ie het wel.
4 | -- RJ/20130308: Hij doet het ook als je in RULE R004 de hele signatuur meegeeft, als volgt:
5 | RULE R004: I[CommunicationPath] |- connect[Node * CommunicationPath]~; -I[Node]; connect[Node * CommunicationPath]
6 | -}
7 |
8 | PATTERN ArchiTest3
9 |
10 | RELATION connect[Node*Communicationpath] PRAGMA "Node " " is connected to Communication path ".
11 | RELATION connect[Device*Network] PRAGMA "Device " " is connected to network ".
12 |
13 | RULE R004: I[Communicationpath] |- connect~; -I[Node]; connect
14 | MEANING "A communication path connects two or more nodes."
15 |
16 | ENDPATTERN
17 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try2.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 | CLASSIFY A ISA AOrB
3 | CLASSIFY B ISA AOrB
4 |
5 | PATTERN Test2
6 | RELATION r[X*Y]
7 | RELATION s[X*A]
8 | RELATION t[B*Y]
9 | RELATION t[Q*Y]
10 | RULE Test: r = s;t[B*Y]
11 | CLASSIFY D IS A/\B
12 | -- was: RULE I[D] = I[A]/\I[B]
13 | -- RULE 'THING'[A] |- t[B*Y];V[Y*A] -- there is something of A in t
14 | ENDPATTERN
15 |
16 | ENDCONTEXT
17 |
18 | {-
19 | Purpose: This script shows that a type conflict (between A and B) can be resolved
20 | by defining an intersection type D.
21 | Besides, it shows that the type checker can choose the right type for
22 | subterm t, which is t[B*Y] (line 6)
23 | Result: PASS
24 | Reason: the type on ; is inferred as I[D]
25 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/Bugs/NoSentinel/Bug29_InterfaceRefLoop.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Bug29InterfaceRefLoop IN ENGLISH
2 | {- Context that yields an incorrect infinite loop error for interface refs in the new front-end.
3 | This script should fail because it uses Concepts A and B, which are not declared.
4 | They should occur in a relation declaration, a classify statement, or a concept definition.
5 | See issue
6 | -}
7 |
8 | INTERFACE Buggy FOR Dummy : I[SESSION]
9 | BOX [ "Ref" : V[SESSION*B] INTERFACE Ref -- is incorrectly recognized as an cyclic ref by the server
10 | ]
11 |
12 | REPRESENT A TYPE OBJECT
13 | INTERFACE Ref : V[B*A]
14 | BOX [ "Atom" : I[A]
15 | , "Ref2" : I[A] BOX
16 | [ "Raf" : V[A*A]
17 | , "Rbf" : V[A*B]
18 | ]
19 | ]
20 |
21 | ENDCONTEXT
22 |
--------------------------------------------------------------------------------
/outputTemplates/default.muse:
--------------------------------------------------------------------------------
1 | $if(author)$
2 | #author $for(author)$$author$$sep$; $endfor$
3 | $endif$
4 | $if(title)$
5 | #title $title$
6 | $endif$
7 | $if(lang)$
8 | #lang $lang$
9 | $endif$
10 | $if(LISTtitle)$
11 | #LISTtitle $LISTtitle$
12 | $endif$
13 | $if(subtitle)$
14 | #subtitle $subtitle$
15 | $endif$
16 | $if(SORTauthors)$
17 | #SORTauthors $SORTauthors$
18 | $endif$
19 | $if(SORTtopics)$
20 | #SORTtopics $SORTtopics$
21 | $endif$
22 | $if(date)$
23 | #date $date$
24 | $endif$
25 | $if(notes)$
26 | #notes $notes$
27 | $endif$
28 | $if(source)$
29 | #source $source$
30 | $endif$
31 |
32 | $for(header-includes)$
33 | $header-includes$
34 |
35 | $endfor$
36 | $for(include-before)$
37 | $include-before$
38 |
39 | $endfor$
40 | $body$
41 | $for(include-after)$
42 |
43 | $include-after$
44 | $endfor$
45 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/validate/Issue148.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Issue148 IN DUTCH
2 |
3 | REPRESENT Boolean TYPE BOOLEAN
4 | POPULATION Boolean CONTAINS [FALSE,TRUE]
5 |
6 | REPRESENT Date TYPE DATE
7 | POPULATION Date CONTAINS [ 2015-10-10 ]
8 | REPRESENT DateTime TYPE DATETIME
9 | POPULATION DateTime CONTAINS [ 2015-10-10T23:59:59Z
10 | , 2015-10-10T23:59:59+05:30
11 | , 2015-10-10T23:59:59-06:15
12 | , 2015-10-10T23:59Z
13 | , 2015-10-10T23:59:59.123Z
14 | ]
15 |
16 | REPRESENT Integer TYPE INTEGER
17 | POPULATION Integer CONTAINS [1 ,44, 3,5]
18 | REPRESENT Float TYPE FLOAT
19 | POPULATION Float CONTAINS [1 ,5.6756 , 3.5]
20 |
21 |
22 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/FraakTest2.adl:
--------------------------------------------------------------------------------
1 | CONTEXT FraakTest2 IN ENGLISH
2 |
3 | {-Prototype.exe (Ampersand v2.2.1.1016, build time: 6-May-13 13:46.54) geeft de volgende fouten:
4 | Checking on rule violations...
5 | Inconsistencies in rule "TOT Beamer[Beamer*Resource]":
6 | - [("Beamer 001","Beamer 001"),("Beamer Gn 1.147","Beamer Gn 1.147")]
7 |
8 | Inconsistencies in rule "TOT Room[Room*Resource]":
9 | - [("Gn secretariaat","Gn secretariaat"),("Gn 1.147","Gn 1.147")]
10 | -}
11 |
12 | PATTERN FraakTest2
13 |
14 | CLASSIFY Room ISA Resource
15 | CLASSIFY Beamer ISA Resource
16 |
17 | RELATION beamerLocation[Beamer*Room]
18 |
19 | ENDPATTERN
20 |
21 | POPULATION beamerLocation CONTAINS
22 | [ ("Beamer 001", "Gn secretariaat")
23 | ; ("Beamer Gn 1.147", "Gn 1.147")
24 | ]
25 |
26 | ENDCONTEXT
--------------------------------------------------------------------------------
/miscellaneous/Berichten/lib/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
Documentation
9 |
10 | Het bevorderen van eenheid in taal ten bate van effectieve gegevensuitwisseling en
11 | informatiedeling is een belangrijke voorwaarde om onder meer een integer en integraal
12 | persoonsbeeld te kunnen bieden. Centrale ondersteuning daarbij is voor de ketenpartners
13 | gewenst en zelfs als noodzakelijk geacht. De Justitiele Informatiedienst (JustID)
14 | heeft daarvoor een aparte dienst in huis: EBV (wat formeel staat voor Elektronisch
15 | BerichtenVerkeer).
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/testing/StillUnsupported/Issue166.adl:
--------------------------------------------------------------------------------
1 | CONTEXT SinterklaasTest IN DUTCH
2 |
3 | RULE toBeOrNotToBe : -'Sinterklaas'[Persoon]
4 | MEANING "De persoon 'Sinterklaas' bestaat niet."
5 |
6 | ENDCONTEXT
7 |
8 | {- This test is all about the question of what is in the initial population.
9 | Are singletons, mentioned in terms only, part of that population?
10 |
11 | Currently, a singleton is part of the initial population. In this case, a prototype cannot be generated,
12 | It gives the following error message:
13 |
14 | Checking on rule violations...
15 | Inconsistencies in rule "toBeOrNotToBe":
16 | - [("Sinterklaas","Sinterklaas")]
17 |
18 | Signals for initial population:
19 | Conjunct: -'Sinterklaas'[Persoon]
20 | - [("Sinterklaas","Sinterklaas")]
21 |
22 | ERROR: No prototype generated because of rule violations.
23 |
24 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/Try1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try1 IN ENGLISH
2 |
3 | PATTERN Try1
4 | RELATION r[A*B]
5 | CLASSIFY A ISA B
6 | RULE r |- (V[A*A]-I[B]) ; r
7 | RULE r |- (V[A*B]-I[B]) ; r
8 | RULE r |- (V[B*A]-I[B]) ; r
9 | RULE r |- (V[B*B]-I[B]) ; r
10 | RULE r |- -I[B] ; r
11 | ENDPATTERN
12 |
13 | ENDCONTEXT
14 | {-
15 | Purpose: to expose the ambiguity in the complement of I[B] (line 10).
16 | Result: FAIL
17 | Reason: The user should pick one of the alternatives above, each of which is acceptable.
18 |
19 | Message:
20 | line 10:20, file "Try1.adl":
21 | The complement of I[B] is ambiguous with respect to
22 | concepts A and B.
23 | Use (V[ * ]-I[B]) to disambiguate the complement.
24 | -}
--------------------------------------------------------------------------------
/.github/workflows/triggerDocsUpdate.yml:
--------------------------------------------------------------------------------
1 | # Workflow to update documentation on our landingpage AmpersandTarski.gihub.io
2 | name: Trigger Documentation Update
3 |
4 | on:
5 | push:
6 | branches:
7 | - main
8 | - documentation
9 | paths:
10 | - "docs/**"
11 |
12 | jobs:
13 | deploy:
14 | runs-on: ubuntu-22.04
15 | steps:
16 | # Trigger the "DeployToPages" workflow in the "AmpersandTarski.github.io" repository
17 | - run: |
18 | curl -XPOST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" \
19 | -H "Accept: application/vnd.github.everest-preview+json" -H \
20 | "Content-Type: application/json" https://api.github.com/repos/AmpersandTarski/AmpersandTarski.github.io/actions/workflows/DeployToPages.yml/dispatches \
21 | --data '{"ref": "main"}'
22 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try13b.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test13
4 | RELATION r[A*A]
5 | RELATION r[B*C]
6 | RULE T1: r = r[A*A]/\I
7 | RULE T2: r = r[A*A]\/I
8 | RULE T5: r = r[A*A];I
9 | RULE T6: r = r[B*C];I
10 | RULE T7: r = r[A*A]!I
11 | RULE T8: r = r[B*C]!I
12 | ENDPATTERN
13 |
14 | ENDCONTEXT
15 |
16 | {-
17 | Purpose: a superficial check on type deduction
18 | Result: PASS
19 | Reason: The type of I cannot always be determined from its context
20 | The following type errors have been found in the past:
21 |
22 | line 7:8, file "try13.adl"
23 | Ambiguous equation r = r[A*A] \/ I
24 |
25 | line 10:8, file "try13.adl"
26 | Ambiguous equation r = r[A*A]!I
27 |
28 | line 11:8, file "try13.adl"
29 | Ambiguous equation r = r[B*C]!I
30 |
31 | -}
--------------------------------------------------------------------------------
/AmpersandData/Repo Interfaces/admin_interfaces.ifc:
--------------------------------------------------------------------------------
1 | CONTEXT Atlas IN ENGLISH
2 | INTERFACE# Files FOR Admin: I[ONE]
3 | BOX ["loaded files": V[ONE*File];(sourcefile~;sourcefile \/ parseerror;parseerror~ \/ typeerror;typeerror~)
4 | BOX ["name":filename
5 | ,"dir":filepath
6 | ,"created at":filetime
7 | ,"first loaded with":firstloadedwith
8 | ,"syntax error":parseerror BOX [act:pe_action,pos:pe_position,exp:pe_expecting]
9 | ,"type error":typeerror BOX [msg:te_message]
10 | ,"context" : sourcefile~
11 | BOX ["name":ctxnm
12 | ,"source files":(sourcefile \/ includes);filename
13 | ,"number of rules":countrules
14 | ,"number of relations":countdecls
15 | ,"number of concepts":countcpts]
16 | ]
17 | ]
18 | ENDCONTEXT
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Ampersand/Options/DevoutputOptsParser.hs:
--------------------------------------------------------------------------------
1 | module Ampersand.Options.DevoutputOptsParser (devoutputOptsParser) where
2 |
3 | import Ampersand.Basics
4 | import Ampersand.Misc.HasClasses (DevOutputOpts (..))
5 | import Ampersand.Options.FSpecGenOptsParser
6 | import Options.Applicative
7 |
8 | -- | Command-line parser for DevOutputOpts.
9 | devoutputOptsParser :: FilePath -> Parser DevOutputOpts
10 | devoutputOptsParser defOutputdir =
11 | DevOutputOpts
12 | <$> fSpecGenOptsParser False
13 | <*> outputdirP
14 | where
15 | outputdirP :: Parser FilePath
16 | outputdirP =
17 | strArgument
18 | ( metavar "OUTPUTDIRECTORY"
19 | <> value defOutputdir
20 | <> showDefault
21 | <> help "The name of the directory where the diagnostic files will be written to."
22 | )
23 |
--------------------------------------------------------------------------------
/src/Ampersand/Options/DaemonParser.hs:
--------------------------------------------------------------------------------
1 | module Ampersand.Options.DaemonParser where
2 |
3 | import Ampersand.Basics
4 | import Ampersand.Misc.HasClasses
5 | import Ampersand.Options.FSpecGenOptsParser
6 | import Options.Applicative
7 | import Options.Applicative.Builder.Extra (boolFlags)
8 |
9 | -- | Command-line parser for the daemon command.
10 | daemonOptsParser :: Parser DaemonOpts
11 | daemonOptsParser =
12 | DaemonOpts
13 | <$> strOption
14 | ( long "daemonconfig"
15 | <> metavar "CONFIGFILE"
16 | <> value ".ampersand"
17 | <> showDefault
18 | <> help "The config file contains the list of files to be monitored."
19 | )
20 | <*> fSpecGenOptsParser True
21 | <*> boolFlags
22 | True
23 | "warnings"
24 | "show warnings in the output, if any. "
25 | mempty
26 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/TTypeTest1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT TtypesTest IN ENGLISH
2 |
3 | RELATION huisnummer[NAW*Huisnummer] [TOT,UNI]
4 | REPRESENT Huisnummer TYPE INTEGER
5 | RELATION straat[NAW*Straat] [TOT,UNI]
6 | RELATION woonplaats[NAW*Woonplaats] [TOT,UNI]
7 | RELATION foto[NAW*Foto] [UNI]
8 | REPRESENT Foto TYPE BINARY
9 |
10 | POPULATION huisnummer CONTAINS [ ("adres van Han" , 12) ]
11 | POPULATION straat CONTAINS [ ("adres van Han" , "Eikenlaan") ]
12 | POPULATION woonplaats CONTAINS [ ("adres van Han" , "Peize") ]
13 |
14 |
15 | INTERFACE Adressen FOR admin : "_SESSION"[SESSION]
16 | BOX ["Adressen" : V[SESSION*NAW]
17 | ]
18 | INTERFACE Adres FOR admin :I[NAW]
19 | BOX [ ie: I
20 | , huisnummer : huisnummer
21 | , straat : straat
22 | , woonplaats : woonplaats
23 | ]
24 |
25 |
26 | ENDCONTEXT
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try19.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try19 IN ENGLISH
2 | PATTERN Try19
3 |
4 | RELATION orderedBy[Order*Client]
5 | RELATION orderReceived[Order*Client]
6 | RELATION orderAccepted[Order*Vendor]
7 |
8 | RULE allReceived: orderedBy |- (orderReceived; orderReceived~ /\ -(orderAccepted; V[Vendor * Order])); orderedBy -- == TOT extended to allow hyperlinking to vendor in violation
9 | MEANING "All accepted orders have been received"
10 |
11 | ENDPATTERN
12 |
13 | ENDCONTEXT
14 |
15 | {-
16 | Purpose: This file illustrates the need for a "closed world assumption".
17 | For practical purposes, we need to be able to say 'not'. For example:
18 | For each order that has been ordered by a client, must either be a client to receive that order, or it has not (yet) been accepted by a vendor.
19 | Desired Result: PASS
20 | -}
--------------------------------------------------------------------------------
/src/Ampersand/Basics.hs:
--------------------------------------------------------------------------------
1 | module Ampersand.Basics
2 | ( module Ampersand.Basics.Auxiliaries,
3 | module Ampersand.Basics.Exit,
4 | module Ampersand.Basics.Hashing,
5 | module Ampersand.Basics.Languages,
6 | module Ampersand.Basics.Name,
7 | module Ampersand.Basics.PandocExtended,
8 | module Ampersand.Basics.Prelude,
9 | module Ampersand.Basics.String,
10 | module Ampersand.Basics.Unique,
11 | module Ampersand.Basics.Version,
12 | )
13 | where
14 |
15 | import Ampersand.Basics.Auxiliaries
16 | import Ampersand.Basics.Exit
17 | import Ampersand.Basics.Hashing
18 | import Ampersand.Basics.Languages
19 | import Ampersand.Basics.Name
20 | import Ampersand.Basics.PandocExtended
21 | import Ampersand.Basics.Prelude
22 | import Ampersand.Basics.String
23 | import Ampersand.Basics.Unique
24 | import Ampersand.Basics.Version
25 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try40.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try40 IN ENGLISH
2 |
3 | RELATION orderUnit[Order*Unit]
4 |
5 | RELATION unitID[Unit*UnitID] [TOT]
6 | =[ ("11 LMB", "11 Luchtmobiele Brigade")
7 | ; ("11 INFbat", "11 Infanterie Bataljon")
8 | ; ("11 INFbat", "Garderegiment Grenadiers en Jagers")
9 | ]
10 |
11 | POPULATION orderUnit CONTAINS [ ("Order_1", "11 LMB") ]
12 |
13 | ENDCONTEXT
14 |
15 | {-
16 | Purpose: This script is because of ticket #374
17 | exeucting this with Prototype.exe v3.0.1.2828 results in the following
18 | errors:
19 |
20 | Checking on rule violations...
21 | Inconsistencies in rule "TOT unitID[Unit*UnitID]":
22 | - [("11 LMB","11 LMB")]
23 |
24 | ERROR: No prototype generated because of rule violations.
25 | (Compile with --dev to generate a prototype regardless of violations)
26 | -}
27 |
--------------------------------------------------------------------------------
/outputTemplates/default.docbook5:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 | $title$
14 | $if(subtitle)$
15 | $subtitle$
16 | $endif$
17 | $if(author)$
18 |
19 | $for(author)$
20 |
21 | $author$
22 |
23 | $endfor$
24 |
25 | $endif$
26 | $if(date)$
27 | $date$
28 | $endif$
29 |
30 | $for(include-before)$
31 | $include-before$
32 | $endfor$
33 | $body$
34 | $for(include-after)$
35 | $include-after$
36 | $endfor$
37 |
38 |
--------------------------------------------------------------------------------
/src/Ampersand/Output/ToJSON/Settings.hs:
--------------------------------------------------------------------------------
1 | {-# LANGUAGE DeriveGeneric #-}
2 | {-# LANGUAGE MultiParamTypeClasses #-}
3 |
4 | module Ampersand.Output.ToJSON.Settings (Settings) where
5 |
6 | import Ampersand.Output.ToJSON.JSONutils
7 |
8 | data Settings = Settings
9 | { sngJSONglobal_contextName :: Text,
10 | sngJSONcompiler_version :: Text,
11 | sngJSONcompiler_env :: Text,
12 | sngJSONcompiler_modelHash :: Text
13 | }
14 | deriving (Generic, Show)
15 |
16 | instance ToJSON Settings where
17 | toJSON = amp2Jason'
18 |
19 | instance JSON' FSpec Settings where
20 | fromAmpersand' env fSpec _ =
21 | Settings
22 | { sngJSONglobal_contextName = fullName fSpec,
23 | sngJSONcompiler_version = longVersion appVersion,
24 | sngJSONcompiler_env = tshow env,
25 | sngJSONcompiler_modelHash = tshow . hash $ fSpec
26 | }
27 |
--------------------------------------------------------------------------------
/AmpersandData/Semantics/Authorisation.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Authorisation IN ENGLISH
2 |
3 | INCLUDE "Login.adl"
4 | PATTERN Authorizations
5 | PURPOSE PATTERN Authorizations
6 | {+
7 | +}
8 | PURPOSE RELATION owner[Context*Account]
9 | {+In RAP, every context must have one owner, who can exercise all ownership rights that contexts have.
10 | Initially, the creator of a context is its owner.
11 | +}
12 | RELATION owner[Context*Account] [UNI]
13 | MEANING "A context has an owner, which is an account."
14 | ROLE ExecEngine MAINTAINS TOTowner
15 | RULE TOTowner : (I[Context]#"_SESSION"[SESSION]);ingelogd |- owner[Context*Account]
16 | MEANING "The creator of a context is the account that was logged in when the context was created."
17 | VIOLATION ( TXT "{EX} InsPair;owner[Context*Account];Context;", SRC I, TXT ";Account;", TGT I )
18 | ENDPATTERN
19 |
20 | ENDCONTEXT
--------------------------------------------------------------------------------
/ArchitectureAndDesign/Syntax/README.md:
--------------------------------------------------------------------------------
1 | # Railroad diagrams of syntax
2 |
3 |
4 | The [railroad diagram of the current student version](https://rawgit.com/AmpersandTarski/ampersand/master/ArchitectureAndDesign/Syntax/Current%20Student%20version/ui.xhtml) is the syntax as it is currently in use at the course [Ontwerpen met bedrijfsregels, course T18311] (http://portal.ou.nl/web/ontwerpen-met-bedrijfsregels/cursusinformatie) of the [Open University](www.ou.nl).
5 |
6 | In the underlying folders you can find .ebnf files of specific versions of Ampersand. These files can be used to [generate Railroad diagrams at the site of Gunther Rademacher] (http://www.bottlecaps.de/rr/ui)
7 |
8 | Unfortunately there is currently no way to automatically keep the .ebnf files in sync with the Ampersand parser sourcecode. Therefore, the actual syntax may differ from what is mentioned in the .ebnf files.
9 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/Try41.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try41 IN ENGLISH
2 | CLASSIFY ONE ISA A
3 | RELATION r[ONE*B]
4 | RELATION s[A*B]
5 | RULE s/\r
6 | ENDCONTEXT
7 |
8 | {-
9 | Purpose: This script is meant show that ONE is not an ordinary concept.
10 | Result: FAIL
11 | Reason: ONE is the universal singleton concept, so:
12 | 1. I[ONE]=V[ONE*ONE]
13 | 2. If ONE ISA A, and we would show the atoms of A in an interface, we could see the representation of the atom that is the instance of ONE.
14 | Because ONE represents the universal singleton, we do not wish to represent its contents. Ever.
15 | So ONE ISA A should result in a failure.
16 | Error message:
17 | The current error message is a syntax error. That is not the right kind of error, so we should make a ticket for that.
18 |
19 | -}
--------------------------------------------------------------------------------
/outputTemplates/default.docbook4:
--------------------------------------------------------------------------------
1 |
2 | $if(mathml)$
3 |
5 | $else$
6 |
8 | $endif$
9 |
10 |
11 | $title$
12 | $if(author)$
13 |
14 | $for(author)$
15 |
16 | $author$
17 |
18 | $endfor$
19 |
20 | $endif$
21 | $if(date)$
22 | $date$
23 | $endif$
24 |
25 | $for(include-before)$
26 | $include-before$
27 | $endfor$
28 | $body$
29 | $for(include-after)$
30 | $include-after$
31 | $endfor$
32 |
33 |
--------------------------------------------------------------------------------
/AmpersandData/PrototypeContext/PrototypeContext.adl:
--------------------------------------------------------------------------------
1 | CONTEXT PrototypeContext IN ENGLISH
2 |
3 | INCLUDE "Interfaces.adl"
4 | INCLUDE "Interfaces.ifc"
5 |
6 | INCLUDE "Navbar.adl"
7 | INCLUDE "Navbar.ifc"
8 |
9 | INCLUDE "Roles.adl"
10 |
11 | RELATION PrototypeContext.sessionAllowedRoles[SESSION*PrototypeContext.Role]
12 | RELATION PrototypeContext.sessionActiveRoles[SESSION*PrototypeContext.Role]
13 |
14 | RULE PrototypeContext.ActiveRoles LABEL "Active roles MUST be a subset of allowed roles" : -- This rule is required for the access control mechanism.
15 | PrototypeContext.sessionActiveRoles |- PrototypeContext.sessionAllowedRoles -- It ensures that only allowed roles can be activated.
16 |
17 | REPRESENT PrototypeContext.DateTime TYPE DATETIME
18 | RELATION PrototypeContext.lastAccess[SESSION*PrototypeContext.DateTime] [UNI]
19 |
20 | ENDCONTEXT
21 |
--------------------------------------------------------------------------------
/src/Ampersand/Output/ToPandoc.hs:
--------------------------------------------------------------------------------
1 | module Ampersand.Output.ToPandoc
2 | ( module Ampersand.Output.ToPandoc.ChapterIntroduction,
3 | module Ampersand.Output.ToPandoc.ChapterNatLangReqs,
4 | module Ampersand.Output.ToPandoc.ChapterDiagnosis,
5 | module Ampersand.Output.ToPandoc.ChapterConceptualAnalysis,
6 | module Ampersand.Output.ToPandoc.ChapterDataAnalysis,
7 | module Ampersand.Output.ToPandoc.SharedAmongChapters,
8 | )
9 | where
10 |
11 | import Ampersand.Output.ToPandoc.ChapterConceptualAnalysis (chpConceptualAnalysis)
12 | import Ampersand.Output.ToPandoc.ChapterDataAnalysis (chpDataAnalysis)
13 | import Ampersand.Output.ToPandoc.ChapterDiagnosis (chpDiagnosis)
14 | import Ampersand.Output.ToPandoc.ChapterIntroduction (chpIntroduction)
15 | import Ampersand.Output.ToPandoc.ChapterNatLangReqs (chpNatLangReqs)
16 | import Ampersand.Output.ToPandoc.SharedAmongChapters
17 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/ARM20-Test2.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARM20Test2 IN DUTCH
2 | --$ Ondertaand pattern geeft een beoogde fout -}
3 | ------------------------------------------------------------
4 | PATTERN ARM20Test2
5 |
6 | RELATION critBF[Criterium*Bedrijfsfunctie] [MAP] PRAGMA "" " wordt gehanteerd binnen "
7 | CLASSIFY Verwachting ISA Criterium
8 | RELATION expID[Verwachting*ExpectationID] [MAP] PRAGMA "" "staat in de business bekend als"
9 |
10 | VIEW Verwachtingen: Verwachting(critBF, expID)
11 | --$FOUTMELDING voor bovenstaande regel:
12 | --!Type mismatch for the equality arising at critBF.
13 | --!The source of I[Verwachting] is Verwachting.
14 | --!The source of critBF is Criterium.
15 | --?Fout kan worden 'opgelost' door VIEW Verwachtingen: Verwachting(I[Verwachting];critBF, expID)
16 |
17 | ENDPATTERN
18 | ------------------------------------------------------------
19 | ENDCONTEXT
20 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/Preprocessor/includes/PreprocTest.adl:
--------------------------------------------------------------------------------
1 | CONTEXT PreprocTest1
2 |
3 | INCLUDE "./PreprocTestPopulation.adl" --# [ "!GenerateErrorIfThisVarIsSet" ]
4 |
5 | RELATION r1[A*B1]
6 | RELATION r2[A*B2]
7 |
8 | INTERFACE Test: I[SESSION] cRud BOX
12 | [ "A = ": I[A] cRud
13 | --#IF EditableInterfaceA
14 | --#IFNOT DoNotShowR1
15 | , "r1": r1 cRUd
16 | --# ENDIF
17 | --#IF ShowR2
18 | , "r2": r2 cRUd
19 | --#ENDIF
20 | --#ENDIF
21 | --#IFNOT EditableInterfaceA
22 | --#IFNOT DoNotShowR1
23 | , "r1": r1 cRud
24 | --#ENDIF
25 | --#IF ShowR2
26 | , "r2": r2 cRud
27 | --#ENDIF
28 | --#ENDIF
29 | ]
30 | ]
31 |
32 | --#IF ErrorIfUnset
33 | ENDCONTEXT
34 | --#ENDIF
35 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldFail/ParserOrTypecheckFailures/try7.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Test IN ENGLISH
2 |
3 | PATTERN Test7
4 | RELATION r[A*C]
5 | RELATION s[A*B]
6 | RELATION t[B*C]
7 | RULE r = s;t
8 | RULE r |- s;t
9 | RULE s;t
10 | RULE r;(s=t)
11 | ENDPATTERN
12 |
13 | ENDCONTEXT
14 |
15 | {-
16 | Purpose: This script that there are three types of rules: an equivalence, an implication, and an term.
17 | It also shows that the equivalence cannot be used inside another rule, which holds for the implication as well.
18 | Result: FAIL
19 | Reason: the rule on line 10 will not parse.
20 | Error message:
21 |
22 | Parse error:
23 |
24 | Expecting symbol ) or symbol [ or "!" or "*" or "-" or "/" or "/\\" or ";" or "\
25 | \" or "\\/" or ("*" or "+" or "~" ...)*
26 | before "=" at line 10, column 10 of file "try7.adl"
27 | Try inserting symbol symbol )
28 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/try42.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try42 IN ENGLISH
2 |
3 | RELATION s[A*B] [UNI]
4 |
5 | INTERFACE Interf1 : I[ONE]
6 | BOX[ "Box1" : V[ONE*A];
7 | (I /\ I /\ s;s~
8 | )
9 | ]
10 | ENDCONTEXT
11 |
12 | {-
13 | Purpose: a superficial check on type deduction
14 | Result: PASS
15 | Reason: The type of I cannot always be determined from its context
16 | The following type errors have been found in the past:
17 |
18 | prototype: !fatal 428 (module Core.AbstractSyntaxTree) Ampersand v3.0.1.1261:126
19 | 2M
20 | Cannot intersect (with operator "/\") term
21 | EDcV [ONE*A]
22 | with EIsc (EDcI A,ECps (EDcD RELATION s [A*B] Nothing PRAGMA "" "" "",EFlp (E
23 | DcD RELATION s [A*B] Nothing PRAGMA "" "" ""))).
24 |
25 | NOTE In version v3.0.1.1261 this error occurs, but it dissapears when the term in the box is simplified to : (I /\ s;s~ )
26 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/ARM20-Test6.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARM20Test6 IN DUTCH
2 | {-Het onderstaande script geeft de volgende output:
3 |
4 | "C:\Ampersand\AMPprogs\ampersand.exe" "ARM20-Test6" -o".\fspec" --fspec=Latex --language=EN
5 |
6 | ampersand.exe: !fatal error 167 (module Output.ToPandoc.ChapterDataAnalysis.hs, Ampersand v
7 | 2.2.1.1079)
8 | This should have become an attribute of this Class!
9 |
10 | Observaties:
11 | 1) Als je de woorden PATTERN en ENDPATTERN verwijdert, deze fout niet meer optreedt!
12 | 2) Als je [INJ] verwijdert is de fout ook weg.
13 | -}
14 | ------------------------------------------------------------
15 | PATTERN ARM20Test6 LABEL "ARM20-Test6"
16 |
17 | RELATION bfEigenaar[Bedrijfsfunctie*BFeigenaar]
18 |
19 | RELATION biaBF[BIAlijst*Bedrijfsfunctie] [INJ]
20 |
21 | ENDPATTERN
22 | ------------------------------------------------------------
23 | ENDCONTEXT
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ampersand
2 |
3 | [](https://github.com/AmpersandTarski/Ampersand/actions/workflows/ci2.yml)
4 | [](https://github.com/AmpersandTarski/Ampersand/releases/latest)
5 |
6 | ## Releases
7 |
8 | Check out the [release notes](https://github.com/AmpersandTarski/Ampersand/blob/main/ReleaseNotes.md) and [](https://github.com/AmpersandTarski/Ampersand/releases)
9 |
10 | ## Documentation
11 |
12 | Our [documentation](https://ampersandtarski.github.io/) features full-text search and it contains all documentation of several repositories in a single place. We are still [working](https://github.com/AmpersandTarski/Ampersand/issues/1315) on structuring it.
13 |
--------------------------------------------------------------------------------
/docs/landingpage/2-student.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: For students
3 | ---
4 |
5 | # What can I learn on this site?
6 |
7 | If you are excited and eager to learn how to use Ampersand, you have come to the right place.
8 | You can learn about the language Ampersand, and learn how to make a prototype of an information system and run it.
9 |
10 | ## Get started
11 |
12 | - Do the [tutorial](../tutorial-rap4), to get an idea of an Ampersand application
13 | - Learn about the [syntax of Ampersand](../reference-material/syntax-of-ampersand), to write correct Ampersand code.
14 | - Learn about [relation algebra](https://en.wikipedia.org/wiki/Relational_algebra) on Wikipedia, to understand more about this fascinating field of mathematics.
15 | - Find [examples](../examples) of Ampersand specifications, to get started making your own.
16 | - Find [exercises](../exercises.md) that help you improve your skills in specifying information systems.
17 |
--------------------------------------------------------------------------------
/miscellaneous/Berichten/lib/menu.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
19 | [ atom : I
20 | , pop : pop
21 | , "Viewable by" : pop;viewBy;concept~
22 | ]
23 | , Views : V[SESSION*View]
24 | BOX
25 | [ View : I
26 | , concept : concept
27 | , Concepts : concept;viewBy~
28 | ]
29 | ]
30 |
31 | ENDCONTEXT
--------------------------------------------------------------------------------
/docs/troubleshooting.md:
--------------------------------------------------------------------------------
1 | # Troubleshooting
2 | Whenever you run into problems with Ampersand, and you cannot find what you are looking for in this documentation, have a look at the common problems below. When your problem isn't there, see if you can find an issue for it. Otherwise, do one of:
3 |
4 | 1. If your problem is with this documentation (you miss some explanation), or just [file an issue that is specific for this documentation](http://github.com/AmpersandTarski/Ampersand/issues) .
5 | 2. If your problem is with the ampersand method or tooling, you can [file an issue that is specific for Ampersand itself](http://github.com/AmpersandTarski/ampersand/issues).
6 |
7 | ## Common Problems
8 |
11 | 1. The documentation is far from complete. We are working on it though. If you are stuck, please create an issue! You are more than welcome!
12 |
13 |
--------------------------------------------------------------------------------
/testing/Travis/testcases/prototype/shouldSucceed/Try52.adl:
--------------------------------------------------------------------------------
1 | CONTEXT Try52 IN DUTCH
2 |
3 | PATTERN Test
4 | RELATION r[A*B]
5 | RELATION r[C*D]
6 | ENDPATTERN
7 |
8 | INTERFACE Overview : I[ONE]
9 | BOX [ "r[A*B]" : V[ONE*A] BOX [ "r[A*B]" : r[A*B] ]
10 | , "r[C*D]" : V[ONE*C] BOX [ "r[C*D]" : r[C*D] ]
11 | ]
12 |
13 | INTERFACE fromA : I[A]
14 | BOX [ "I" LABEL "" : I
15 | , "r[A*B]" : r[A*B]
16 | ]
17 |
18 | INTERFACE fromC : I[C]
19 | BOX [ "I" LABEL "" : I
20 | , "r[C*D]" : r[C*D]
21 | ]
22 |
23 | ENDCONTEXT
24 | {-The purpose of this test is to check whether overloading works.
25 | The following experiment should succeed:
26 | compile a prototype with
27 | D:>Prototype --verbose -pD:\htdocs\klad Try52.adl
28 | Then try to insert tuples in r[A*B] and r[C*D] and verify that they are registered in the correct place.
29 |
30 | Note that the sentinel cannot perform this test (yet?), so it must be performed by hand.
31 | -}
--------------------------------------------------------------------------------
/testing/Travis/testcases/Misc/ARM-Test1.adl:
--------------------------------------------------------------------------------
1 | CONTEXT ARMTest1 IN ENGLISH
2 |
3 | RELATION critBF[Criterium*Bedrijfsfunctie] [MAP]
4 | RELATION critTAV[Criterium*Bedrijfsfunctie] [MAP]
5 | RELATION biaVerplichtingDef[Bedrijfsfunctie*Verplichting] [INJ]
6 |
7 | CLASSIFY Verplichting ISA Criterium
8 | CLASSIFY ExterneVerplichting ISA Verplichting
9 |
10 | RULE BIAlijstIntegriteit LABEL "BIAlijst integriteit" : -- Invariant
11 | biaVerplichtingDef |- biaVerplichtingDef;I[ExterneVerplichting]
12 | MEANING "De BIA-lijst bevat alleen externe verplichtingen."
13 | VIOLATION (TXT "De BIA-lijst van ", SRC I, TXT " mag alleen externe verplichtingen bevatten; ", TGT I[Verplichting], TXT " is dat niet.")
14 |
15 | ENDCONTEXT
16 |
17 | {- prototype.exe v3.0.1.2953.exe: !fatal 36 (module ADL1.Disambiguate) Ampersand v3.0.1.1297
18 | Types of concepts are not defined here
19 |
20 | Deze foutmelding verdwijnt als de VIOLATION op regel 13 wordt verwijderd.
21 | -}
22 |
--------------------------------------------------------------------------------