source: CIVL/examples/contracts/contractsMPI/need_heuristics.why

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: 7.7 KB
RevLine 
[aaa9c8d]1(*
2 This is an example that the query is too complex that even why3 cannot handle it.
3 Without any further simplification, only goal G0 and G1 can be proved.
4
5 By looking at the symbolic expression of this query, I found that
6 at least goal G3 is valid. But some further simplification is
7 needed. If I replace the "(get Y13 1)" with "(get Y12 0)", G2 can
8 be fastly proved. And human beings can easily decide that (get Y12 0) == (get Y13 1).
9
10 Here I put the SARL symbolic expression version of the query as reference:
11
12Context:
13 0==(_uf_$mpi_sizeof(10) - 1*SIZEOF_REAL)
14 0==(Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][Y0] - 1*Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][0])
15 0==(Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][1] - 1*Y15[0])
16 0==(Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][0] - 1*Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][Y5])
17 0==(Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][1] - 1*Y12[0])
18 0==(Y2 - 1*Y7)
19 forall _cc_bv_0 : int . ((0 == Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][_cc_bv_0] - 1*Y3[_cc_bv_0]) || (0 <= Y0 - 1*_cc_bv_0))
20 forall _cc_bv_0 : int . ((0 == Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][_cc_bv_0] - 1*Y3[_cc_bv_0]) || (0 <= _cc_bv_0 - 1))
21 forall _cc_bv_0 : int . ((0 == Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][_cc_bv_0] - 1*Y8[_cc_bv_0]) || (0 <= Y5 - 1*_cc_bv_0))
22 forall _cc_bv_0 : int . ((0 == Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][_cc_bv_0] - 1*Y8[_cc_bv_0]) || (0 <= _cc_bv_0 - 1))
23 forall i : int . ((0 == Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][i - 1]*Y2 + Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][i + 1]*Y2 - 2*Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][i]*Y2 + Y10[0:=Y11[0]][Y0 + 1:=Y12[0]][i] - 1*Y3[i]) || (Y0 - 1*i + 1 <= 0) || (i <= 0))
24 forall i : int . ((0 == Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][i - 1]*Y7 + Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][i + 1]*Y7 - 2*Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][i]*Y7 + Y13[0:=Y14[0]][Y5 + 1:=Y15[0]][i] - 1*Y8[i]) || (Y5 - 1*i + 1 <= 0) || (i <= 0))
25 0<Y2
26 0<Y7
27 (Y0-1023)<=0
28 (Y5-1023)<=0
29 0<=(SIZEOF(540)-1)
30 0<=(SIZEOF(544)-1)
31 0<=(SIZEOF(566)-1)
32 0<=(SIZEOF(568)-1)
33 0<=(SIZEOF(571)-1)
34 0<=(SIZEOF(573)-1)
35 0<=(SIZEOF(576)-1)
36 0<=(SIZEOF_REAL-1)
37 0<=(X__mpi_nprocs_hi-2)
38 0<=(Y0-1)
39 0<=(Y5-1)
40
41Assertion:
42 (0==(Y3[Y0 + 1] - 1*Y13[1]))&&
43 (0==(Y3[0] - 1*Y13[Y5]))&&
44 ((0==((Y10[Y0 - 1] - 2*Y10[Y0] + Y13[1])*Y2 + Y10[Y0] - 1*Y3[Y0]))||((Y0-1)<=0))&&
45 ((0==((Y10[1] + (-1/2)*Y10[2] + (-1/2)*Y13[Y5])*Y2 + (-1/2)*Y10[1] + (1/2)*Y3[1]))||((Y0-1)<=0))&&
46 ((0==((Y10[1] + (-1/2)*Y13[Y5] + (-1/2)*Y13[1])*Y2 + (-1/2)*Y10[1] + (1/2)*Y3[1]))||(0!=(Y0-1)))
47 *)
48
49theory SARL_REAL
50use import real.Real
51function add (a b : real) : real = a + b
52function sub (a b : real) : real = a - b
53function mul (a b : real) : real = a * b
54function neg (a : real) : real = (-a)
55function (:-) (a b : real) : real = a / b
56predicate lt (a b : real) = a < b
57predicate lte (a b : real) = a <= b
58end
59theory Why3Query_93
60use import map.Map
61use import SARL_REAL as SR
62use import int.Int
63type _tuple_0 = {_t0 : int;}
64
65constant _SIZEOF_REAL : int
66
67constant _X__mpi_nprocs_hi : int
68
69constant _Y13 : (map int real)
70
71constant _sc_0 : _tuple_0
72
73constant _Y14 : (map int real)
74
75constant _sc_1 : _tuple_0
76
77constant _Y15 : (map int real)
78
79constant _sc_2 : _tuple_0
80
81function __uf__mpi_sizeof (int) : int
82constant _sc_3 : _tuple_0
83
84constant _sc_4 : _tuple_0
85
86constant _Y10 : (map int real)
87
88constant _sc_5 : _tuple_0
89
90constant _Y11 : (map int real)
91
92constant _sc_6 : _tuple_0
93
94constant _Y0 : int
95
96constant _Y12 : (map int real)
97
98function _SIZEOF (_tuple_0) : int
99constant _Y3 : (map int real)
100
101constant _Y2 : real
102
103constant _Y5 : int
104
105constant _Y7 : real
106
107constant _Y8 : (map int real)
108
109predicate _Axcontext = ((0 = ((__uf__mpi_sizeof 10 ) + (-1 * _SIZEOF_REAL))) && (0.0 = ( SR.add (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) _Y0) ( SR.mul (SR.neg 1.0) (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) 0)))) && (0.0 = ( SR.add (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) 1) ( SR.mul (SR.neg 1.0) (get _Y15 0)))) && (0.0 = ( SR.add (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) 0) ( SR.mul (SR.neg 1.0) (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) _Y5)))) && (0.0 = ( SR.add (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) 1) ( SR.mul (SR.neg 1.0) (get _Y12 0)))) && (0.0 = ( SR.add _Y2 ( SR.mul (SR.neg 1.0) _Y7))) && (forall __cc_bv_0 : int. ((0.0 = ( SR.add (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) __cc_bv_0) ( SR.mul (SR.neg 1.0) (get _Y3 __cc_bv_0)))) || (0 <= (_Y0 + (-1 * __cc_bv_0))))) && (forall __cc_bv_0 : int. ((0.0 = ( SR.add (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) __cc_bv_0) ( SR.mul (SR.neg 1.0) (get _Y3 __cc_bv_0)))) || (0 <= (__cc_bv_0 + -1)))) && (forall __cc_bv_0 : int. ((0.0 = ( SR.add (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) __cc_bv_0) ( SR.mul (SR.neg 1.0) (get _Y8 __cc_bv_0)))) || (0 <= (_Y5 + (-1 * __cc_bv_0))))) && (forall __cc_bv_0 : int. ((0.0 = ( SR.add (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) __cc_bv_0) ( SR.mul (SR.neg 1.0) (get _Y8 __cc_bv_0)))) || (0 <= (__cc_bv_0 + -1)))) && (forall _i : int. ((0.0 = ( SR.add ( SR.add ( SR.add ( SR.add ( SR.mul (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) (_i + -1)) _Y2) ( SR.mul (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) (_i + 1)) _Y2)) ( SR.mul (SR.neg 2.0) ( SR.mul (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) _i) _Y2))) (get (set (set _Y10 0 (get _Y11 0)) (_Y0 + 1) (get _Y12 0)) _i)) ( SR.mul (SR.neg 1.0) (get _Y3 _i)))) || ((_Y0 + (-1 * _i) + 1) <= 0) || (_i <= 0))) && (forall _i : int. ((0.0 = ( SR.add ( SR.add ( SR.add ( SR.add ( SR.mul (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) (_i + -1)) _Y7) ( SR.mul (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) (_i + 1)) _Y7)) ( SR.mul (SR.neg 2.0) ( SR.mul (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) _i) _Y7))) (get (set (set _Y13 0 (get _Y14 0)) (_Y5 + 1) (get _Y15 0)) _i)) ( SR.mul (SR.neg 1.0) (get _Y8 _i)))) || ((_Y5 + (-1 * _i) + 1) <= 0) || (_i <= 0))) && ( ( SR.lt 0.0 _Y2)) && ( ( SR.lt 0.0 _Y7)) && ((_Y0 + -1023) <= 0) && ((_Y5 + -1023) <= 0) && (0 <= ((_SIZEOF {_sc_0 with _t0 = 540; } ) + -1)) && (0 <= ((_SIZEOF {_sc_1 with _t0 = 544; } ) + -1)) && (0 <= ((_SIZEOF {_sc_2 with _t0 = 566; } ) + -1)) && (0 <= ((_SIZEOF {_sc_3 with _t0 = 568; } ) + -1)) && (0 <= ((_SIZEOF {_sc_4 with _t0 = 571; } ) + -1)) && (0 <= ((_SIZEOF {_sc_5 with _t0 = 573; } ) + -1)) && (0 <= ((_SIZEOF {_sc_6 with _t0 = 576; } ) + -1)) && (0 <= (_SIZEOF_REAL + -1)) && (0 <= (_X__mpi_nprocs_hi + -2)) && (0 <= (_Y0 + -1)) && (0 <= (_Y5 + -1)))
110predicate context = _Axcontext
111
112goal G0: context -> (0.0 = ( SR.add (get _Y3 (_Y0 + 1)) ( SR.mul (SR.neg 1.0) (get _Y13 1))))
113goal G1: context ->
114 (0.0 = ( SR.add (get _Y3 0) ( SR.mul (SR.neg 1.0) (get _Y13 _Y5))))
115goal G2: context ->
116 ((0.0 = ( SR.add ( SR.add ( SR.mul ( SR.add ( SR.add (get _Y10 (_Y0 + -1)) ( SR.mul (SR.neg 2.0) (get _Y10 _Y0))) (get _Y13 1)) _Y2) (get _Y10 _Y0)) ( SR.mul (SR.neg 1.0) (get _Y3 _Y0)))) || ((_Y0 + -1) <= 0))
117goal G3: (context && (not ((_Y0 + -1) <= 0) ))->
118 ((0.0 = ( SR.add ( SR.add ( SR.mul ( SR.add ( SR.add (get _Y10 1) ( SR.mul (SR.neg (1.0 :- 2.0)) (get _Y10 2))) ( SR.mul (SR.neg (1.0 :- 2.0)) (get _Y13 _Y5))) _Y2) ( SR.mul (SR.neg (1.0 :- 2.0)) (get _Y10 1))) ( SR.mul (1.0 :- 2.0) (get _Y3 1)))) )
119goal G4: context ->
120 ((0.0 = ( SR.add ( SR.add ( SR.mul ( SR.add ( SR.add (get _Y10 1) ( SR.mul (SR.neg (1.0 :- 2.0)) (get _Y13 _Y5))) ( SR.mul (SR.neg (1.0 :- 2.0)) (get _Y13 1))) _Y2) ( SR.mul (SR.neg (1.0 :- 2.0)) (get _Y10 1))) ( SR.mul (1.0 :- 2.0) (get _Y3 1)))) || (not (0 = (_Y0 + -1))))
121
122end
Note: See TracBrowser for help on using the repository browser.