source: CIVL/mods/dev.civl.com/examples/modelbuilder/conditionalCastNorm.cvl@ cb4d4f4

main test-branch
Last change on this file since cb4d4f4 was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 688 bytes
Line 
1/* CIVL v1.18 will crash on this example (when z3 or cvc4 is used)
2 because in CIVL model, the conditional expression has an int type
3 true branch and an bool type false branch. The type inconsistency
4 is due to the fact that an implicit cast on the conditional
5 expression doesn't get applied to branches. So we decided that a
6 normal form of a cast on a conditional expression will be that the
7 cast will recursively applied to its branches. */
8$input int N;
9$input int M;
10$input int a[N];
11$input int b[N];
12$assume($forall (int i : 0 .. N-1) a[i] == b[i]);
13
14int main() {
15 $assert($forall (int i : 0 .. N-1)
16 i < M ? a[i] == b[i] : i >= M ? 1 : a[i] != b[i] + 1
17 );
18}
Note: See TracBrowser for help on using the repository browser.