1.23
2.0
acw/focus-triggers
main
test-branch
|
Last change
on this file since abb7e049 was 7329898, checked in by Manchun Zheng <zmanchun@…>, 11 years ago |
|
minor correction of abs call analyer; printed expression values of statements for transition printing.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@2378 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
354 bytes
|
| Line | |
|---|
| 1 | #include <civlc.cvh>
|
|---|
| 2 |
|
|---|
| 3 | int call(int f(int), int arg){
|
|---|
| 4 | return f(arg);
|
|---|
| 5 | }
|
|---|
| 6 |
|
|---|
| 7 | int sum(int n){
|
|---|
| 8 | int result=0;
|
|---|
| 9 |
|
|---|
| 10 | for(int i=1; i<=n; i++)
|
|---|
| 11 | result+=i;
|
|---|
| 12 | return result;
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | $input int x;
|
|---|
| 16 | $input $proc p;
|
|---|
| 17 | $assume(p != $self);
|
|---|
| 18 | $input $scope sc;
|
|---|
| 19 | $assume(sc != $root);
|
|---|
| 20 | $proc p1;
|
|---|
| 21 |
|
|---|
| 22 | void main(){
|
|---|
| 23 | int (*k)(int)=∑
|
|---|
| 24 |
|
|---|
| 25 | call(k, 2);
|
|---|
| 26 | p1=$spawn sum(1);
|
|---|
| 27 | $wait(p1);
|
|---|
| 28 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.