Skip to content

Commit

Permalink
unit tests for "check over" ETL operator
Browse files Browse the repository at this point in the history
  • Loading branch information
audrey-jardin committed Sep 29, 2023
1 parent e79dde9 commit 676b8ba
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/resources/testModels/libraries/ETL_test/CheckOver.crml
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;
};
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;
};

0 comments on commit 676b8ba

Please sign in to comment.