|
|
|
@ -59,21 +59,21 @@ let%test_module _ =
|
|
|
|
|
check_frame Sh.emp [] Sh.emp ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame: emp \- emp
|
|
|
|
|
( infer_frame: 0 emp \- emp
|
|
|
|
|
) infer_frame: emp |}]
|
|
|
|
|
|
|
|
|
|
let%expect_test _ =
|
|
|
|
|
check_frame (Sh.false_ Var.Set.empty) [] Sh.emp ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame: false \- emp
|
|
|
|
|
( infer_frame: 1 false \- emp
|
|
|
|
|
) infer_frame: false |}]
|
|
|
|
|
|
|
|
|
|
let%expect_test _ =
|
|
|
|
|
check_frame Sh.emp [n_; m_] (Sh.and_ (Formula.eq m n) Sh.emp) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame: emp \- ∃ %m_8, %n_9 . %m_8 = %n_9 ∧ emp
|
|
|
|
|
( infer_frame: 2 emp \- ∃ %m_8, %n_9 . %m_8 = %n_9 ∧ emp
|
|
|
|
|
) infer_frame: %m_8 = %n_9 ∧ emp |}]
|
|
|
|
|
|
|
|
|
|
let%expect_test _ =
|
|
|
|
@ -82,7 +82,7 @@ let%test_module _ =
|
|
|
|
|
[] Sh.emp ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame: %l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩ \- emp
|
|
|
|
|
( infer_frame: 3 %l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩ \- emp
|
|
|
|
|
) infer_frame: %l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩ |}]
|
|
|
|
|
|
|
|
|
|
let%expect_test _ =
|
|
|
|
@ -92,7 +92,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= b; len= m; siz= n; cnt= a}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 4
|
|
|
|
|
%l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩
|
|
|
|
|
\- %l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩
|
|
|
|
|
) infer_frame: emp |}]
|
|
|
|
@ -110,7 +110,7 @@ let%test_module _ =
|
|
|
|
|
infer_frame minued [n_; m_] subtrahend ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 5
|
|
|
|
|
%l_6 -[ %b_4, 10 )-> ⟨10,%a_1⟩ * %l_7 -[ %b_4, 10 )-> ⟨10,%a_2⟩
|
|
|
|
|
\- ∃ %m_8, %n_9 .
|
|
|
|
|
∃ %m_10 . %m_8 = %n_9 ∧ %l_7 -[ %b_4, 10 )-> ⟨10,%a_2⟩
|
|
|
|
@ -126,7 +126,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= b; len= m; siz= n; cnt= a}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 6
|
|
|
|
|
%l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩
|
|
|
|
|
* %l_7 -[ %b_4, %m_8 )-> ⟨%n_9,%a_2⟩
|
|
|
|
|
\- %l_6 -[ %b_4, %m_8 )-> ⟨%n_9,%a_1⟩
|
|
|
|
@ -141,7 +141,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= l; len= !16; siz= !16; cnt= a3}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 7
|
|
|
|
|
%l_6 -[)-> ⟨8,%a_1⟩^⟨8,%a_2⟩ \- ∃ %a_3 . %l_6 -[)-> ⟨16,%a_3⟩
|
|
|
|
|
) infer_frame: (⟨8,%a_1⟩^⟨8,%a_2⟩) = %a_3 ∧ emp |}]
|
|
|
|
|
|
|
|
|
@ -154,7 +154,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= l; len= m; siz= !16; cnt= a3}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 8
|
|
|
|
|
%l_6 -[)-> ⟨8,%a_1⟩^⟨8,%a_2⟩
|
|
|
|
|
\- ∃ %a_3, %m_8 .
|
|
|
|
|
%l_6 -[ %l_6, %m_8 )-> ⟨16,%a_3⟩
|
|
|
|
@ -169,7 +169,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= l; len= m; siz= m; cnt= a3}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 9
|
|
|
|
|
%l_6 -[)-> ⟨8,%a_1⟩^⟨8,%a_2⟩
|
|
|
|
|
\- ∃ %a_3, %m_8 .
|
|
|
|
|
%l_6 -[ %l_6, %m_8 )-> ⟨%m_8,%a_3⟩
|
|
|
|
@ -186,7 +186,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= k; bas= k; len= m; siz= n; cnt= a2})) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 10
|
|
|
|
|
%k_5 -[ %k_5, 16 )-> ⟨32,%a_1⟩ * %l_6 -[)-> ⟨8,16⟩
|
|
|
|
|
\- ∃ %a_2, %m_8, %n_9 .
|
|
|
|
|
%k_5 -[ %k_5, %m_8 )-> ⟨%n_9,%a_2⟩ * %l_6 -[)-> ⟨8,%n_9⟩
|
|
|
|
@ -208,7 +208,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= l; len= !8; siz= !8; cnt= n})) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 11
|
|
|
|
|
%k_5 -[ %k_5, 16 )-> ⟨32,%a_1⟩ * %l_6 -[)-> ⟨8,16⟩
|
|
|
|
|
\- ∃ %a_2, %m_8, %n_9 .
|
|
|
|
|
%k_5 -[ %k_5, %m_8 )-> ⟨%n_9,%a_2⟩ * %l_6 -[)-> ⟨8,%n_9⟩
|
|
|
|
@ -234,7 +234,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= l; len= m; siz= m; cnt= a}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 12
|
|
|
|
|
%l_6 -[ %l_6, 16 )-> ⟨8×%n_9,%a_2⟩^⟨(16 + -8×%n_9),%a_3⟩
|
|
|
|
|
* ( ( 0 = %n_9 ∧ emp)
|
|
|
|
|
∨ ( 1 = %n_9 ∧ emp)
|
|
|
|
@ -259,7 +259,7 @@ let%test_module _ =
|
|
|
|
|
(Sh.seg {loc= l; bas= l; len= m; siz= m; cnt= a}) ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame:
|
|
|
|
|
( infer_frame: 13
|
|
|
|
|
(2 ≥ %n_9)
|
|
|
|
|
∧ %l_6 -[ %l_6, 16 )-> ⟨8×%n_9,%a_2⟩^⟨(16 + -8×%n_9),%a_3⟩
|
|
|
|
|
\- ∃ %a_1, %m_8 .
|
|
|
|
@ -276,6 +276,7 @@ let%test_module _ =
|
|
|
|
|
infer_frame minuend [m_] subtrahend ;
|
|
|
|
|
[%expect
|
|
|
|
|
{|
|
|
|
|
|
( infer_frame: emp \- ∃ %m_8 . %a_1 = %m_8 ∧ (0 ≠ %a_1) ∧ emp
|
|
|
|
|
( infer_frame: 14
|
|
|
|
|
emp \- ∃ %m_8 . %a_1 = %m_8 ∧ (0 ≠ %a_1) ∧ emp
|
|
|
|
|
) infer_frame: |}]
|
|
|
|
|
end )
|
|
|
|
|