source: CIVL/examples/arithmetic/algebra.cvl@ 9705dfd

1.23 2.0 main test-branch
Last change on this file since 9705dfd was 793cfc2, checked in by Tim Zirkel <zirkeltk@…>, 13 years ago

Reorganized examples and tests. Added algebra, assoc, dining, assume, and scoping examples.

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

  • Property mode set to 100644
File size: 391 bytes
Line 
1#include <civlc.h>
2$input int x;
3$input int y;
4
5void main() {
6 int z0 = x*x + 2*x*y + y*y;
7 int z1 = (x + y) * (x + y);
8 int z2 = x*x - y*y;
9 int z3 = (x + y) * (x - y);
10 int z4 = x*x*x - y*y*y;
11 int z5 = (x - y) * (x*x + x*y + y*y);
12 int z6 = x*x*x + y*y*y;
13 int z7 = (x + y) * (x*x - x*y + y*y);
14
15 $assert z0 == z1;
16 $assert z2 == z3;
17 $assert z4 == z5;
18 $assert z6 == z7;
19}
Note: See TracBrowser for help on using the repository browser.