source: CIVL/examples/reasoning/stepedUniversal.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 761 bytes
Line 
1$input int N;
2$assume(N > 10);
3$input double x[N];
4
5int main() {
6 $assume($forall (int i | 1 <= i && i < (N-3) && i % 4 == 1) x[i] == 0);
7 $assume($forall (int i | 1 <= i && i < (N-3) && i % 4 == 1) x[i+1] == 0);
8 $assume($forall (int i | 1 <= i && i < (N-3) && i % 4 == 1) x[i+2] == 0);
9 $assume($forall (int i | 1 <= i && i < (N-3) && i % 4 == 1) x[i+3] == 0);
10
11 /*
12 * n is step, m is offset: <br>
13 * <code>high' == high % n == m ? (high + n - 1) :
14 * (high % n &lt m ? h - h % n + m - 1 : h - h % n + m + n - 1)</code>
15 */
16 int new_upper = (N-4)%4 == 1 ? ((N-4) + 4 - 1) :
17 ((N-4) % 4 < 1) ? (N-4) - (N-4)%4 + 1 - 1 : (N-4) - (N-4)%4 + 1 - 1 + 1;
18
19 $assert($forall (int i : 1 .. new_upper) x[i] == 0);
20}
Note: See TracBrowser for help on using the repository browser.