-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit tests for "check over" ETL operator
- Loading branch information
1 parent
e79dde9
commit 676b8ba
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/test/resources/testModels/libraries/ETL_test/CheckOver.crml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
model CheckOver is { | ||
// Operators on Boolean | ||
// Logical disjunction | ||
Template b1 'or' b2 = not (not b1 and not b2); | ||
|
||
// Operators for the evaluation of requirements | ||
// Check | ||
Operator [ Boolean ] 'check' Boolean phi 'over' Periods P | ||
= and ('evaluate' phi 'over' P); | ||
|
||
// Decide | ||
Operator 'decide' is | ||
Operator [ Boolean ] 'decide' Boolean phi 'over' Period P = phi 'or' (P end)); | ||
|
||
// Evaluate | ||
Operator [ Boolean ] 'evaluate' Boolean phi 'over' Period P | ||
= integrate (('decide' phi 'over' P) * phi) on P; | ||
|
||
// Example of function call | ||
Boolean phi1 is external; | ||
Period P1 is external; | ||
|
||
Boolean b_check_over is 'check' phi1 'over' P1; | ||
}; |
25 changes: 25 additions & 0 deletions
25
src/test/resources/testModels/libraries/ETL_test/CheckOver_no_ext.crml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
model EvaluateOver_no_ext is { | ||
// Operators on Boolean | ||
// Logical disjunction | ||
Template b1 'or' b2 = not (not b1 and not b2); | ||
|
||
// Operators for the evaluation of requirements | ||
// Check | ||
Operator [ Boolean ] 'check' Boolean phi 'over' Periods P | ||
= and ('evaluate' phi 'over' P); | ||
|
||
// Decide | ||
Operator 'decide' is | ||
Operator [ Boolean ] 'decide' Boolean phi 'over' Period P = phi 'or' (P end)); | ||
|
||
// Evaluate | ||
Operator [ Boolean ] 'evaluate' Boolean phi 'over' Period P | ||
= integrate (('decide' phi 'over' P) * phi) on P; | ||
|
||
// Example of function call | ||
Boolean phi1 is if 2.0 < time and time < 3.5 then true else false; | ||
Boolean b1 is if 2.5 < time and time < 5 then true else false; | ||
Period P1 is [b1, not b1]; | ||
|
||
Boolean b_check_over is 'evaluate' phi1 'over' P1; | ||
}; |