From 478d31d3a3c483b7c73c5cff5aa0eeb223080e2b Mon Sep 17 00:00:00 2001 From: Julien Signoles <julien.signoles@cea.fr> Date: Mon, 23 Jan 2012 10:33:51 +0000 Subject: [PATCH] [e-acsl] new option -e-acsl-gmp-only: used in tests to check the GMP translation --- src/plugins/e-acsl/TODO | 3 + src/plugins/e-acsl/options.ml | 8 + src/plugins/e-acsl/options.mli | 1 + .../e-acsl/tests/e-acsl-runtime/addrOf.i | 1 + .../e-acsl/tests/e-acsl-runtime/arith.i | 1 + .../e-acsl/tests/e-acsl-runtime/array.i | 1 + src/plugins/e-acsl/tests/e-acsl-runtime/at.i | 1 + .../e-acsl/tests/e-acsl-runtime/cast.i | 1 + .../e-acsl/tests/e-acsl-runtime/comparison.i | 1 + .../e-acsl/tests/e-acsl-runtime/empty.i | 1 + .../e-acsl/tests/e-acsl-runtime/false.i | 1 + .../tests/e-acsl-runtime/function_contract.i | 1 + .../tests/e-acsl-runtime/integer_constant.i | 1 + .../e-acsl/tests/e-acsl-runtime/invariant.i | 1 + .../tests/e-acsl-runtime/labeled_stmt.i | 1 + .../e-acsl/tests/e-acsl-runtime/lazy.i | 1 + .../tests/e-acsl-runtime/linear_search.i | 1 + .../tests/e-acsl-runtime/nested_code_annot.i | 1 + src/plugins/e-acsl/tests/e-acsl-runtime/not.i | 1 + .../e-acsl/tests/e-acsl-runtime/null.i | 1 + .../e-acsl-runtime/oracle/addrOf.1.err.oracle | 0 .../e-acsl-runtime/oracle/addrOf.1.res.oracle | 45 + .../e-acsl-runtime/oracle/addrOf.res.oracle | 2 +- .../e-acsl-runtime/oracle/arith.1.err.oracle | 0 .../e-acsl-runtime/oracle/arith.1.res.oracle | 1253 +++++++++++++++ .../e-acsl-runtime/oracle/arith.res.oracle | 44 +- .../e-acsl-runtime/oracle/array.1.err.oracle | 0 .../e-acsl-runtime/oracle/array.1.res.oracle | 172 ++ .../e-acsl-runtime/oracle/array.res.oracle | 12 +- .../e-acsl-runtime/oracle/at.1.err.oracle | 0 .../e-acsl-runtime/oracle/at.1.res.oracle | 674 ++++++++ .../tests/e-acsl-runtime/oracle/at.res.oracle | 34 +- .../e-acsl-runtime/oracle/cast.1.err.oracle | 0 .../e-acsl-runtime/oracle/cast.1.res.oracle | 360 +++++ .../e-acsl-runtime/oracle/cast.res.oracle | 12 +- .../oracle/comparison.1.err.oracle | 0 .../oracle/comparison.1.res.oracle | 808 ++++++++++ .../oracle/comparison.res.oracle | 36 +- .../e-acsl-runtime/oracle/empty.1.err.oracle | 0 .../e-acsl-runtime/oracle/empty.1.res.oracle | 2 + .../e-acsl-runtime/oracle/false.1.err.oracle | 0 .../e-acsl-runtime/oracle/false.1.res.oracle | 41 + .../e-acsl-runtime/oracle/false.res.oracle | 2 +- .../oracle/function_contract.1.err.oracle | 0 .../oracle/function_contract.1.res.oracle | 1300 +++++++++++++++ .../oracle/function_contract.res.oracle | 38 +- .../tests/e-acsl-runtime/oracle/gen_addrOf.c | 2 +- .../tests/e-acsl-runtime/oracle/gen_addrOf2.c | 29 + .../tests/e-acsl-runtime/oracle/gen_arith.c | 44 +- .../tests/e-acsl-runtime/oracle/gen_arith2.c | 484 ++++++ .../tests/e-acsl-runtime/oracle/gen_array.c | 4 +- .../tests/e-acsl-runtime/oracle/gen_array2.c | 92 ++ .../tests/e-acsl-runtime/oracle/gen_at.c | 22 +- .../tests/e-acsl-runtime/oracle/gen_at2.c | 484 ++++++ .../tests/e-acsl-runtime/oracle/gen_cast.c | 12 +- .../tests/e-acsl-runtime/oracle/gen_cast2.c | 164 ++ .../e-acsl-runtime/oracle/gen_comparison.c | 36 +- .../e-acsl-runtime/oracle/gen_comparison2.c | 319 ++++ .../tests/e-acsl-runtime/oracle/gen_false.c | 2 +- .../tests/e-acsl-runtime/oracle/gen_false2.c | 31 + .../oracle/gen_function_contract.c | 38 +- .../oracle/gen_function_contract2.c | 484 ++++++ .../oracle/gen_integer_constant.c | 6 +- .../oracle/gen_integer_constant2.c | 88 + .../e-acsl-runtime/oracle/gen_invariant.c | 4 +- .../e-acsl-runtime/oracle/gen_invariant2.c | 100 ++ .../e-acsl-runtime/oracle/gen_labeled_stmt.c | 8 +- .../e-acsl-runtime/oracle/gen_labeled_stmt2.c | 116 ++ .../tests/e-acsl-runtime/oracle/gen_lazy.c | 34 +- .../tests/e-acsl-runtime/oracle/gen_lazy2.c | 596 +++++++ .../e-acsl-runtime/oracle/gen_linear_search.c | 10 +- .../oracle/gen_linear_search2.c | 484 ++++++ .../oracle/gen_nested_code_annot.c | 18 +- .../oracle/gen_nested_code_annot2.c | 166 ++ .../tests/e-acsl-runtime/oracle/gen_not.c | 4 +- .../tests/e-acsl-runtime/oracle/gen_not2.c | 77 + .../tests/e-acsl-runtime/oracle/gen_null.c | 2 +- .../tests/e-acsl-runtime/oracle/gen_null2.c | 28 + .../oracle/gen_other_constants.c | 6 +- .../oracle/gen_other_constants2.c | 78 + .../tests/e-acsl-runtime/oracle/gen_ptr.c | 18 +- .../tests/e-acsl-runtime/oracle/gen_ptr2.c | 291 ++++ .../tests/e-acsl-runtime/oracle/gen_quantif.c | 18 +- .../e-acsl-runtime/oracle/gen_quantif2.c | 484 ++++++ .../tests/e-acsl-runtime/oracle/gen_result.c | 6 +- .../tests/e-acsl-runtime/oracle/gen_result2.c | 484 ++++++ .../tests/e-acsl-runtime/oracle/gen_sizeof.c | 4 +- .../tests/e-acsl-runtime/oracle/gen_sizeof2.c | 76 + .../e-acsl-runtime/oracle/gen_stmt_contract.c | 36 +- .../oracle/gen_stmt_contract2.c | 484 ++++++ .../tests/e-acsl-runtime/oracle/gen_true.c | 2 +- .../tests/e-acsl-runtime/oracle/gen_true2.c | 29 + .../tests/e-acsl-runtime/oracle/gen_typedef.c | 2 +- .../e-acsl-runtime/oracle/gen_typedef2.c | 66 + .../oracle/integer_constant.1.err.oracle | 0 .../oracle/integer_constant.1.res.oracle | 171 ++ .../oracle/integer_constant.res.oracle | 6 +- .../oracle/invariant.1.err.oracle | 0 .../oracle/invariant.1.res.oracle | 1169 ++++++++++++++ .../oracle/invariant.res.oracle | 4 +- .../oracle/labeled_stmt.1.err.oracle | 0 .../oracle/labeled_stmt.1.res.oracle | 235 +++ .../oracle/labeled_stmt.res.oracle | 8 +- .../e-acsl-runtime/oracle/lazy.1.err.oracle | 0 .../e-acsl-runtime/oracle/lazy.1.res.oracle | 1271 +++++++++++++++ .../e-acsl-runtime/oracle/lazy.res.oracle | 34 +- .../oracle/linear_search.1.err.oracle | 0 .../oracle/linear_search.1.res.oracle | 1015 ++++++++++++ .../oracle/linear_search.res.oracle | 18 +- .../oracle/nested_code_annot.1.err.oracle | 0 .../oracle/nested_code_annot.1.res.oracle | 359 +++++ .../oracle/nested_code_annot.res.oracle | 18 +- .../e-acsl-runtime/oracle/not.1.err.oracle | 0 .../e-acsl-runtime/oracle/not.1.res.oracle | 119 ++ .../e-acsl-runtime/oracle/not.res.oracle | 4 +- .../e-acsl-runtime/oracle/null.1.err.oracle | 0 .../e-acsl-runtime/oracle/null.1.res.oracle | 43 + .../e-acsl-runtime/oracle/null.res.oracle | 2 +- .../oracle/other_constants.1.err.oracle | 0 .../oracle/other_constants.1.res.oracle | 144 ++ .../oracle/other_constants.res.oracle | 6 +- .../e-acsl-runtime/oracle/ptr.1.err.oracle | 0 .../e-acsl-runtime/oracle/ptr.1.res.oracle | 820 ++++++++++ .../e-acsl-runtime/oracle/ptr.res.oracle | 34 +- .../oracle/quantif.1.err.oracle | 0 .../oracle/quantif.1.res.oracle | 1413 +++++++++++++++++ .../e-acsl-runtime/oracle/quantif.res.oracle | 18 +- .../e-acsl-runtime/oracle/result.1.err.oracle | 0 .../e-acsl-runtime/oracle/result.1.res.oracle | 276 ++++ .../e-acsl-runtime/oracle/result.res.oracle | 6 +- .../e-acsl-runtime/oracle/sizeof.1.err.oracle | 0 .../e-acsl-runtime/oracle/sizeof.1.res.oracle | 144 ++ .../e-acsl-runtime/oracle/sizeof.res.oracle | 4 +- .../oracle/stmt_contract.1.err.oracle | 0 .../oracle/stmt_contract.1.res.oracle | 952 +++++++++++ .../oracle/stmt_contract.res.oracle | 36 +- .../e-acsl-runtime/oracle/true.1.err.oracle | 0 .../e-acsl-runtime/oracle/true.1.res.oracle | 45 + .../e-acsl-runtime/oracle/true.res.oracle | 2 +- .../oracle/typedef.1.err.oracle | 0 .../oracle/typedef.1.res.oracle | 109 ++ .../e-acsl-runtime/oracle/typedef.res.oracle | 2 +- .../tests/e-acsl-runtime/other_constants.i | 1 + src/plugins/e-acsl/tests/e-acsl-runtime/ptr.i | 1 + .../e-acsl/tests/e-acsl-runtime/quantif.i | 1 + .../e-acsl/tests/e-acsl-runtime/result.i | 1 + .../e-acsl/tests/e-acsl-runtime/sizeof.i | 1 + .../tests/e-acsl-runtime/stmt_contract.i | 1 + .../e-acsl/tests/e-acsl-runtime/test_config | 1 + .../e-acsl/tests/e-acsl-runtime/true.i | 3 +- .../e-acsl/tests/e-acsl-runtime/typedef.i | 1 + src/plugins/e-acsl/typing.ml | 57 +- src/plugins/e-acsl/visit.ml | 25 +- 153 files changed, 19135 insertions(+), 381 deletions(-) create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef2.c create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.res.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.err.oracle create mode 100644 src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.res.oracle diff --git a/src/plugins/e-acsl/TODO b/src/plugins/e-acsl/TODO index b8588ba2c8f..0b0ee2a78a5 100644 --- a/src/plugins/e-acsl/TODO +++ b/src/plugins/e-acsl/TODO @@ -17,6 +17,8 @@ - [Yannick] Logic functions - customization des noms de variable générés (par ex pour indiquer le nom de la variable d'origine, ou son rôle) +- vérifier l'export des fonctions GMP dans share: je crois qu'il manque mpz_com +- regarder BTS 72 (bug Jessie) et regarder le comportement d'E-ACSL ############## # KNOWN BUGS # @@ -32,3 +34,4 @@ - améliorer test "integer_constant.i" quand bug fixed #745 - test sizeof.i devraient être plus précis quand logic_typing plus précis - inclure exemple du E-ACSL Reference Manual +- test arith.i: mettre les exemples du ACSL manual about div and modulo diff --git a/src/plugins/e-acsl/options.ml b/src/plugins/e-acsl/options.ml index 907c16b638a..c64541b82ec 100644 --- a/src/plugins/e-acsl/options.ml +++ b/src/plugins/e-acsl/options.ml @@ -58,6 +58,14 @@ module Project_name = let arg_name = "prj" end) +module Gmp_only = + False + (struct + let option_name = "-e-acsl-gmp-only" + let help = "" + let kind = `Correctness + end) + let () = Plugin.set_group help module Version = False diff --git a/src/plugins/e-acsl/options.mli b/src/plugins/e-acsl/options.mli index 0ba103bc28f..a1b21ebe3ac 100644 --- a/src/plugins/e-acsl/options.mli +++ b/src/plugins/e-acsl/options.mli @@ -26,6 +26,7 @@ include S (** implementation of Log.S for E-ACSL *) module Check: Bool module Run: Bool +module Gmp_only: Bool module Project_name: String (* diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i b/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i index 44feb9d3c17..16d73e9cd0a 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/addrOf.i @@ -1,6 +1,7 @@ /* run.config COMMENT: addrOf EXECNOW: LOG gen_addrOf.c BIN gen_addrOf.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/addrOf.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_addrOf.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_addrOf.out ./tests/e-acsl-runtime/result/gen_addrOf.c && ./tests/e-acsl-runtime/result/gen_addrOf.out + EXECNOW: LOG gen_addrOf2.c BIN gen_addrOf2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/addrOf.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_addrOf2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_addrOf2.out ./tests/e-acsl-runtime/result/gen_addrOf2.c && ./tests/e-acsl-runtime/result/gen_addrOf2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i b/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i index 1c3fd20be2d..0942b226fd3 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/arith.i @@ -2,6 +2,7 @@ COMMENT: arithmetic operations COMMENT: add the last assertion when fixing BTS #751 EXECNOW: LOG gen_arith.c BIN gen_arith.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_arith.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_arith.out ./tests/e-acsl-runtime/result/gen_arith.c -lgmp && ./tests/e-acsl-runtime/result/gen_arith.out + EXECNOW: LOG gen_arith2.c BIN gen_arith2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_arith2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_arith2.out ./tests/e-acsl-runtime/result/gen_arith2.c -lgmp && ./tests/e-acsl-runtime/result/gen_arith2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/array.i b/src/plugins/e-acsl/tests/e-acsl-runtime/array.i index 2a07bffb0ef..0bc00ae3a3b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/array.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/array.i @@ -1,6 +1,7 @@ /* run.config COMMENT: arrays EXECNOW: LOG gen_array.c BIN gen_array.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/array.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_array.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_array.out ./tests/e-acsl-runtime/result/gen_array.c -lgmp && ./tests/e-acsl-runtime/result/gen_array.out + EXECNOW: LOG gen_array2.c BIN gen_array2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/array.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_array2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_array2.out ./tests/e-acsl-runtime/result/gen_array2.c -lgmp && ./tests/e-acsl-runtime/result/gen_array2.out */ int T1[3],T2[4]; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/at.i b/src/plugins/e-acsl/tests/e-acsl-runtime/at.i index a9af7846621..562f2b2d84a 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/at.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/at.i @@ -1,6 +1,7 @@ /* run.config COMMENT: \at EXECNOW: LOG gen_at.c BIN gen_at.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/at.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_at.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_at.out ./tests/e-acsl-runtime/result/gen_at.c -lgmp && ./tests/e-acsl-runtime/result/gen_at.out + EXECNOW: LOG gen_at2.c BIN gen_at2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_at2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_at2.out ./tests/e-acsl-runtime/result/gen_at2.c -lgmp && ./tests/e-acsl-runtime/result/gen_at2.out */ int A = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i b/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i index ef8f59f65a6..241b55c97db 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/cast.i @@ -1,6 +1,7 @@ /* run.config COMMENT: cast EXECNOW: LOG gen_cast.c BIN gen_cast.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/cast.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_cast.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_cast.out ./tests/e-acsl-runtime/result/gen_cast.c -lgmp && ./tests/e-acsl-runtime/result/gen_cast.out + EXECNOW: LOG gen_cast2.c BIN gen_cast2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/cast.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_cast2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_cast2.out ./tests/e-acsl-runtime/result/gen_cast2.c -lgmp && ./tests/e-acsl-runtime/result/gen_cast2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i b/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i index 81af6cca1b8..defe8bebc70 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/comparison.i @@ -1,6 +1,7 @@ /* run.config COMMENT: comparison operators EXECNOW: LOG gen_comparison.c BIN gen_comparison.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/comparison.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_comparison.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_comparison.out ./tests/e-acsl-runtime/result/gen_comparison.c -lgmp && ./tests/e-acsl-runtime/result/gen_comparison.out + EXECNOW: LOG gen_comparison2.c BIN gen_comparison2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/comparison.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_comparison2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_comparison2.out ./tests/e-acsl-runtime/result/gen_comparison2.c -lgmp && ./tests/e-acsl-runtime/result/gen_comparison2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i b/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i index 9671d3e91f4..bfe0e542270 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/empty.i @@ -1,4 +1,5 @@ /* run.config COMMENT: empty file OPT: -e-acsl-check -e-acsl -then-on e-acsl -print + OPT: -e-acsl-gmp-only -e-acsl -then-on e-acsl -print */ diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/false.i b/src/plugins/e-acsl/tests/e-acsl-runtime/false.i index b5252399865..2175d76f16b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/false.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/false.i @@ -1,6 +1,7 @@ /* run.config COMMENT: assert \false EXECNOW: LOG gen_false.c BIN gen_false.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/false.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_false.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_false.out ./tests/e-acsl-runtime/result/gen_false.c && ./tests/e-acsl-runtime/result/gen_false.out + EXECNOW: LOG gen_false2.c BIN gen_false2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/false.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_false2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_false2.out ./tests/e-acsl-runtime/result/gen_false2.c && ./tests/e-acsl-runtime/result/gen_false2.out */ int main(void) { int x = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/function_contract.i b/src/plugins/e-acsl/tests/e-acsl-runtime/function_contract.i index 03e26322e26..116d05e0533 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/function_contract.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/function_contract.i @@ -1,6 +1,7 @@ /* run.config COMMENT: function contract EXECNOW: LOG gen_function_contract.c BIN gen_function_contract.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/function_contract.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_function_contract.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_function_contract.out ./tests/e-acsl-runtime/result/gen_function_contract.c -lgmp && ./tests/e-acsl-runtime/result/gen_function_contract.out + EXECNOW: LOG gen_function_contract2.c BIN gen_function_contract2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_function_contract2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_function_contract2.out ./tests/e-acsl-runtime/result/gen_function_contract2.c -lgmp && ./tests/e-acsl-runtime/result/gen_function_contract2.out */ int X = 0, Y = 2; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i b/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i index ac356946d0f..40fb7213f05 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/integer_constant.i @@ -2,6 +2,7 @@ COMMENT: integer constant + a stmt after the assertion COMMENT: waiting for fixing BTS #745 EXECNOW: LOG gen_integer_constant.c BIN gen_integer_constant.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/integer_constant.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_integer_constant.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_integer_constant.out ./tests/e-acsl-runtime/result/gen_integer_constant.c -lgmp && ./tests/e-acsl-runtime/result/gen_integer_constant.out + EXECNOW: LOG gen_integer_constant2.c BIN gen_integer_constant2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/integer_constant.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_integer_constant2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_integer_constant2.out ./tests/e-acsl-runtime/result/gen_integer_constant2.c -lgmp && ./tests/e-acsl-runtime/result/gen_integer_constant2.out */ int main(void) { int x; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/invariant.i b/src/plugins/e-acsl/tests/e-acsl-runtime/invariant.i index fc2865a7e3d..35cc1d9107c 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/invariant.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/invariant.i @@ -1,6 +1,7 @@ /* run.config COMMENT: invariant EXECNOW: LOG gen_invariant.c BIN gen_invariant.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/invariant.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_invariant.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_invariant.out ./tests/e-acsl-runtime/result/gen_invariant.c -lgmp && ./tests/e-acsl-runtime/result/gen_invariant.out + EXECNOW: LOG gen_invariant2.c BIN gen_invariant2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/invariant.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_invariant2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_invariant2.out ./tests/e-acsl-runtime/result/gen_invariant2.c -lgmp && ./tests/e-acsl-runtime/result/gen_invariant2.out */ int main(void) { int x = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/labeled_stmt.i b/src/plugins/e-acsl/tests/e-acsl-runtime/labeled_stmt.i index eb72ec82c74..fe23e93377d 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/labeled_stmt.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/labeled_stmt.i @@ -1,6 +1,7 @@ /* run.config COMMENT: labeled stmt and gotos EXECNOW: LOG gen_labeled_stmt.c BIN gen_labeled_stmt.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/labeled_stmt.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_labeled_stmt.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_labeled_stmt.out ./tests/e-acsl-runtime/result/gen_labeled_stmt.c -lgmp && ./tests/e-acsl-runtime/result/gen_labeled_stmt.out + EXECNOW: LOG gen_labeled_stmt2.c BIN gen_labeled_stmt2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/labeled_stmt.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_labeled_stmt2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_labeled_stmt2.out ./tests/e-acsl-runtime/result/gen_labeled_stmt2.c -lgmp && ./tests/e-acsl-runtime/result/gen_labeled_stmt2.out */ int X = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/lazy.i b/src/plugins/e-acsl/tests/e-acsl-runtime/lazy.i index 560c3d6686c..61e82bd1e37 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/lazy.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/lazy.i @@ -1,6 +1,7 @@ /* run.config COMMENT: terms and predicates using lazy operators EXECNOW: LOG gen_lazy.c BIN gen_lazy.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/lazy.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_lazy.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_lazy.out ./tests/e-acsl-runtime/result/gen_lazy.c -lgmp 2> /dev/null && ./tests/e-acsl-runtime/result/gen_lazy.out + EXECNOW: LOG gen_lazy2.c BIN gen_lazy2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/lazy.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_lazy2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_lazy2.out ./tests/e-acsl-runtime/result/gen_lazy2.c -lgmp 2> /dev/null && ./tests/e-acsl-runtime/result/gen_lazy2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/linear_search.i b/src/plugins/e-acsl/tests/e-acsl-runtime/linear_search.i index 21122492261..60890404133 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/linear_search.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/linear_search.i @@ -1,6 +1,7 @@ /* run.config COMMENT: linear search (example of the TAP'12 article) EXECNOW: LOG gen_linear_search.c BIN gen_linear_search.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/linear_search.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_linear_search.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_linear_search.out ./tests/e-acsl-runtime/result/gen_linear_search.c -lgmp && ./tests/e-acsl-runtime/result/gen_linear_search.out + EXECNOW: LOG gen_linear_search2.c BIN gen_linear_search2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_linear_search2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_linear_search2.out ./tests/e-acsl-runtime/result/gen_linear_search2.c -lgmp && ./tests/e-acsl-runtime/result/gen_linear_search2.out */ int A[10]; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/nested_code_annot.i b/src/plugins/e-acsl/tests/e-acsl-runtime/nested_code_annot.i index bb30173f60f..1be16d7cf5b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/nested_code_annot.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/nested_code_annot.i @@ -1,6 +1,7 @@ /* run.config COMMENT: structured stmt with several code annotations inside EXECNOW: LOG gen_nested_code_annot.c BIN gen_nested_code_annot.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/nested_code_annot.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_nested_code_annot.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_nested_code_annot.out ./tests/e-acsl-runtime/result/gen_nested_code_annot.c -lgmp && ./tests/e-acsl-runtime/result/gen_nested_code_annot.out + EXECNOW: LOG gen_nested_code_annot2.c BIN gen_nested_code_annot2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/nested_code_annot.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_nested_code_annot2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_nested_code_annot2.out ./tests/e-acsl-runtime/result/gen_nested_code_annot2.c -lgmp && ./tests/e-acsl-runtime/result/gen_nested_code_annot2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/not.i b/src/plugins/e-acsl/tests/e-acsl-runtime/not.i index f43535877a5..4012c7bdadd 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/not.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/not.i @@ -1,6 +1,7 @@ /* run.config COMMENT: predicate [!p] EXECNOW: LOG gen_not.c BIN gen_not.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/not.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_not.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_not.out ./tests/e-acsl-runtime/result/gen_not.c && ./tests/e-acsl-runtime/result/gen_not.out + EXECNOW: LOG gen_not2.c BIN gen_not2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/not.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_not2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_not2.out ./tests/e-acsl-runtime/result/gen_not2.c -lgmp && ./tests/e-acsl-runtime/result/gen_not2.out */ int main(void) { int x = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/null.i b/src/plugins/e-acsl/tests/e-acsl-runtime/null.i index 19cb7753a61..2b04ba44e00 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/null.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/null.i @@ -1,6 +1,7 @@ /* run.config COMMENT: assert \null == 0 EXECNOW: LOG gen_null.c BIN gen_null.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/null.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_null.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_null.out ./tests/e-acsl-runtime/result/gen_null.c -lgmp && ./tests/e-acsl-runtime/result/gen_null.out + EXECNOW: LOG gen_null2.c BIN gen_null2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/null.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_null2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_null2.out ./tests/e-acsl-runtime/result/gen_null2.c -lgmp && ./tests/e-acsl-runtime/result/gen_null2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.res.oracle new file mode 100644 index 00000000000..fb5f86313ee --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.1.res.oracle @@ -0,0 +1,45 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:230:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:231. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert &x ≡ &x; */ ; + e_acsl_assert(! (& x == & x),(char *)"Assertion",(char *)"(&x == &x)",9); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle index 20718782b19..fb5f86313ee 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/addrOf.res.oracle @@ -37,7 +37,7 @@ int main(void) int x; x = 0; /*@ assert &x ≡ &x; */ ; - e_acsl_assert(! (& x == & x),(char *)"Assertion",(char *)"(&x == &x)",8); + e_acsl_assert(! (& x == & x),(char *)"Assertion",(char *)"(&x == &x)",9); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.res.oracle new file mode 100644 index 00000000000..44bf877e2fd --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.1.res.oracle @@ -0,0 +1,1253 @@ +:0:[e-acsl] warning: E-ACSL construct `typing of user-defined logic type' is not yet supported. + Ignoring annotation. +:0:[e-acsl] warning: E-ACSL construct `typing of user-defined logic type' is not yet supported. + Ignoring annotation. +:0:[e-acsl] warning: E-ACSL construct `typing of user-defined logic type' is not yet supported. + Ignoring annotation. +:0:[e-acsl] warning: E-ACSL construct `typing of user-defined logic type' is not yet supported. + Ignoring annotation. +:0:[e-acsl] warning: E-ACSL construct `typing of user-defined logic type' is not yet supported. + Ignoring annotation. +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:232:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:133:[value] Function __gmpz_neg: precondition got status valid. +PROJECT_FILE.i:134:[value] Function __gmpz_neg: precondition got status valid. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:241. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:243. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:244. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:245. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:246. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:250:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:257. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:261. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:263. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:264. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:268:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_com <- main. + Called from PROJECT_FILE.i:275. +[kernel] warning: No code for function __gmpz_com, default assigns generated +[value] Done for function __gmpz_com +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:277. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:278. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:279. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:283:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:292. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:293. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:294. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:295. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:297. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:298. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:299. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:300. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:301. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:302. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:304. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:308:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:318. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:319. +PROJECT_FILE.i:144:[value] Function __gmpz_sub: precondition got status valid. +PROJECT_FILE.i:145:[value] Function __gmpz_sub: precondition got status valid. +PROJECT_FILE.i:146:[value] Function __gmpz_sub: precondition got status valid. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:320. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:321. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:322. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:323. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:324. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:325. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:326. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:327. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:328. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:329. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:333:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:342. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:343. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_mul <- main. + Called from PROJECT_FILE.i:344. +PROJECT_FILE.i:150:[value] Function __gmpz_mul: precondition got status valid. +PROJECT_FILE.i:151:[value] Function __gmpz_mul: precondition got status valid. +PROJECT_FILE.i:152:[value] Function __gmpz_mul: precondition got status valid. +[value] Done for function __gmpz_mul +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:345. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:346. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:347. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:348. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:349. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:350. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:351. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:352. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:353. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:354. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:358:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:370. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:371. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:372. +[value] Done for function __gmpz_init +PROJECT_FILE.i:373:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:374. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_q <- main. + Called from PROJECT_FILE.i:375. +PROJECT_FILE.i:156:[value] Function __gmpz_tdiv_q: precondition got status valid. +PROJECT_FILE.i:157:[value] Function __gmpz_tdiv_q: precondition got status valid. +PROJECT_FILE.i:158:[value] Function __gmpz_tdiv_q: precondition got status valid. +[value] Done for function __gmpz_tdiv_q +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:376. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:377. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:378. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:379. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:380. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:381. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:382. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:384. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:385. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:386. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:390:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_str <- main. + Called from PROJECT_FILE.i:398. +PROJECT_FILE.i:86:[value] Function __gmpz_init_set_str: postcondition got status valid. +[value] Done for function __gmpz_init_set_str +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:399. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:400. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:401. +[value] Done for function __gmpz_init +PROJECT_FILE.i:402:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:403. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_q <- main. + Called from PROJECT_FILE.i:404. +[value] Done for function __gmpz_tdiv_q +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:405. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:406. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:407. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:409. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:410. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:411. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:412. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:416:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:426. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:427. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:428. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:429. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:430. +[value] Done for function __gmpz_init +PROJECT_FILE.i:431:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:432. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_r <- main. + Called from PROJECT_FILE.i:433. +PROJECT_FILE.i:162:[value] Function __gmpz_tdiv_r: precondition got status valid. +PROJECT_FILE.i:163:[value] Function __gmpz_tdiv_r: precondition got status valid. +PROJECT_FILE.i:164:[value] Function __gmpz_tdiv_r: precondition got status valid. +[value] Done for function __gmpz_tdiv_r +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:434. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:435. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:436. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:437. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:438. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:439. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:440. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:441. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:442. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:443. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:444. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:448:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:460. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:461. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:462. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:463. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:464. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:465. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:466. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:467. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:468. +[value] Done for function __gmpz_init +PROJECT_FILE.i:469:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:470. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_r <- main. + Called from PROJECT_FILE.i:471. +[value] Done for function __gmpz_tdiv_r +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:472. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:473. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:474. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:475. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:476. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:477. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:478. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:479. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:480. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:481. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:482. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:483. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:484. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:488:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:498. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:499. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:500. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:501. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:502. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:503. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:504. +[value] Done for function __gmpz_init +PROJECT_FILE.i:505:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:506. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_r <- main. + Called from PROJECT_FILE.i:507. +[value] Done for function __gmpz_tdiv_r +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:508. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:509. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:510. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:511. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:512. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:513. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:514. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:515. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:516. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:520:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:536. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:537. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:538. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_mul <- main. + Called from PROJECT_FILE.i:539. +[value] Done for function __gmpz_mul +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:540. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:541. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:542. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:543. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:544. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:545. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:546. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:547. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:548. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:549. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:550. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:551. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:552. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:553. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:554. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:555. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:556. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:557. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:559. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:560. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:561. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:562. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:563. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:564. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:565. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:566. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:567. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:568. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:569. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:570. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:571. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:575:[value] Assertion got status valid. +PROJECT_FILE.i:577:[value] Assertion got status valid. +PROJECT_FILE.i:579:[value] Assertion got status valid. +PROJECT_FILE.i:581:[value] Assertion got status valid. +PROJECT_FILE.i:583:[value] Assertion got status valid. +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {-3} + y ∈ {2} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +/*@ behavior generated: + assigns \at(\result,Post) \from \nothing; */ +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle index 08b89806eee..36eca092724 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/arith.res.oracle @@ -145,28 +145,28 @@ int main(void) x = -3; y = 2; /*@ assert -3 ≡ x; */ ; - e_acsl_assert(! (-3 == x),(char *)"Assertion",(char *)"(-3 == x)",11); + e_acsl_assert(! (-3 == x),(char *)"Assertion",(char *)"(-3 == x)",12); /*@ assert x ≡ -3; */ ; - e_acsl_assert(! (x == -3),(char *)"Assertion",(char *)"(x == -3)",12); + e_acsl_assert(! (x == -3),(char *)"Assertion",(char *)"(x == -3)",13); /*@ assert 0 ≢ ~0; */ ; - e_acsl_assert(! (0 != ~ 0),(char *)"Assertion",(char *)"(0 != ~0)",13); + e_acsl_assert(! (0 != ~ 0),(char *)"Assertion",(char *)"(0 != ~0)",14); /*@ assert x+1 ≡ -2; */ ; e_acsl_assert(! ((long long)x + (long long)1 == (long long)-2), - (char *)"Assertion",(char *)"(x+1 == -2)",15); + (char *)"Assertion",(char *)"(x+1 == -2)",16); /*@ assert x-1 ≡ -4; */ ; e_acsl_assert(! ((long long)x - (long long)1 == (long long)-4), - (char *)"Assertion",(char *)"(x-1 == -4)",16); + (char *)"Assertion",(char *)"(x-1 == -4)",17); /*@ assert x*3 ≡ -9; */ ; e_acsl_assert(! ((long long)x * (long long)3 == (long long)-9), - (char *)"Assertion",(char *)"(x*3 == -9)",17); + (char *)"Assertion",(char *)"(x*3 == -9)",18); /*@ assert x/3 ≡ -1; */ ; { int e_acsl_1; /*@ assert 3 ≢ 0; */ ; - e_acsl_assert(3 == 0,(char *)"Assertion",(char *)"(3 == 0)",18); + e_acsl_assert(3 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); e_acsl_1 = x / 3; e_acsl_assert(! (e_acsl_1 == -1),(char *)"Assertion", - (char *)"(x/3 == -1)",18); + (char *)"(x/3 == -1)",19); } /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; @@ -174,62 +174,62 @@ int main(void) int e_acsl_2; /*@ assert 0xfffffffffff ≢ 0; */ ; e_acsl_assert(0xfffffffffff == (long long)0,(char *)"Assertion", - (char *)"(0xfffffffffff == 0)",19); + (char *)"(0xfffffffffff == 0)",20); e_acsl_2 = (int)(0xfffffffffff / 0xfffffffffff); e_acsl_assert(! (e_acsl_2 == 1),(char *)"Assertion", - (char *)"(0xfffffffffff/0xfffffffffff == 1)",19); + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); } /*@ assert x%2 ≡ -1; */ ; { int e_acsl_3; /*@ assert 2 ≢ 0; */ ; - e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",20); + e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); e_acsl_3 = x % 2; e_acsl_assert(! (e_acsl_3 == -1),(char *)"Assertion", - (char *)"(x%2 == -1)",20); + (char *)"(x%2 == -1)",21); } /*@ assert -3%-2 ≡ -1; */ ; { int e_acsl_4; /*@ assert -2 ≢ 0; */ ; - e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",21); + e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); e_acsl_4 = -3 % -2; e_acsl_assert(! (e_acsl_4 == -1),(char *)"Assertion", - (char *)"(-3%-2 == -1)",21); + (char *)"(-3%-2 == -1)",22); } /*@ assert 3%-2 ≡ 1; */ ; { int e_acsl_5; /*@ assert -2 ≢ 0; */ ; - e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); e_acsl_5 = 3 % -2; e_acsl_assert(! (e_acsl_5 == 1),(char *)"Assertion", - (char *)"(3%-2 == 1)",22); + (char *)"(3%-2 == 1)",23); } /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; e_acsl_assert(! ((((long long)x * (long long)2 + ((long long)3 + (long long)y)) - (long long)4) + ( (long long)x - (long long)y) == (long long)-10), (char *)"Assertion",(char *)"(((x*2+(3+y))-4)+(x-y) == -10)", - 24); + 25); /*@ assert (0≡1) ≡ !(0≡0); */ ; e_acsl_assert(! ((0 == 1) == ! (0 == 0)),(char *)"Assertion", - (char *)"((0==1) == !(0==0))",26); + (char *)"((0==1) == !(0==0))",27); /*@ assert (0≤-1) ≡ (0>0); */ ; e_acsl_assert(! ((0 <= -1) == (0 > 0)),(char *)"Assertion", - (char *)"((0<=-1) == (0>0))",27); + (char *)"((0<=-1) == (0>0))",28); /*@ assert (0≥-1) ≡ (0≤0); */ ; e_acsl_assert(! ((0 >= -1) == (0 <= 0)),(char *)"Assertion", - (char *)"((0>=-1) == (0<=0))",28); + (char *)"((0>=-1) == (0<=0))",29); /*@ assert (0≢1) ≡ !(0≢0); */ ; e_acsl_assert(! ((0 != 1) == ! (0 != 0)),(char *)"Assertion", - (char *)"((0!=1) == !(0!=0))",29); + (char *)"((0!=1) == !(0!=0))",30); /*@ assert (0≢0) ≡ !(1≢0); */ ; e_acsl_assert(! ((0 != 0) == ! (1 != 0)),(char *)"Assertion", - (char *)"((0!=0) == !(1!=0))",31); + (char *)"((0!=0) == !(1!=0))",32); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.res.oracle new file mode 100644 index 00000000000..1ba9b049d60 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.1.res.oracle @@ -0,0 +1,172 @@ +tests/e-acsl-runtime/array.i:14:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index +tests/e-acsl-runtime/array.i:14:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index +tests/e-acsl-runtime/array.i:15:[e-acsl] warning: missing guard for ensuring that 1 is a valid array index +tests/e-acsl-runtime/array.i:15:[e-acsl] warning: missing guard for ensuring that 1 is a valid array index +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization + T1[0..2] ∈ {0} + T2[0..3] ∈ {0} +PROJECT_FILE.i:232:[value] entering loop for the first time +PROJECT_FILE.i:236:[value] assigning non deterministic value for the first time +PROJECT_FILE.i:241:[value] entering loop for the first time +PROJECT_FILE.i:248:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:253. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:255. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:256. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:257. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:262:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:267. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:268. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:270. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:272. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + T1[0] ∈ {0; 2} + [1..2] ∈ {0; 1; 2} + T2[0] ∈ {0; 2} + [1..3] ∈ {0; 2; 4; 6} + __retres ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int T1[3]; +int T2[4]; +int main(void) +{ + int __retres; + { int i; + i = 0; + while (1) { + if (! (i < 3)) { break; } + T1[i] = i; + i ++; } } + + { + int i_0; + i_0 = 0; + while (1) { + if (! (i_0 < 4)) { break; } + T2[i_0] = 2 * i_0; + i_0 ++; } + } + + /*@ assert T1[0] ≡ T2[0]; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)T1[0]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)T2[0]); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"(T1[0] == T2[0])",14); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert T1[1] ≢ T2[1]; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)T1[1]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)T2[1]); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 != 0),(char *)"Assertion", + (char *)"(T1[1] != T2[1])",15); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.res.oracle index d3543e02e1f..314e6f5a45b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/array.res.oracle @@ -1,7 +1,7 @@ -tests/e-acsl-runtime/array.i:13:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index -tests/e-acsl-runtime/array.i:13:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index -tests/e-acsl-runtime/array.i:14:[e-acsl] warning: missing guard for ensuring that 1 is a valid array index -tests/e-acsl-runtime/array.i:14:[e-acsl] warning: missing guard for ensuring that 1 is a valid array index +tests/e-acsl-runtime/array.i:14:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index +tests/e-acsl-runtime/array.i:14:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index +tests/e-acsl-runtime/array.i:15:[e-acsl] warning: missing guard for ensuring that 1 is a valid array index +tests/e-acsl-runtime/array.i:15:[e-acsl] warning: missing guard for ensuring that 1 is a valid array index [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed @@ -84,10 +84,10 @@ int main(void) /*@ assert T1[0] ≡ T2[0]; */ ; e_acsl_assert(! (T1[0] == T2[0]),(char *)"Assertion", - (char *)"(T1[0] == T2[0])",13); + (char *)"(T1[0] == T2[0])",14); /*@ assert T1[1] ≢ T2[1]; */ ; e_acsl_assert(! (T1[1] != T2[1]),(char *)"Assertion", - (char *)"(T1[1] != T2[1])",14); + (char *)"(T1[1] != T2[1])",15); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.res.oracle new file mode 100644 index 00000000000..2bf3cbe9dc0 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.1.res.oracle @@ -0,0 +1,674 @@ +tests/e-acsl-runtime/at.i:32:[e-acsl] warning: missing guard for ensuring that q is a valid memory access +tests/e-acsl-runtime/at.i:32:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid pointer +tests/e-acsl-runtime/at.i:32:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid memory access +tests/e-acsl-runtime/at.i:34:[e-acsl] warning: missing guard for ensuring that q is a valid memory access +tests/e-acsl-runtime/at.i:34:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid pointer +tests/e-acsl-runtime/at.i:34:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid memory access +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization + A ∈ {0} +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:385. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:386. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:387. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:388. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set <- main. + Called from PROJECT_FILE.i:389. +PROJECT_FILE.i:73:[value] Function __gmpz_init_set: precondition got status valid. +PROJECT_FILE.i:74:[value] Function __gmpz_init_set: postcondition got status valid. +[value] Done for function __gmpz_init_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:390. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:391. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:392. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:396:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:401. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:402. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:403. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:404. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:405. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:406. +[value] Done for function __gmpz_clear +[value] computing for function f <- main. + Called from PROJECT_FILE.i:412. +PROJECT_FILE.i:242:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:247. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:248. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:250. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:256:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:261. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:263. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:264. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:265. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:270:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:277. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:278. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:279. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:285:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:290. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:292. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:293. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:295. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:306. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:307. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:308. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:309. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:310. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:311. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:226:[value] Function f: postcondition got status valid. +[value] Recording results for f +[value] Done for function f +PROJECT_FILE.i:413:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:418. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:419. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:420. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:421. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:422. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:423. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:427:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:431. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:432. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:433. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:434. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:438:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:444. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:446. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:447. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:448. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:449. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:450. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:451. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:452. +[value] Done for function __gmpz_clear +[value] computing for function g <- main. + Called from PROJECT_FILE.i:456. +PROJECT_FILE.i:335:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:340. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- g <- main. + Called from PROJECT_FILE.i:342. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:343. +[value] computing for function printf <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:345. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:346. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:351:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:358. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- g <- main. + Called from PROJECT_FILE.i:359. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:360. +[value] computing for function printf <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:362. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:363. +[value] Done for function __gmpz_clear +[value] Recording results for g +[value] Done for function g +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:458. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function f: + A ∈ {3} + e_acsl_1 ∈ {0} + e_acsl_5 ∈ {1} + e_acsl_9 ∈ {2} + e_acsl_13 ∈ {0} + e_acsl_14 ∈ {0} + e_acsl_18 ∈ {3} +[value] Values at end of function g: + A ∈ {4} + e_acsl_1 ∈ {0} + e_acsl_2 ∈ {2} + e_acsl_6 ∈ {0} + e_acsl_7 ∈ {2} + x ∈ {1} + t[0] ∈ {2} + [1] ∈ {3} +[value] Values at end of function main: + A ∈ {4} + __retres ∈ {0} + x ∈ {1} + t[0] ∈ {2} + [1] ∈ {3} + e_acsl_4 ∈ {0} + e_acsl_11[0] ∈ [--..--] or UNINITIALIZED + e_acsl_14 ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z_orig); + ensures \valid(\old(z)); + assigns *z; */ +extern void __gmpz_init_set(__mpz_struct * /*[1]*/ z, + __mpz_struct const * /*[1]*/ z_orig); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int A = 0; +/*@ ensures \at(A,Post) ≡ 3; */ +void f(void) +{ + int e_acsl_1; + int e_acsl_5; + int e_acsl_9; + int e_acsl_13; + int e_acsl_14; + int e_acsl_18; + e_acsl_13 = A; + e_acsl_1 = A; + A = 1; + F: e_acsl_14 = e_acsl_13; + e_acsl_5 = A; + A = 2; + /*@ assert \at(A,Pre) ≡ 0; */ ; + { + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)e_acsl_1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)0); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion", + (char *)"(\\at(A,Pre) == 0)",13); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert \at(A,F) ≡ 1; */ ; + { + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)e_acsl_5); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)1); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_6), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion", + (char *)"(\\at(A,F) == 1)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert \at(A,Here) ≡ 2; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + e_acsl_9 = A; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)e_acsl_9); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)2); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Assertion", + (char *)"(\\at(A,Here) == 2)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + /*@ assert \at(\at(A,Pre),F) ≡ 0; */ ; + { + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)e_acsl_14); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)0); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_15), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(\\at(\\at(A,Pre),F) == 0)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + A = 3; + { + mpz_t e_acsl_19; + mpz_t e_acsl_20; + int e_acsl_21; + e_acsl_18 = A; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)e_acsl_18); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)3); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_20)); + e_acsl_assert(! (e_acsl_21 == 0),(char *)"Postcondition", + (char *)"(\\at(A,Post) == 3)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + return; + } + +} + +void g(int *p, int *q) +{ + int e_acsl_1; + int e_acsl_2; + int e_acsl_6; + int e_acsl_7; + *p = 0; + *(p + 1) = 1; + *q = 0; + L1: e_acsl_6 = *q; + e_acsl_1 = *q; + *p = 2; + *(p + 1) = 3; + *q = 1; + L2: e_acsl_2 = *(p + (long)e_acsl_1); + A = 4; + /*@ assert \at(*(p+\at(*q,L1)),L2) ≡ 2; */ ; + { + mpz_t e_acsl_3; + mpz_t e_acsl_4; + int e_acsl_5; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)e_acsl_2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)2); + e_acsl_5 = __gmpz_cmp((__mpz_struct const *)(e_acsl_3), + (__mpz_struct const *)(e_acsl_4)); + e_acsl_assert(! (e_acsl_5 == 0),(char *)"Assertion", + (char *)"(\\at(*(p+\\at(*q,L1)),L2) == 2)",32); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + } + + L3: + /*@ assert \at(*(p+\at(*q,L1)),Here) ≡ 2; */ ; + { + mpz_t e_acsl_8; + mpz_t e_acsl_9; + int e_acsl_10; + e_acsl_7 = *(p + (long)e_acsl_6); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)e_acsl_7); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)2); + e_acsl_10 = __gmpz_cmp((__mpz_struct const *)(e_acsl_8), + (__mpz_struct const *)(e_acsl_9)); + e_acsl_assert(! (e_acsl_10 == 0),(char *)"Assertion", + (char *)"(\\at(*(p+\\at(*q,L1)),Here) == 2)",34); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + } + + return; +} + +int main(void) +{ + int __retres; + int x; + int t[2]; + int e_acsl_4; + mpz_t e_acsl_11; + int e_acsl_14; + x = 0; + L: e_acsl_14 = x; + { + mpz_t e_acsl_8; + mpz_t e_acsl_9; + mpz_t e_acsl_10; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_add((__mpz_struct *)(e_acsl_10),(__mpz_struct const *)(e_acsl_8), + (__mpz_struct const *)(e_acsl_9)); + __gmpz_init_set((__mpz_struct *)(e_acsl_11), + (__mpz_struct const *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + e_acsl_4 = x; + /*@ assert x ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(x == 0)", + 45); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + x = 1; + x = 2; + f(); + /*@ assert \at(x,L) ≡ 0; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)e_acsl_4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)0); + e_acsl_7 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_6)); + e_acsl_assert(! (e_acsl_7 == 0),(char *)"Assertion", + (char *)"(\\at(x,L) == 0)",50); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + } + + /*@ assert \at(x+1,L) ≡ 1; */ ; + { + mpz_t e_acsl_12; + int e_acsl_13; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)1); + e_acsl_13 = __gmpz_cmp((__mpz_struct const *)(e_acsl_11), + (__mpz_struct const *)(e_acsl_12)); + e_acsl_assert(! (e_acsl_13 == 0),(char *)"Assertion", + (char *)"(\\at(x+1,L) == 1)",51); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + } + + /*@ assert \at(x,L)+1 ≡ 1; */ ; + { + mpz_t e_acsl_15; + mpz_t e_acsl_16; + mpz_t e_acsl_17; + int e_acsl_18; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)e_acsl_14); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_17)); + __gmpz_add((__mpz_struct *)(e_acsl_17),(__mpz_struct const *)(e_acsl_15), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_17), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_18 == 0),(char *)"Assertion", + (char *)"(\\at(x,L)+1 == 1)",52); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + } + + g(t,& x); + __retres = 0; + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.res.oracle index 994bd214a8b..8282029888d 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/at.res.oracle @@ -1,9 +1,9 @@ -tests/e-acsl-runtime/at.i:31:[e-acsl] warning: missing guard for ensuring that q is a valid memory access -tests/e-acsl-runtime/at.i:31:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid pointer -tests/e-acsl-runtime/at.i:31:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid memory access -tests/e-acsl-runtime/at.i:33:[e-acsl] warning: missing guard for ensuring that q is a valid memory access -tests/e-acsl-runtime/at.i:33:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid pointer -tests/e-acsl-runtime/at.i:33:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid memory access +tests/e-acsl-runtime/at.i:32:[e-acsl] warning: missing guard for ensuring that q is a valid memory access +tests/e-acsl-runtime/at.i:32:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid pointer +tests/e-acsl-runtime/at.i:32:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid memory access +tests/e-acsl-runtime/at.i:34:[e-acsl] warning: missing guard for ensuring that q is a valid memory access +tests/e-acsl-runtime/at.i:34:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid pointer +tests/e-acsl-runtime/at.i:34:[e-acsl] warning: missing guard for ensuring that p+\at(*q,L1) is a valid memory access [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed @@ -137,21 +137,21 @@ void f(void) A = 2; /*@ assert \at(A,Pre) ≡ 0; */ ; e_acsl_assert(! (e_acsl_1 == 0),(char *)"Assertion", - (char *)"(\\at(A,Pre) == 0)",12); + (char *)"(\\at(A,Pre) == 0)",13); /*@ assert \at(A,F) ≡ 1; */ ; e_acsl_assert(! (e_acsl_2 == 1),(char *)"Assertion", - (char *)"(\\at(A,F) == 1)",13); + (char *)"(\\at(A,F) == 1)",14); /*@ assert \at(A,Here) ≡ 2; */ ; e_acsl_3 = A; e_acsl_assert(! (e_acsl_3 == 2),(char *)"Assertion", - (char *)"(\\at(A,Here) == 2)",14); + (char *)"(\\at(A,Here) == 2)",15); /*@ assert \at(\at(A,Pre),F) ≡ 0; */ ; e_acsl_assert(! (e_acsl_5 == 0),(char *)"Assertion", - (char *)"(\\at(\\at(A,Pre),F) == 0)",15); + (char *)"(\\at(\\at(A,Pre),F) == 0)",16); A = 3; e_acsl_6 = A; e_acsl_assert(! (e_acsl_6 == 3),(char *)"Postcondition", - (char *)"(\\at(A,Post) == 3)",8); + (char *)"(\\at(A,Post) == 3)",9); return; } @@ -173,12 +173,12 @@ void g(int *p, int *q) A = 4; /*@ assert \at(*(p+\at(*q,L1)),L2) ≡ 2; */ ; e_acsl_assert(! (e_acsl_2 == 2),(char *)"Assertion", - (char *)"(\\at(*(p+\\at(*q,L1)),L2) == 2)",31); + (char *)"(\\at(*(p+\\at(*q,L1)),L2) == 2)",32); L3: /*@ assert \at(*(p+\at(*q,L1)),Here) ≡ 2; */ ; e_acsl_4 = *(p + e_acsl_3); e_acsl_assert(! (e_acsl_4 == 2),(char *)"Assertion", - (char *)"(\\at(*(p+\\at(*q,L1)),Here) == 2)",33); + (char *)"(\\at(*(p+\\at(*q,L1)),Here) == 2)",34); return; } @@ -195,19 +195,19 @@ int main(void) e_acsl_2 = (long long)x + (long long)1; e_acsl_1 = x; /*@ assert x ≡ 0; */ ; - e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",44); + e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",45); x = 1; x = 2; f(); /*@ assert \at(x,L) ≡ 0; */ ; e_acsl_assert(! (e_acsl_1 == 0),(char *)"Assertion", - (char *)"(\\at(x,L) == 0)",49); + (char *)"(\\at(x,L) == 0)",50); /*@ assert \at(x+1,L) ≡ 1; */ ; e_acsl_assert(! (e_acsl_2 == (long long)1),(char *)"Assertion", - (char *)"(\\at(x+1,L) == 1)",50); + (char *)"(\\at(x+1,L) == 1)",51); /*@ assert \at(x,L)+1 ≡ 1; */ ; e_acsl_assert(! ((long long)e_acsl_3 + (long long)1 == (long long)1), - (char *)"Assertion",(char *)"(\\at(x,L)+1 == 1)",51); + (char *)"Assertion",(char *)"(\\at(x,L)+1 == 1)",52); g(t,& x); __retres = 0; return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.res.oracle new file mode 100644 index 00000000000..1649ba8c8f9 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.1.res.oracle @@ -0,0 +1,360 @@ +tests/e-acsl-runtime/cast.i:18:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +tests/e-acsl-runtime/cast.i:19:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:232:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:240. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:241. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:246:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:254. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:260:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:265. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:267. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:268. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:274:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_ui <- main. + Called from PROJECT_FILE.i:279. +PROJECT_FILE.i:78:[value] Function __gmpz_init_set_ui: postcondition got status valid. +[value] Done for function __gmpz_init_set_ui +[value] computing for function __gmpz_init_set_ui <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_init_set_ui +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:282. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:284. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:285. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:289:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_str <- main. + Called from PROJECT_FILE.i:297. +PROJECT_FILE.i:86:[value] Function __gmpz_init_set_str: postcondition got status valid. +[value] Done for function __gmpz_init_set_str +[value] computing for function __gmpz_get_ui <- main. + Called from PROJECT_FILE.i:298. +PROJECT_FILE.i:176:[value] Function __gmpz_get_ui: precondition got status valid. +[value] Done for function __gmpz_get_ui +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:299. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:300. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:301. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:304. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:305. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:309:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_ui <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_init_set_ui +[value] computing for function __gmpz_init_set_str <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_init_set_str +[value] computing for function __gmpz_get_ui <- main. + Called from PROJECT_FILE.i:318. +[value] Done for function __gmpz_get_ui +[value] computing for function __gmpz_init_set_ui <- main. + Called from PROJECT_FILE.i:319. +[value] Done for function __gmpz_init_set_ui +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:320. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:321. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:323. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:324. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:325. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} + y ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_ui(__mpz_struct * /*[1]*/ z, unsigned long n); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z); + assigns \nothing; */ +extern unsigned long __gmpz_get_ui(__mpz_struct const * /*[1]*/ z); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + long x; + int y; + x = (long)0; + y = 0; + /*@ assert (int)x ≡ y; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)((int)x)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"((int)x == y)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert x ≡ (long)y; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)y); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(x == (long)y)",12); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + /*@ assert y ≡ (int)0; */ ; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Assertion", + (char *)"(y == (int)0)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + /*@ assert (unsigned int)y ≡ (unsigned int)0; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_10), + (unsigned long)((unsigned int)y)); + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_11), + (unsigned long)((unsigned int)0)); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Assertion", + (char *)"((unsigned int)y == (unsigned int)0)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + /*@ assert y ≢ (int)0xfffffffffffffff; */ ; + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + unsigned long e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)y); + __gmpz_init_set_str((__mpz_struct *)(e_acsl_14),"1152921504606846975",10); + e_acsl_15 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_14)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)((int)e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 != 0),(char *)"Assertion", + (char *)"(y != (int)0xfffffffffffffff)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert (unsigned int)y ≢ (unsigned int)0xfffffffffffffff; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + unsigned long e_acsl_20; + mpz_t e_acsl_21; + int e_acsl_22; + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_18), + (unsigned long)((unsigned int)y)); + __gmpz_init_set_str((__mpz_struct *)(e_acsl_19),"1152921504606846975",10); + e_acsl_20 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_21), + (unsigned long)((unsigned int)e_acsl_20)); + e_acsl_22 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_21)); + e_acsl_assert(! (e_acsl_22 != 0),(char *)"Assertion", + (char *)"((unsigned int)y != (unsigned int)0xfffffffffffffff)", + 19); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle index bdf7d65fb54..0f509cdfdbe 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/cast.res.oracle @@ -66,23 +66,23 @@ int main(void) y = 0; /*@ assert (int)x ≡ y; */ ; e_acsl_assert(! ((int)x == y),(char *)"Assertion",(char *)"((int)x == y)", - 10); + 11); /*@ assert x ≡ (long)y; */ ; e_acsl_assert(! (x == (long)y),(char *)"Assertion", - (char *)"(x == (long)y)",11); + (char *)"(x == (long)y)",12); /*@ assert y ≡ (int)0; */ ; - e_acsl_assert(! (y == 0),(char *)"Assertion",(char *)"(y == (int)0)",13); + e_acsl_assert(! (y == 0),(char *)"Assertion",(char *)"(y == (int)0)",14); /*@ assert (unsigned int)y ≡ (unsigned int)0; */ ; e_acsl_assert(! ((unsigned int)y == (unsigned int)0),(char *)"Assertion", - (char *)"((unsigned int)y == (unsigned int)0)",14); + (char *)"((unsigned int)y == (unsigned int)0)",15); /*@ assert y ≢ (int)0xfffffffffffffff; */ ; e_acsl_assert(! (y != (int)0xfffffffffffffff),(char *)"Assertion", - (char *)"(y != (int)0xfffffffffffffff)",17); + (char *)"(y != (int)0xfffffffffffffff)",18); /*@ assert (unsigned int)y ≢ (unsigned int)0xfffffffffffffff; */ ; e_acsl_assert(! ((unsigned int)y != (unsigned int)0xfffffffffffffff), (char *)"Assertion", (char *)"((unsigned int)y != (unsigned int)0xfffffffffffffff)", - 18); + 19); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.res.oracle new file mode 100644 index 00000000000..53d62855784 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.1.res.oracle @@ -0,0 +1,808 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:233:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:239. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:241. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:247:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:255. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:257. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:261:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:267. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:268. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:269. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:275:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:282. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:283. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:284. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:285. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:290:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:291. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +PROJECT_FILE.i:293:[value] Assertion got status unknown. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:294. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +PROJECT_FILE.i:296:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:301. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:302. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:304. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:305. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:306. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:310:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:315. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:318. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:319. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:320. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:324:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:329. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:330. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:331. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:332. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:333. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:334. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:338:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:343. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:344. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:345. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:346. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:347. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:348. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:352:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:356. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:358. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:359. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:363:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:370. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:371. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:372. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:373. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:377:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:384. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:385. +PROJECT_FILE.i:133:[value] Function __gmpz_neg: precondition got status valid. +PROJECT_FILE.i:134:[value] Function __gmpz_neg: precondition got status valid. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:386. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:387. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:388. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:389. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:390. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:391. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:395:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:401. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:402. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:403. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:404. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:405. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:406. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:407. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:408. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:409. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:413:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:419. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:420. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:421. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:422. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:423. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:424. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:425. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:426. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:427. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:431:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:437. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:438. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:439. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:440. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:441. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:442. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:443. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:444. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:449:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:454. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:455. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:456. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:457. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:458. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:459. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:460. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:464:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:470. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:471. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:472. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_neg <- main. + Called from PROJECT_FILE.i:473. +[value] Done for function __gmpz_neg +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:474. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:475. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:476. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:477. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:478. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} + y ∈ {1} + s ∈ {{ &"toto" }} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + char *s; + x = 0; + y = 1; + /*@ assert x < y; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 < 0),(char *)"Assertion",(char *)"(x < y)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert y > x; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 > 0),(char *)"Assertion",(char *)"(y > x)",10); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + /*@ assert x ≤ 0; */ ; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 <= 0),(char *)"Assertion",(char *)"(x <= 0)", + 11); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + /*@ assert y ≥ 1; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)1); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 >= 0),(char *)"Assertion",(char *)"(y >= 1)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + s = (char *)"toto"; + /*@ assert s ≡ s; */ ; + e_acsl_assert(! (s == s),(char *)"Assertion",(char *)"(s == s)",14); + /*@ assert "toto" ≢ "titi"; */ ; + e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", + (char *)"(\"toto\" != \"titi\")",15); + /*@ assert 5 < 18; */ ; + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + int e_acsl_15; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)5); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)18); + e_acsl_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + e_acsl_assert(! (e_acsl_15 < 0),(char *)"Assertion",(char *)"(5 < 18)", + 16); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + } + + /*@ assert 32 > 3; */ ; + { + mpz_t e_acsl_16; + mpz_t e_acsl_17; + int e_acsl_18; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)32); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_17),(long)3); + e_acsl_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_17)); + e_acsl_assert(! (e_acsl_18 > 0),(char *)"Assertion",(char *)"(32 > 3)", + 17); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + } + + /*@ assert 12 ≤ 13; */ ; + { + mpz_t e_acsl_19; + mpz_t e_acsl_20; + int e_acsl_21; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)12); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)13); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_20)); + e_acsl_assert(! (e_acsl_21 <= 0),(char *)"Assertion", + (char *)"(12 <= 13)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + } + + /*@ assert 123 ≥ 12; */ ; + { + mpz_t e_acsl_22; + mpz_t e_acsl_23; + int e_acsl_24; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)123); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_23),(long)12); + e_acsl_24 = __gmpz_cmp((__mpz_struct const *)(e_acsl_22), + (__mpz_struct const *)(e_acsl_23)); + e_acsl_assert(! (e_acsl_24 >= 0),(char *)"Assertion", + (char *)"(123 >= 12)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + } + + /*@ assert 0xff ≡ 0xff; */ ; + { + mpz_t e_acsl_25; + int e_acsl_26; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)0xff); + e_acsl_26 = __gmpz_cmp((__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_25)); + e_acsl_assert(! (e_acsl_26 == 0),(char *)"Assertion", + (char *)"(0xff == 0xff)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + } + + /*@ assert 1 ≢ 2; */ ; + { + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_28),(long)2); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_27), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 != 0),(char *)"Assertion",(char *)"(1 != 2)", + 21); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert -5 < 18; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)5); + __gmpz_init((__mpz_struct *)(e_acsl_31)); + __gmpz_neg((__mpz_struct *)(e_acsl_31),(__mpz_struct const *)(e_acsl_30)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)18); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_assert(! (e_acsl_33 < 0),(char *)"Assertion",(char *)"(-5 < 18)", + 23); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + /*@ assert 32 > -3; */ ; + { + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_34),(long)32); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 > 0),(char *)"Assertion",(char *)"(32 > -3)", + 24); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert -12 ≤ 13; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + mpz_t e_acsl_40; + int e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)12); + __gmpz_init((__mpz_struct *)(e_acsl_39)); + __gmpz_neg((__mpz_struct *)(e_acsl_39),(__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_40),(long)13); + e_acsl_41 = __gmpz_cmp((__mpz_struct const *)(e_acsl_39), + (__mpz_struct const *)(e_acsl_40)); + e_acsl_assert(! (e_acsl_41 <= 0),(char *)"Assertion", + (char *)"(-12 <= 13)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_40)); + } + + /*@ assert 123 ≥ -12; */ ; + { + mpz_t e_acsl_42; + mpz_t e_acsl_43; + mpz_t e_acsl_44; + int e_acsl_45; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)123); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_43),(long)12); + __gmpz_init((__mpz_struct *)(e_acsl_44)); + __gmpz_neg((__mpz_struct *)(e_acsl_44),(__mpz_struct const *)(e_acsl_43)); + e_acsl_45 = __gmpz_cmp((__mpz_struct const *)(e_acsl_42), + (__mpz_struct const *)(e_acsl_44)); + e_acsl_assert(! (e_acsl_45 >= 0),(char *)"Assertion", + (char *)"(123 >= -12)",26); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + } + + /*@ assert -0xff ≡ -0xff; */ ; + { + mpz_t e_acsl_46; + mpz_t e_acsl_47; + int e_acsl_48; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0xff); + __gmpz_init((__mpz_struct *)(e_acsl_47)); + __gmpz_neg((__mpz_struct *)(e_acsl_47),(__mpz_struct const *)(e_acsl_46)); + e_acsl_48 = __gmpz_cmp((__mpz_struct const *)(e_acsl_47), + (__mpz_struct const *)(e_acsl_47)); + e_acsl_assert(! (e_acsl_48 == 0),(char *)"Assertion", + (char *)"(-0xff == -0xff)",27); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_47)); + } + + /*@ assert 1 ≢ -2; */ ; + { + mpz_t e_acsl_49; + mpz_t e_acsl_50; + mpz_t e_acsl_51; + int e_acsl_52; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_50),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_51)); + __gmpz_neg((__mpz_struct *)(e_acsl_51),(__mpz_struct const *)(e_acsl_50)); + e_acsl_52 = __gmpz_cmp((__mpz_struct const *)(e_acsl_49), + (__mpz_struct const *)(e_acsl_51)); + e_acsl_assert(! (e_acsl_52 != 0),(char *)"Assertion",(char *)"(1 != -2)", + 28); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + __gmpz_clear((__mpz_struct *)(e_acsl_51)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle index a1afa6a7997..77c9c858836 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/comparison.res.oracle @@ -127,45 +127,45 @@ int main(void) x = 0; y = 1; /*@ assert x < y; */ ; - e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",8); + e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",9); /*@ assert y > x; */ ; - e_acsl_assert(! (y > x),(char *)"Assertion",(char *)"(y > x)",9); + e_acsl_assert(! (y > x),(char *)"Assertion",(char *)"(y > x)",10); /*@ assert x ≤ 0; */ ; - e_acsl_assert(! (x <= 0),(char *)"Assertion",(char *)"(x <= 0)",10); + e_acsl_assert(! (x <= 0),(char *)"Assertion",(char *)"(x <= 0)",11); /*@ assert y ≥ 1; */ ; - e_acsl_assert(! (y >= 1),(char *)"Assertion",(char *)"(y >= 1)",11); + e_acsl_assert(! (y >= 1),(char *)"Assertion",(char *)"(y >= 1)",12); s = (char *)"toto"; /*@ assert s ≡ s; */ ; - e_acsl_assert(! (s == s),(char *)"Assertion",(char *)"(s == s)",13); + e_acsl_assert(! (s == s),(char *)"Assertion",(char *)"(s == s)",14); /*@ assert "toto" ≢ "titi"; */ ; e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", - (char *)"(\"toto\" != \"titi\")",14); + (char *)"(\"toto\" != \"titi\")",15); /*@ assert 5 < 18; */ ; - e_acsl_assert(! (5 < 18),(char *)"Assertion",(char *)"(5 < 18)",15); + e_acsl_assert(! (5 < 18),(char *)"Assertion",(char *)"(5 < 18)",16); /*@ assert 32 > 3; */ ; - e_acsl_assert(! (32 > 3),(char *)"Assertion",(char *)"(32 > 3)",16); + e_acsl_assert(! (32 > 3),(char *)"Assertion",(char *)"(32 > 3)",17); /*@ assert 12 ≤ 13; */ ; - e_acsl_assert(! (12 <= 13),(char *)"Assertion",(char *)"(12 <= 13)",17); + e_acsl_assert(! (12 <= 13),(char *)"Assertion",(char *)"(12 <= 13)",18); /*@ assert 123 ≥ 12; */ ; - e_acsl_assert(! (123 >= 12),(char *)"Assertion",(char *)"(123 >= 12)",18); + e_acsl_assert(! (123 >= 12),(char *)"Assertion",(char *)"(123 >= 12)",19); /*@ assert 0xff ≡ 0xff; */ ; e_acsl_assert(! (0xff == 0xff),(char *)"Assertion", - (char *)"(0xff == 0xff)",19); + (char *)"(0xff == 0xff)",20); /*@ assert 1 ≢ 2; */ ; - e_acsl_assert(! (1 != 2),(char *)"Assertion",(char *)"(1 != 2)",20); + e_acsl_assert(! (1 != 2),(char *)"Assertion",(char *)"(1 != 2)",21); /*@ assert -5 < 18; */ ; - e_acsl_assert(! (-5 < 18),(char *)"Assertion",(char *)"(-5 < 18)",22); + e_acsl_assert(! (-5 < 18),(char *)"Assertion",(char *)"(-5 < 18)",23); /*@ assert 32 > -3; */ ; - e_acsl_assert(! (32 > -3),(char *)"Assertion",(char *)"(32 > -3)",23); + e_acsl_assert(! (32 > -3),(char *)"Assertion",(char *)"(32 > -3)",24); /*@ assert -12 ≤ 13; */ ; - e_acsl_assert(! (-12 <= 13),(char *)"Assertion",(char *)"(-12 <= 13)",24); + e_acsl_assert(! (-12 <= 13),(char *)"Assertion",(char *)"(-12 <= 13)",25); /*@ assert 123 ≥ -12; */ ; - e_acsl_assert(! (123 >= -12),(char *)"Assertion",(char *)"(123 >= -12)",25); + e_acsl_assert(! (123 >= -12),(char *)"Assertion",(char *)"(123 >= -12)",26); /*@ assert -0xff ≡ -0xff; */ ; e_acsl_assert(! (-0xff == -0xff),(char *)"Assertion", - (char *)"(-0xff == -0xff)",26); + (char *)"(-0xff == -0xff)",27); /*@ assert 1 ≢ -2; */ ; - e_acsl_assert(! (1 != -2),(char *)"Assertion",(char *)"(1 != -2)",27); + e_acsl_assert(! (1 != -2),(char *)"Assertion",(char *)"(1 != -2)",28); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.res.oracle new file mode 100644 index 00000000000..9526b80c620 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/empty.1.res.oracle @@ -0,0 +1,2 @@ +/* Generated by Frama-C */ + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.res.oracle new file mode 100644 index 00000000000..15b758f6020 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.1.res.oracle @@ -0,0 +1,41 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + if (x) { + /*@ assert \false; */ ; + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",8); + } + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle index 0b3a456203d..15b758f6020 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/false.res.oracle @@ -32,7 +32,7 @@ int main(void) x = 0; if (x) { /*@ assert \false; */ ; - e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",7); + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",8); } __retres = 0; return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.res.oracle new file mode 100644 index 00000000000..2be938dc3c9 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.1.res.oracle @@ -0,0 +1,1300 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization + X ∈ {0} + Y ∈ {2} +[value] computing for function f <- main. + Called from PROJECT_FILE.i:681. +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:235. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:236. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:238. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:240. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:227:[value] Function f: postcondition got status valid. +[value] Recording results for f +[value] Done for function f +[value] computing for function g <- main. + Called from PROJECT_FILE.i:682. +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:257. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- g <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:260. +[value] computing for function printf <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:261. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- g <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:263. +[value] computing for function printf <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:264. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:265. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:246:[value] Function g: postcondition got status valid. +PROJECT_FILE.i:247:[value] Function g: postcondition got status valid. +[value] Recording results for g +[value] Done for function g +[value] computing for function h <- main. + Called from PROJECT_FILE.i:683. +PROJECT_FILE.i:272:[value] Function h: precondition got status valid. +[value] computing for function __gmpz_init_set_si <- h <- main. + Called from PROJECT_FILE.i:279. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- h <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- h <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- h <- main. + Called from PROJECT_FILE.i:282. +[value] computing for function printf <- e_acsl_assert <- h <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- h <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- h <- main. + Called from PROJECT_FILE.i:283. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- h <- main. + Called from PROJECT_FILE.i:284. +[value] Done for function __gmpz_clear +[value] Recording results for h +[value] Done for function h +[value] computing for function i <- main. + Called from PROJECT_FILE.i:684. +PROJECT_FILE.i:291:[value] Function i: precondition got status valid. +PROJECT_FILE.i:292:[value] Function i: precondition got status valid. +[value] computing for function __gmpz_init_set_si <- i <- main. + Called from PROJECT_FILE.i:302. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- i <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- i <- main. + Called from PROJECT_FILE.i:304. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- i <- main. + Called from PROJECT_FILE.i:305. +[value] computing for function printf <- e_acsl_assert <- i <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- i <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- i <- main. + Called from PROJECT_FILE.i:306. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- i <- main. + Called from PROJECT_FILE.i:307. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- i <- main. + Called from PROJECT_FILE.i:308. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- i <- main. + Called from PROJECT_FILE.i:309. +[value] computing for function printf <- e_acsl_assert <- i <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- i <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- i <- main. + Called from PROJECT_FILE.i:310. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- i <- main. + Called from PROJECT_FILE.i:311. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- i <- main. + Called from PROJECT_FILE.i:312. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- i <- main. + Called from PROJECT_FILE.i:313. +[value] Done for function __gmpz_clear +[value] Recording results for i +[value] Done for function i +[value] computing for function j <- main. + Called from PROJECT_FILE.i:685. +PROJECT_FILE.i:321:[value] Function j, behavior b1: precondition got status valid. +PROJECT_FILE.i:325:[value] Function j, behavior b2: precondition got status valid. +PROJECT_FILE.i:326:[value] Function j, behavior b2: precondition got status valid. +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:343. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:344. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- j <- main. + Called from PROJECT_FILE.i:345. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:346. +[value] computing for function printf <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:347. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:348. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- j <- main. + Called from PROJECT_FILE.i:349. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- j <- main. + Called from PROJECT_FILE.i:350. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- j <- main. + Called from PROJECT_FILE.i:351. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:352. +[value] computing for function printf <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:353. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- j <- main. + Called from PROJECT_FILE.i:354. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:355. +[value] computing for function printf <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:356. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:358. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:359. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:360. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:361. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:373. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:374. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- j <- main. + Called from PROJECT_FILE.i:375. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:376. +[value] computing for function printf <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:377. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- j <- main. + Called from PROJECT_FILE.i:378. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- j <- main. + Called from PROJECT_FILE.i:379. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- j <- main. + Called from PROJECT_FILE.i:380. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- j <- main. + Called from PROJECT_FILE.i:381. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:382. +[value] computing for function printf <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- j <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:384. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:385. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:386. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- j <- main. + Called from PROJECT_FILE.i:387. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:322:[value] Function j, behavior b1: postcondition got status valid. +PROJECT_FILE.i:327:[value] Function j, behavior b2: postcondition got status valid. +[value] Recording results for j +[value] Done for function j +[value] computing for function k <- main. + Called from PROJECT_FILE.i:686. +PROJECT_FILE.i:395:[value] Function k, behavior b1: assumption got status invalid; precondition not evaluated. +PROJECT_FILE.i:400:[value] Function k, behavior b2: precondition got status valid. +PROJECT_FILE.i:401:[value] Function k, behavior b2: precondition got status valid. +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:419. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:420. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:421. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:427. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:428. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:429. +[value] Done for function __gmpz_cmp +PROJECT_FILE.i:430:[value] assigning non deterministic value for the first time +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:431. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:432. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:434. +[value] computing for function printf <- e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:435. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:436. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:441. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:442. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:443. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:446. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:454. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:455. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:456. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:458. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:459. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:461. +[value] computing for function printf <- e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:463. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:468. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:469. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:470. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:472. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:473. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:483. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:484. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- k <- main. + Called from PROJECT_FILE.i:485. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- k <- main. + Called from PROJECT_FILE.i:486. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set_si <- k <- main. + Called from PROJECT_FILE.i:487. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- k <- main. + Called from PROJECT_FILE.i:488. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:490. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:491. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:492. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:493. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:495. +[value] computing for function printf <- e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- k <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:497. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:498. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- k <- main. + Called from PROJECT_FILE.i:499. +[value] Done for function __gmpz_clear +[value] Recording results for k +[value] Done for function k +[value] computing for function l <- main. + Called from PROJECT_FILE.i:687. +PROJECT_FILE.i:509:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- l <- main. + Called from PROJECT_FILE.i:514. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- l <- main. + Called from PROJECT_FILE.i:515. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- l <- main. + Called from PROJECT_FILE.i:516. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- l <- main. + Called from PROJECT_FILE.i:517. +[value] computing for function printf <- e_acsl_assert <- l <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- l <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- l <- main. + Called from PROJECT_FILE.i:518. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- l <- main. + Called from PROJECT_FILE.i:519. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- l <- main. + Called from PROJECT_FILE.i:527. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- l <- main. + Called from PROJECT_FILE.i:528. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- l <- main. + Called from PROJECT_FILE.i:529. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- l <- main. + Called from PROJECT_FILE.i:530. +[value] computing for function printf <- e_acsl_assert <- l <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- l <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- l <- main. + Called from PROJECT_FILE.i:531. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- l <- main. + Called from PROJECT_FILE.i:532. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:506:[value] Function l: postcondition got status valid. +[value] Recording results for l +[value] Done for function l +[value] computing for function m <- main. + Called from PROJECT_FILE.i:688. +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:562. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:563. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:564. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:569. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:570. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:571. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:573. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:574. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:578. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:579. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:587. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:588. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:589. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:594. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:595. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:596. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:598. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:599. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:603. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:604. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:611. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:612. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:613. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:615. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:616. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:629. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:630. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:631. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:633. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:634. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:636. +[value] computing for function printf <- e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:643. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:644. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:645. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:647. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:648. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:650. +[value] computing for function printf <- e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:659. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:660. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- m <- main. + Called from PROJECT_FILE.i:661. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- m <- main. + Called from PROJECT_FILE.i:662. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- m <- main. + Called from PROJECT_FILE.i:663. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- m <- main. + Called from PROJECT_FILE.i:664. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:666. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:667. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:668. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- m <- main. + Called from PROJECT_FILE.i:669. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:671. +[value] computing for function printf <- e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- m <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +PROJECT_FILE.i:540:[value] Function m, behavior b1: assumes got status invalid; post-condition not evaluated. +PROJECT_FILE.i:545:[value] Function m, behavior b2: postcondition got status valid. +PROJECT_FILE.i:546:[value] Function m, behavior b2: postcondition got status valid. +[value] Recording results for m +[value] Done for function m +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function f: + X ∈ {1} +[value] Values at end of function g: + X ∈ {2} +[value] Values at end of function h: + X ∈ {3} +[value] Values at end of function i: + X ∈ {5} +[value] Values at end of function j: + X ∈ {3} +[value] Values at end of function k: + X ∈ {5} +[value] Values at end of function l: +[value] Values at end of function m: + X ∈ {7} + e_acsl_4 ∈ {0; 1} + e_acsl_16 ∈ {0; 1} + e_acsl_28 ∈ {0; 1} + e_acsl_30 ∈ {5} +[value] Values at end of function main: + X ∈ {7} + __retres ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int X = 0; +int Y = 2; +/*@ ensures X ≡ 1; */ +void f(void) +{ + X = 1; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)1); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Postcondition", + (char *)"(X == 1)",10); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + return; + } + +} + +/*@ ensures X ≡ 2; + ensures Y ≡ 2; */ +void g(void) +{ + X = 2; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + mpz_t e_acsl_4; + int e_acsl_5; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)2); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Postcondition", + (char *)"(X == 2)",14); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)Y); + e_acsl_5 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_5 == 0),(char *)"Postcondition", + (char *)"(Y == 2)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + return; + } + +} + +/*@ requires X ≡ 2; */ +void h(void) +{ + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)2); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Precondition", + (char *)"(X == 2)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + X ++; + } + + return; +} + +/*@ requires X ≡ 3; + requires Y ≡ 2; */ +void i(void) +{ + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)3); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Precondition", + (char *)"(X == 3)",23); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)2); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Precondition", + (char *)"(Y == 2)",24); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + X += Y; + } + + return; +} + +/*@ behavior b1: + requires X ≡ 5; + ensures X ≡ 3; + + behavior b2: + requires X ≡ 3+Y; + requires Y ≡ 2; + ensures X ≡ Y+1; + + +*/ +void j(void) +{ + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + mpz_t e_acsl_4; + mpz_t e_acsl_5; + mpz_t e_acsl_6; + int e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)5); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Precondition", + (char *)"(X == 5)",29); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)Y); + __gmpz_init((__mpz_struct *)(e_acsl_6)); + __gmpz_add((__mpz_struct *)(e_acsl_6),(__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_6)); + e_acsl_assert(! (e_acsl_7 == 0),(char *)"Precondition", + (char *)"(X == 3+Y)",32); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)2); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Precondition", + (char *)"(Y == 2)",33); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + X = 3; + } + + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + int e_acsl_16; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)3); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Postcondition", + (char *)"(X == 3)",30); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_15)); + __gmpz_add((__mpz_struct *)(e_acsl_15),(__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + e_acsl_16 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_15)); + e_acsl_assert(! (e_acsl_16 == 0),(char *)"Postcondition", + (char *)"(X == Y+1)",34); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + return; + } + +} + +/*@ behavior b1: + assumes X ≡ 1; + requires X ≡ 0; + + behavior b2: + assumes X ≡ 3; + assumes Y ≡ 2; + requires X ≡ 3; + requires X+Y ≡ 5; + + +*/ +void k(void) +{ + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + int e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + int e_acsl_13; + int e_acsl_17; + int e_acsl_18; + int e_acsl_22; + int e_acsl_28; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)1); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + if (! (e_acsl_3 == 0)) { e_acsl_7 = 1; } + else { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)0); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = e_acsl_6 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + e_acsl_assert(! e_acsl_7,(char *)"Precondition", + (char *)"(X == 1 ==> X == 0)",40); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)3); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_8)); + if (e_acsl_9 == 0) { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)2); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_13 = e_acsl_12 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + else { e_acsl_13 = 0; } + if (! e_acsl_13) { e_acsl_17 = 1; } + else { + mpz_t e_acsl_14; + mpz_t e_acsl_15; + int e_acsl_16; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)3); + e_acsl_16 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = e_acsl_16 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + } + e_acsl_assert(! e_acsl_17,(char *)"Precondition", + (char *)"(X == 3 && Y == 2 ==> X == 3)",44); + e_acsl_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_8)); + if (e_acsl_18 == 0) { + mpz_t e_acsl_19; + mpz_t e_acsl_20; + int e_acsl_21; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)2); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_20)); + e_acsl_22 = e_acsl_21 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + } + else { e_acsl_22 = 0; } + if (! e_acsl_22) { e_acsl_28 = 1; } + else { + mpz_t e_acsl_23; + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + int e_acsl_27; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_23),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)Y); + __gmpz_init((__mpz_struct *)(e_acsl_25)); + __gmpz_add((__mpz_struct *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_23), + (__mpz_struct const *)(e_acsl_24)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_26),(long)5); + e_acsl_27 = __gmpz_cmp((__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_26)); + e_acsl_28 = e_acsl_27 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + } + e_acsl_assert(! e_acsl_28,(char *)"Precondition", + (char *)"(X == 3 && Y == 2 ==> X+Y == 5)",45); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + X += Y; + } + + return; +} + +/*@ ensures X ≡ 5; */ +int l(void) +{ + /*@ assert Y ≡ 2; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)2); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(Y == 2)", + 51); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)5); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Postcondition", + (char *)"(X == 5)",49); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + return (X); + } + +} + +/*@ behavior b1: + assumes X ≡ 7; + ensures X ≡ 95; + + behavior b2: + assumes X ≡ 5; + assumes Y ≡ 2; + ensures X ≡ 7; + ensures X ≡ \old(X)+Y; + + +*/ +void m(void) +{ + int e_acsl_4; + int e_acsl_16; + int e_acsl_28; + int e_acsl_30; + e_acsl_30 = X; + { + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + int e_acsl_27; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)5); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_21), + (__mpz_struct const *)(e_acsl_22)); + if (e_acsl_23 == 0) { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + int e_acsl_26; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)2); + e_acsl_26 = __gmpz_cmp((__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + e_acsl_27 = e_acsl_26 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + } + else { e_acsl_27 = 0; } + e_acsl_28 = e_acsl_27; + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + int e_acsl_15; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)5); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + if (e_acsl_11 == 0) { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + int e_acsl_14; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)Y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)2); + e_acsl_14 = __gmpz_cmp((__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + e_acsl_15 = e_acsl_14 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + } + else { e_acsl_15 = 0; } + e_acsl_16 = e_acsl_15; + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)7); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_4 = e_acsl_3 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + X += Y; + { + int e_acsl_8; + int e_acsl_20; + int e_acsl_35; + if (! e_acsl_4) { e_acsl_8 = 1; } + else { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)95); + e_acsl_7 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = e_acsl_7 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + } + e_acsl_assert(! e_acsl_8,(char *)"Postcondition", + (char *)"(\\old(X == 7) ==> X == 95)",58); + if (! e_acsl_16) { e_acsl_20 = 1; } + else { + mpz_t e_acsl_17; + mpz_t e_acsl_18; + int e_acsl_19; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_17),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)7); + e_acsl_19 = __gmpz_cmp((__mpz_struct const *)(e_acsl_17), + (__mpz_struct const *)(e_acsl_18)); + e_acsl_20 = e_acsl_19 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + } + e_acsl_assert(! e_acsl_20,(char *)"Postcondition", + (char *)"(\\old(X == 5 && Y == 2) ==> X == 7)",62); + if (! e_acsl_28) { e_acsl_35 = 1; } + else { + mpz_t e_acsl_29; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + mpz_t e_acsl_33; + int e_acsl_34; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_29),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)e_acsl_30); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)Y); + __gmpz_init((__mpz_struct *)(e_acsl_33)); + __gmpz_add((__mpz_struct *)(e_acsl_33), + (__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_34 = __gmpz_cmp((__mpz_struct const *)(e_acsl_29), + (__mpz_struct const *)(e_acsl_33)); + e_acsl_35 = e_acsl_34 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_29)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_33)); + } + e_acsl_assert(! e_acsl_35,(char *)"Postcondition", + (char *)"(\\old(X == 5 && Y == 2) ==> X == \\old(X)+Y)",63); + return; + } + +} + +int main(void) +{ + int __retres; + f(); + g(); + h(); + i(); + j(); + k(); + l(); + m(); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.res.oracle index 02eb0be12f3..14d3e777e67 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/function_contract.res.oracle @@ -180,7 +180,7 @@ int Y = 2; void f(void) { X = 1; - e_acsl_assert(! (X == 1),(char *)"Postcondition",(char *)"(X == 1)",9); + e_acsl_assert(! (X == 1),(char *)"Postcondition",(char *)"(X == 1)",10); return; } @@ -189,15 +189,15 @@ void f(void) void g(void) { X = 2; - e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",13); - e_acsl_assert(! (Y == 2),(char *)"Postcondition",(char *)"(Y == 2)",14); + e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",14); + e_acsl_assert(! (Y == 2),(char *)"Postcondition",(char *)"(Y == 2)",15); return; } /*@ requires X ≡ 2; */ void h(void) { - e_acsl_assert(! (X == 2),(char *)"Precondition",(char *)"(X == 2)",18); + e_acsl_assert(! (X == 2),(char *)"Precondition",(char *)"(X == 2)",19); X ++; return; } @@ -206,8 +206,8 @@ void h(void) requires Y ≡ 2; */ void i(void) { - e_acsl_assert(! (X == 3),(char *)"Precondition",(char *)"(X == 3)",22); - e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",23); + e_acsl_assert(! (X == 3),(char *)"Precondition",(char *)"(X == 3)",23); + e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",24); X += Y; return; } @@ -225,14 +225,14 @@ void i(void) */ void j(void) { - e_acsl_assert(! (X == 5),(char *)"Precondition",(char *)"(X == 5)",28); + e_acsl_assert(! (X == 5),(char *)"Precondition",(char *)"(X == 5)",29); e_acsl_assert(! ((long long)X == (long long)3 + (long long)Y), - (char *)"Precondition",(char *)"(X == 3+Y)",31); - e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",32); + (char *)"Precondition",(char *)"(X == 3+Y)",32); + e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",33); X = 3; - e_acsl_assert(! (X == 3),(char *)"Postcondition",(char *)"(X == 3)",29); + e_acsl_assert(! (X == 3),(char *)"Postcondition",(char *)"(X == 3)",30); e_acsl_assert(! ((long long)X == (long long)Y + (long long)1), - (char *)"Postcondition",(char *)"(X == Y+1)",33); + (char *)"Postcondition",(char *)"(X == Y+1)",34); return; } @@ -259,19 +259,19 @@ void k(void) if (! (X == 1)) { e_acsl_1 = 1; } else { e_acsl_1 = X == 0; } e_acsl_assert(! e_acsl_1,(char *)"Precondition", - (char *)"(X == 1 ==> X == 0)",39); + (char *)"(X == 1 ==> X == 0)",40); if (X == 3) { e_acsl_2 = Y == 2; } else { e_acsl_2 = 0; } if (! e_acsl_2) { e_acsl_3 = 1; } else { e_acsl_3 = X == 3; } e_acsl_assert(! e_acsl_3,(char *)"Precondition", - (char *)"(X == 3 && Y == 2 ==> X == 3)",43); + (char *)"(X == 3 && Y == 2 ==> X == 3)",44); if (X == 3) { e_acsl_4 = Y == 2; } else { e_acsl_4 = 0; } if (! e_acsl_4) { e_acsl_5 = 1; } else { e_acsl_5 = (long long)X + (long long)Y == (long long)5; } e_acsl_assert(! e_acsl_5,(char *)"Precondition", - (char *)"(X == 3 && Y == 2 ==> X+Y == 5)",44); + (char *)"(X == 3 && Y == 2 ==> X+Y == 5)",45); X += Y; } @@ -282,8 +282,8 @@ void k(void) int l(void) { /*@ assert Y ≡ 2; */ ; - e_acsl_assert(! (Y == 2),(char *)"Assertion",(char *)"(Y == 2)",50); - e_acsl_assert(! (X == 5),(char *)"Postcondition",(char *)"(X == 5)",48); + e_acsl_assert(! (Y == 2),(char *)"Assertion",(char *)"(Y == 2)",51); + e_acsl_assert(! (X == 5),(char *)"Postcondition",(char *)"(X == 5)",49); return (X); } @@ -326,15 +326,15 @@ void m(void) if (! e_acsl_1) { e_acsl_2 = 1; } else { e_acsl_2 = X == 95; } e_acsl_assert(! e_acsl_2,(char *)"Postcondition", - (char *)"(\\old(X == 7) ==> X == 95)",57); + (char *)"(\\old(X == 7) ==> X == 95)",58); if (! e_acsl_4) { e_acsl_5 = 1; } else { e_acsl_5 = X == 7; } e_acsl_assert(! e_acsl_5,(char *)"Postcondition", - (char *)"(\\old(X == 5 && Y == 2) ==> X == 7)",61); + (char *)"(\\old(X == 5 && Y == 2) ==> X == 7)",62); if (! e_acsl_7) { e_acsl_9 = 1; } else { e_acsl_9 = (long long)X == (long long)e_acsl_8 + (long long)Y; } e_acsl_assert(! e_acsl_9,(char *)"Postcondition", - (char *)"(\\old(X == 5 && Y == 2) ==> X == \\old(X)+Y)",62); + (char *)"(\\old(X == 5 && Y == 2) ==> X == \\old(X)+Y)",63); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c index 257dbd5e9b8..58fd2a2530a 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf.c @@ -21,7 +21,7 @@ int main(void) int x; x = 0; /*@ assert &x ≡ &x; */ ; - e_acsl_assert(! (& x == & x),(char *)"Assertion",(char *)"(&x == &x)",8); + e_acsl_assert(! (& x == & x),(char *)"Assertion",(char *)"(&x == &x)",9); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf2.c new file mode 100644 index 00000000000..58fd2a2530a --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_addrOf2.c @@ -0,0 +1,29 @@ +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert &x ≡ &x; */ ; + e_acsl_assert(! (& x == & x),(char *)"Assertion",(char *)"(&x == &x)",9); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c index dfd8c185477..f4a2e7858a1 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith.c @@ -23,28 +23,28 @@ int main(void) x = -3; y = 2; /*@ assert -3 ≡ x; */ ; - e_acsl_assert(! (-3 == x),(char *)"Assertion",(char *)"(-3 == x)",11); + e_acsl_assert(! (-3 == x),(char *)"Assertion",(char *)"(-3 == x)",12); /*@ assert x ≡ -3; */ ; - e_acsl_assert(! (x == -3),(char *)"Assertion",(char *)"(x == -3)",12); + e_acsl_assert(! (x == -3),(char *)"Assertion",(char *)"(x == -3)",13); /*@ assert 0 ≢ ~0; */ ; - e_acsl_assert(! (0 != ~ 0),(char *)"Assertion",(char *)"(0 != ~0)",13); + e_acsl_assert(! (0 != ~ 0),(char *)"Assertion",(char *)"(0 != ~0)",14); /*@ assert x+1 ≡ -2; */ ; e_acsl_assert(! ((long long)x + (long long)1 == (long long)-2), - (char *)"Assertion",(char *)"(x+1 == -2)",15); + (char *)"Assertion",(char *)"(x+1 == -2)",16); /*@ assert x-1 ≡ -4; */ ; e_acsl_assert(! ((long long)x - (long long)1 == (long long)-4), - (char *)"Assertion",(char *)"(x-1 == -4)",16); + (char *)"Assertion",(char *)"(x-1 == -4)",17); /*@ assert x*3 ≡ -9; */ ; e_acsl_assert(! ((long long)x * (long long)3 == (long long)-9), - (char *)"Assertion",(char *)"(x*3 == -9)",17); + (char *)"Assertion",(char *)"(x*3 == -9)",18); /*@ assert x/3 ≡ -1; */ ; { int e_acsl_1; /*@ assert 3 ≢ 0; */ ; - e_acsl_assert(3 == 0,(char *)"Assertion",(char *)"(3 == 0)",18); + e_acsl_assert(3 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); e_acsl_1 = x / 3; e_acsl_assert(! (e_acsl_1 == -1),(char *)"Assertion", - (char *)"(x/3 == -1)",18); + (char *)"(x/3 == -1)",19); } /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; @@ -52,62 +52,62 @@ int main(void) int e_acsl_2; /*@ assert 0xfffffffffff ≢ 0; */ ; e_acsl_assert(0xfffffffffff == (long long)0,(char *)"Assertion", - (char *)"(0xfffffffffff == 0)",19); + (char *)"(0xfffffffffff == 0)",20); e_acsl_2 = (int)(0xfffffffffff / 0xfffffffffff); e_acsl_assert(! (e_acsl_2 == 1),(char *)"Assertion", - (char *)"(0xfffffffffff/0xfffffffffff == 1)",19); + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); } /*@ assert x%2 ≡ -1; */ ; { int e_acsl_3; /*@ assert 2 ≢ 0; */ ; - e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",20); + e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); e_acsl_3 = x % 2; e_acsl_assert(! (e_acsl_3 == -1),(char *)"Assertion", - (char *)"(x%2 == -1)",20); + (char *)"(x%2 == -1)",21); } /*@ assert -3%-2 ≡ -1; */ ; { int e_acsl_4; /*@ assert -2 ≢ 0; */ ; - e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",21); + e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); e_acsl_4 = -3 % -2; e_acsl_assert(! (e_acsl_4 == -1),(char *)"Assertion", - (char *)"(-3%-2 == -1)",21); + (char *)"(-3%-2 == -1)",22); } /*@ assert 3%-2 ≡ 1; */ ; { int e_acsl_5; /*@ assert -2 ≢ 0; */ ; - e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + e_acsl_assert(-2 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); e_acsl_5 = 3 % -2; e_acsl_assert(! (e_acsl_5 == 1),(char *)"Assertion", - (char *)"(3%-2 == 1)",22); + (char *)"(3%-2 == 1)",23); } /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; e_acsl_assert(! ((((long long)x * (long long)2 + ((long long)3 + (long long)y)) - (long long)4) + ( (long long)x - (long long)y) == (long long)-10), (char *)"Assertion",(char *)"(((x*2+(3+y))-4)+(x-y) == -10)", - 24); + 25); /*@ assert (0≡1) ≡ !(0≡0); */ ; e_acsl_assert(! ((0 == 1) == ! (0 == 0)),(char *)"Assertion", - (char *)"((0==1) == !(0==0))",26); + (char *)"((0==1) == !(0==0))",27); /*@ assert (0≤-1) ≡ (0>0); */ ; e_acsl_assert(! ((0 <= -1) == (0 > 0)),(char *)"Assertion", - (char *)"((0<=-1) == (0>0))",27); + (char *)"((0<=-1) == (0>0))",28); /*@ assert (0≥-1) ≡ (0≤0); */ ; e_acsl_assert(! ((0 >= -1) == (0 <= 0)),(char *)"Assertion", - (char *)"((0>=-1) == (0<=0))",28); + (char *)"((0>=-1) == (0<=0))",29); /*@ assert (0≢1) ≡ !(0≢0); */ ; e_acsl_assert(! ((0 != 1) == ! (0 != 0)),(char *)"Assertion", - (char *)"((0!=1) == !(0!=0))",29); + (char *)"((0!=1) == !(0!=0))",30); /*@ assert (0≢0) ≡ !(1≢0); */ ; e_acsl_assert(! ((0 != 0) == ! (1 != 0)),(char *)"Assertion", - (char *)"((0!=0) == !(1!=0))",31); + (char *)"((0!=0) == !(1!=0))",32); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_arith2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array.c index 42082331ac4..dec8a0871ee 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array.c @@ -38,10 +38,10 @@ int main(void) /*@ assert T1[0] ≡ T2[0]; */ ; e_acsl_assert(! (T1[0] == T2[0]),(char *)"Assertion", - (char *)"(T1[0] == T2[0])",13); + (char *)"(T1[0] == T2[0])",14); /*@ assert T1[1] ≢ T2[1]; */ ; e_acsl_assert(! (T1[1] != T2[1]),(char *)"Assertion", - (char *)"(T1[1] != T2[1])",14); + (char *)"(T1[1] != T2[1])",15); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array2.c new file mode 100644 index 00000000000..c2e33c90324 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_array2.c @@ -0,0 +1,92 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int T1[3]; +int T2[4]; +int main(void) +{ + int __retres; + { int i; + i = 0; + while (1) { + if (! (i < 3)) { break; } + T1[i] = i; + i ++; } } + + { + int i_0; + i_0 = 0; + while (1) { + if (! (i_0 < 4)) { break; } + T2[i_0] = 2 * i_0; + i_0 ++; } + } + + /*@ assert T1[0] ≡ T2[0]; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)T1[0]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)T2[0]); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"(T1[0] == T2[0])",14); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert T1[1] ≢ T2[1]; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)T1[1]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)T2[1]); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 != 0),(char *)"Assertion", + (char *)"(T1[1] != T2[1])",15); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at.c index a0c49223d4d..50f9758b294 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at.c @@ -33,21 +33,21 @@ void f(void) A = 2; /*@ assert \at(A,Pre) ≡ 0; */ ; e_acsl_assert(! (e_acsl_1 == 0),(char *)"Assertion", - (char *)"(\\at(A,Pre) == 0)",12); + (char *)"(\\at(A,Pre) == 0)",13); /*@ assert \at(A,F) ≡ 1; */ ; e_acsl_assert(! (e_acsl_2 == 1),(char *)"Assertion", - (char *)"(\\at(A,F) == 1)",13); + (char *)"(\\at(A,F) == 1)",14); /*@ assert \at(A,Here) ≡ 2; */ ; e_acsl_3 = A; e_acsl_assert(! (e_acsl_3 == 2),(char *)"Assertion", - (char *)"(\\at(A,Here) == 2)",14); + (char *)"(\\at(A,Here) == 2)",15); /*@ assert \at(\at(A,Pre),F) ≡ 0; */ ; e_acsl_assert(! (e_acsl_5 == 0),(char *)"Assertion", - (char *)"(\\at(\\at(A,Pre),F) == 0)",15); + (char *)"(\\at(\\at(A,Pre),F) == 0)",16); A = 3; e_acsl_6 = A; e_acsl_assert(! (e_acsl_6 == 3),(char *)"Postcondition", - (char *)"(\\at(A,Post) == 3)",8); + (char *)"(\\at(A,Post) == 3)",9); return; } @@ -69,12 +69,12 @@ void g(int *p, int *q) A = 4; /*@ assert \at(*(p+\at(*q,L1)),L2) ≡ 2; */ ; e_acsl_assert(! (e_acsl_2 == 2),(char *)"Assertion", - (char *)"(\\at(*(p+\\at(*q,L1)),L2) == 2)",31); + (char *)"(\\at(*(p+\\at(*q,L1)),L2) == 2)",32); L3: /*@ assert \at(*(p+\at(*q,L1)),Here) ≡ 2; */ ; e_acsl_4 = *(p + e_acsl_3); e_acsl_assert(! (e_acsl_4 == 2),(char *)"Assertion", - (char *)"(\\at(*(p+\\at(*q,L1)),Here) == 2)",33); + (char *)"(\\at(*(p+\\at(*q,L1)),Here) == 2)",34); return; } @@ -91,19 +91,19 @@ int main(void) e_acsl_2 = (long long)x + (long long)1; e_acsl_1 = x; /*@ assert x ≡ 0; */ ; - e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",44); + e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",45); x = 1; x = 2; f(); /*@ assert \at(x,L) ≡ 0; */ ; e_acsl_assert(! (e_acsl_1 == 0),(char *)"Assertion", - (char *)"(\\at(x,L) == 0)",49); + (char *)"(\\at(x,L) == 0)",50); /*@ assert \at(x+1,L) ≡ 1; */ ; e_acsl_assert(! (e_acsl_2 == (long long)1),(char *)"Assertion", - (char *)"(\\at(x+1,L) == 1)",50); + (char *)"(\\at(x+1,L) == 1)",51); /*@ assert \at(x,L)+1 ≡ 1; */ ; e_acsl_assert(! ((long long)e_acsl_3 + (long long)1 == (long long)1), - (char *)"Assertion",(char *)"(\\at(x,L)+1 == 1)",51); + (char *)"Assertion",(char *)"(\\at(x,L)+1 == 1)",52); g(t,& x); __retres = 0; return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_at2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c index e8566378d37..f574ab58f5b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast.c @@ -24,23 +24,23 @@ int main(void) y = 0; /*@ assert (int)x ≡ y; */ ; e_acsl_assert(! ((int)x == y),(char *)"Assertion",(char *)"((int)x == y)", - 10); + 11); /*@ assert x ≡ (long)y; */ ; e_acsl_assert(! (x == (long)y),(char *)"Assertion", - (char *)"(x == (long)y)",11); + (char *)"(x == (long)y)",12); /*@ assert y ≡ (int)0; */ ; - e_acsl_assert(! (y == 0),(char *)"Assertion",(char *)"(y == (int)0)",13); + e_acsl_assert(! (y == 0),(char *)"Assertion",(char *)"(y == (int)0)",14); /*@ assert (unsigned int)y ≡ (unsigned int)0; */ ; e_acsl_assert(! ((unsigned int)y == (unsigned int)0),(char *)"Assertion", - (char *)"((unsigned int)y == (unsigned int)0)",14); + (char *)"((unsigned int)y == (unsigned int)0)",15); /*@ assert y ≢ (int)0xfffffffffffffff; */ ; e_acsl_assert(! (y != (int)0xfffffffffffffff),(char *)"Assertion", - (char *)"(y != (int)0xfffffffffffffff)",17); + (char *)"(y != (int)0xfffffffffffffff)",18); /*@ assert (unsigned int)y ≢ (unsigned int)0xfffffffffffffff; */ ; e_acsl_assert(! ((unsigned int)y != (unsigned int)0xfffffffffffffff), (char *)"Assertion", (char *)"((unsigned int)y != (unsigned int)0xfffffffffffffff)", - 18); + 19); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast2.c new file mode 100644 index 00000000000..918bc9010a4 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_cast2.c @@ -0,0 +1,164 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_ui(__mpz_struct * /*[1]*/ z, unsigned long n); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z); + assigns \nothing; */ +extern unsigned long __gmpz_get_ui(__mpz_struct const * /*[1]*/ z); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + long x; + int y; + x = (long)0; + y = 0; + /*@ assert (int)x ≡ y; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)((int)x)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"((int)x == y)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert x ≡ (long)y; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)y); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(x == (long)y)",12); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + /*@ assert y ≡ (int)0; */ ; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Assertion", + (char *)"(y == (int)0)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + /*@ assert (unsigned int)y ≡ (unsigned int)0; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_10), + (unsigned long)((unsigned int)y)); + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_11), + (unsigned long)((unsigned int)0)); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Assertion", + (char *)"((unsigned int)y == (unsigned int)0)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + /*@ assert y ≢ (int)0xfffffffffffffff; */ ; + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + unsigned long e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)y); + __gmpz_init_set_str((__mpz_struct *)(e_acsl_14),"1152921504606846975",10); + e_acsl_15 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_14)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)((int)e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 != 0),(char *)"Assertion", + (char *)"(y != (int)0xfffffffffffffff)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert (unsigned int)y ≢ (unsigned int)0xfffffffffffffff; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + unsigned long e_acsl_20; + mpz_t e_acsl_21; + int e_acsl_22; + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_18), + (unsigned long)((unsigned int)y)); + __gmpz_init_set_str((__mpz_struct *)(e_acsl_19),"1152921504606846975",10); + e_acsl_20 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_21), + (unsigned long)((unsigned int)e_acsl_20)); + e_acsl_22 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_21)); + e_acsl_assert(! (e_acsl_22 != 0),(char *)"Assertion", + (char *)"((unsigned int)y != (unsigned int)0xfffffffffffffff)", + 19); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c index b5f3063d841..548565d106d 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison.c @@ -24,45 +24,45 @@ int main(void) x = 0; y = 1; /*@ assert x < y; */ ; - e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",8); + e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",9); /*@ assert y > x; */ ; - e_acsl_assert(! (y > x),(char *)"Assertion",(char *)"(y > x)",9); + e_acsl_assert(! (y > x),(char *)"Assertion",(char *)"(y > x)",10); /*@ assert x ≤ 0; */ ; - e_acsl_assert(! (x <= 0),(char *)"Assertion",(char *)"(x <= 0)",10); + e_acsl_assert(! (x <= 0),(char *)"Assertion",(char *)"(x <= 0)",11); /*@ assert y ≥ 1; */ ; - e_acsl_assert(! (y >= 1),(char *)"Assertion",(char *)"(y >= 1)",11); + e_acsl_assert(! (y >= 1),(char *)"Assertion",(char *)"(y >= 1)",12); s = (char *)"toto"; /*@ assert s ≡ s; */ ; - e_acsl_assert(! (s == s),(char *)"Assertion",(char *)"(s == s)",13); + e_acsl_assert(! (s == s),(char *)"Assertion",(char *)"(s == s)",14); /*@ assert "toto" ≢ "titi"; */ ; e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", - (char *)"(\"toto\" != \"titi\")",14); + (char *)"(\"toto\" != \"titi\")",15); /*@ assert 5 < 18; */ ; - e_acsl_assert(! (5 < 18),(char *)"Assertion",(char *)"(5 < 18)",15); + e_acsl_assert(! (5 < 18),(char *)"Assertion",(char *)"(5 < 18)",16); /*@ assert 32 > 3; */ ; - e_acsl_assert(! (32 > 3),(char *)"Assertion",(char *)"(32 > 3)",16); + e_acsl_assert(! (32 > 3),(char *)"Assertion",(char *)"(32 > 3)",17); /*@ assert 12 ≤ 13; */ ; - e_acsl_assert(! (12 <= 13),(char *)"Assertion",(char *)"(12 <= 13)",17); + e_acsl_assert(! (12 <= 13),(char *)"Assertion",(char *)"(12 <= 13)",18); /*@ assert 123 ≥ 12; */ ; - e_acsl_assert(! (123 >= 12),(char *)"Assertion",(char *)"(123 >= 12)",18); + e_acsl_assert(! (123 >= 12),(char *)"Assertion",(char *)"(123 >= 12)",19); /*@ assert 0xff ≡ 0xff; */ ; e_acsl_assert(! (0xff == 0xff),(char *)"Assertion", - (char *)"(0xff == 0xff)",19); + (char *)"(0xff == 0xff)",20); /*@ assert 1 ≢ 2; */ ; - e_acsl_assert(! (1 != 2),(char *)"Assertion",(char *)"(1 != 2)",20); + e_acsl_assert(! (1 != 2),(char *)"Assertion",(char *)"(1 != 2)",21); /*@ assert -5 < 18; */ ; - e_acsl_assert(! (-5 < 18),(char *)"Assertion",(char *)"(-5 < 18)",22); + e_acsl_assert(! (-5 < 18),(char *)"Assertion",(char *)"(-5 < 18)",23); /*@ assert 32 > -3; */ ; - e_acsl_assert(! (32 > -3),(char *)"Assertion",(char *)"(32 > -3)",23); + e_acsl_assert(! (32 > -3),(char *)"Assertion",(char *)"(32 > -3)",24); /*@ assert -12 ≤ 13; */ ; - e_acsl_assert(! (-12 <= 13),(char *)"Assertion",(char *)"(-12 <= 13)",24); + e_acsl_assert(! (-12 <= 13),(char *)"Assertion",(char *)"(-12 <= 13)",25); /*@ assert 123 ≥ -12; */ ; - e_acsl_assert(! (123 >= -12),(char *)"Assertion",(char *)"(123 >= -12)",25); + e_acsl_assert(! (123 >= -12),(char *)"Assertion",(char *)"(123 >= -12)",26); /*@ assert -0xff ≡ -0xff; */ ; e_acsl_assert(! (-0xff == -0xff),(char *)"Assertion", - (char *)"(-0xff == -0xff)",26); + (char *)"(-0xff == -0xff)",27); /*@ assert 1 ≢ -2; */ ; - e_acsl_assert(! (1 != -2),(char *)"Assertion",(char *)"(1 != -2)",27); + e_acsl_assert(! (1 != -2),(char *)"Assertion",(char *)"(1 != -2)",28); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison2.c new file mode 100644 index 00000000000..19988ea9b99 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_comparison2.c @@ -0,0 +1,319 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + char *s; + x = 0; + y = 1; + /*@ assert x < y; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 < 0),(char *)"Assertion",(char *)"(x < y)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert y > x; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 > 0),(char *)"Assertion",(char *)"(y > x)",10); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + /*@ assert x ≤ 0; */ ; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 <= 0),(char *)"Assertion",(char *)"(x <= 0)", + 11); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + /*@ assert y ≥ 1; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)1); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 >= 0),(char *)"Assertion",(char *)"(y >= 1)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + s = (char *)"toto"; + /*@ assert s ≡ s; */ ; + e_acsl_assert(! (s == s),(char *)"Assertion",(char *)"(s == s)",14); + /*@ assert "toto" ≢ "titi"; */ ; + e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", + (char *)"(\"toto\" != \"titi\")",15); + /*@ assert 5 < 18; */ ; + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + int e_acsl_15; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)5); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)18); + e_acsl_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + e_acsl_assert(! (e_acsl_15 < 0),(char *)"Assertion",(char *)"(5 < 18)", + 16); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + } + + /*@ assert 32 > 3; */ ; + { + mpz_t e_acsl_16; + mpz_t e_acsl_17; + int e_acsl_18; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)32); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_17),(long)3); + e_acsl_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_17)); + e_acsl_assert(! (e_acsl_18 > 0),(char *)"Assertion",(char *)"(32 > 3)", + 17); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + } + + /*@ assert 12 ≤ 13; */ ; + { + mpz_t e_acsl_19; + mpz_t e_acsl_20; + int e_acsl_21; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)12); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)13); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_20)); + e_acsl_assert(! (e_acsl_21 <= 0),(char *)"Assertion", + (char *)"(12 <= 13)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + } + + /*@ assert 123 ≥ 12; */ ; + { + mpz_t e_acsl_22; + mpz_t e_acsl_23; + int e_acsl_24; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)123); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_23),(long)12); + e_acsl_24 = __gmpz_cmp((__mpz_struct const *)(e_acsl_22), + (__mpz_struct const *)(e_acsl_23)); + e_acsl_assert(! (e_acsl_24 >= 0),(char *)"Assertion", + (char *)"(123 >= 12)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + } + + /*@ assert 0xff ≡ 0xff; */ ; + { + mpz_t e_acsl_25; + int e_acsl_26; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)0xff); + e_acsl_26 = __gmpz_cmp((__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_25)); + e_acsl_assert(! (e_acsl_26 == 0),(char *)"Assertion", + (char *)"(0xff == 0xff)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + } + + /*@ assert 1 ≢ 2; */ ; + { + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_28),(long)2); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_27), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 != 0),(char *)"Assertion",(char *)"(1 != 2)", + 21); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert -5 < 18; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)5); + __gmpz_init((__mpz_struct *)(e_acsl_31)); + __gmpz_neg((__mpz_struct *)(e_acsl_31),(__mpz_struct const *)(e_acsl_30)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)18); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_assert(! (e_acsl_33 < 0),(char *)"Assertion",(char *)"(-5 < 18)", + 23); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + /*@ assert 32 > -3; */ ; + { + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_34),(long)32); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 > 0),(char *)"Assertion",(char *)"(32 > -3)", + 24); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert -12 ≤ 13; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + mpz_t e_acsl_40; + int e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)12); + __gmpz_init((__mpz_struct *)(e_acsl_39)); + __gmpz_neg((__mpz_struct *)(e_acsl_39),(__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_40),(long)13); + e_acsl_41 = __gmpz_cmp((__mpz_struct const *)(e_acsl_39), + (__mpz_struct const *)(e_acsl_40)); + e_acsl_assert(! (e_acsl_41 <= 0),(char *)"Assertion", + (char *)"(-12 <= 13)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_40)); + } + + /*@ assert 123 ≥ -12; */ ; + { + mpz_t e_acsl_42; + mpz_t e_acsl_43; + mpz_t e_acsl_44; + int e_acsl_45; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)123); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_43),(long)12); + __gmpz_init((__mpz_struct *)(e_acsl_44)); + __gmpz_neg((__mpz_struct *)(e_acsl_44),(__mpz_struct const *)(e_acsl_43)); + e_acsl_45 = __gmpz_cmp((__mpz_struct const *)(e_acsl_42), + (__mpz_struct const *)(e_acsl_44)); + e_acsl_assert(! (e_acsl_45 >= 0),(char *)"Assertion", + (char *)"(123 >= -12)",26); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + } + + /*@ assert -0xff ≡ -0xff; */ ; + { + mpz_t e_acsl_46; + mpz_t e_acsl_47; + int e_acsl_48; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0xff); + __gmpz_init((__mpz_struct *)(e_acsl_47)); + __gmpz_neg((__mpz_struct *)(e_acsl_47),(__mpz_struct const *)(e_acsl_46)); + e_acsl_48 = __gmpz_cmp((__mpz_struct const *)(e_acsl_47), + (__mpz_struct const *)(e_acsl_47)); + e_acsl_assert(! (e_acsl_48 == 0),(char *)"Assertion", + (char *)"(-0xff == -0xff)",27); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_47)); + } + + /*@ assert 1 ≢ -2; */ ; + { + mpz_t e_acsl_49; + mpz_t e_acsl_50; + mpz_t e_acsl_51; + int e_acsl_52; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_50),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_51)); + __gmpz_neg((__mpz_struct *)(e_acsl_51),(__mpz_struct const *)(e_acsl_50)); + e_acsl_52 = __gmpz_cmp((__mpz_struct const *)(e_acsl_49), + (__mpz_struct const *)(e_acsl_51)); + e_acsl_assert(! (e_acsl_52 != 0),(char *)"Assertion",(char *)"(1 != -2)", + 28); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + __gmpz_clear((__mpz_struct *)(e_acsl_51)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c index 0768cf6db90..cca4f5b4275 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false.c @@ -22,7 +22,7 @@ int main(void) x = 0; if (x) { /*@ assert \false; */ ; - e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",7); + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",8); } __retres = 0; return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false2.c new file mode 100644 index 00000000000..cca4f5b4275 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_false2.c @@ -0,0 +1,31 @@ +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + if (x) { + /*@ assert \false; */ ; + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",8); + } + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract.c index bb8cb7e621d..d2c93b7ce13 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract.c @@ -21,7 +21,7 @@ int Y = 2; void f(void) { X = 1; - e_acsl_assert(! (X == 1),(char *)"Postcondition",(char *)"(X == 1)",9); + e_acsl_assert(! (X == 1),(char *)"Postcondition",(char *)"(X == 1)",10); return; } @@ -30,15 +30,15 @@ void f(void) void g(void) { X = 2; - e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",13); - e_acsl_assert(! (Y == 2),(char *)"Postcondition",(char *)"(Y == 2)",14); + e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",14); + e_acsl_assert(! (Y == 2),(char *)"Postcondition",(char *)"(Y == 2)",15); return; } /*@ requires X ≡ 2; */ void h(void) { - e_acsl_assert(! (X == 2),(char *)"Precondition",(char *)"(X == 2)",18); + e_acsl_assert(! (X == 2),(char *)"Precondition",(char *)"(X == 2)",19); X ++; return; } @@ -47,8 +47,8 @@ void h(void) requires Y ≡ 2; */ void i(void) { - e_acsl_assert(! (X == 3),(char *)"Precondition",(char *)"(X == 3)",22); - e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",23); + e_acsl_assert(! (X == 3),(char *)"Precondition",(char *)"(X == 3)",23); + e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",24); X += Y; return; } @@ -66,14 +66,14 @@ void i(void) */ void j(void) { - e_acsl_assert(! (X == 5),(char *)"Precondition",(char *)"(X == 5)",28); + e_acsl_assert(! (X == 5),(char *)"Precondition",(char *)"(X == 5)",29); e_acsl_assert(! ((long long)X == (long long)3 + (long long)Y), - (char *)"Precondition",(char *)"(X == 3+Y)",31); - e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",32); + (char *)"Precondition",(char *)"(X == 3+Y)",32); + e_acsl_assert(! (Y == 2),(char *)"Precondition",(char *)"(Y == 2)",33); X = 3; - e_acsl_assert(! (X == 3),(char *)"Postcondition",(char *)"(X == 3)",29); + e_acsl_assert(! (X == 3),(char *)"Postcondition",(char *)"(X == 3)",30); e_acsl_assert(! ((long long)X == (long long)Y + (long long)1), - (char *)"Postcondition",(char *)"(X == Y+1)",33); + (char *)"Postcondition",(char *)"(X == Y+1)",34); return; } @@ -100,19 +100,19 @@ void k(void) if (! (X == 1)) { e_acsl_1 = 1; } else { e_acsl_1 = X == 0; } e_acsl_assert(! e_acsl_1,(char *)"Precondition", - (char *)"(X == 1 ==> X == 0)",39); + (char *)"(X == 1 ==> X == 0)",40); if (X == 3) { e_acsl_2 = Y == 2; } else { e_acsl_2 = 0; } if (! e_acsl_2) { e_acsl_3 = 1; } else { e_acsl_3 = X == 3; } e_acsl_assert(! e_acsl_3,(char *)"Precondition", - (char *)"(X == 3 && Y == 2 ==> X == 3)",43); + (char *)"(X == 3 && Y == 2 ==> X == 3)",44); if (X == 3) { e_acsl_4 = Y == 2; } else { e_acsl_4 = 0; } if (! e_acsl_4) { e_acsl_5 = 1; } else { e_acsl_5 = (long long)X + (long long)Y == (long long)5; } e_acsl_assert(! e_acsl_5,(char *)"Precondition", - (char *)"(X == 3 && Y == 2 ==> X+Y == 5)",44); + (char *)"(X == 3 && Y == 2 ==> X+Y == 5)",45); X += Y; } @@ -123,8 +123,8 @@ void k(void) int l(void) { /*@ assert Y ≡ 2; */ ; - e_acsl_assert(! (Y == 2),(char *)"Assertion",(char *)"(Y == 2)",50); - e_acsl_assert(! (X == 5),(char *)"Postcondition",(char *)"(X == 5)",48); + e_acsl_assert(! (Y == 2),(char *)"Assertion",(char *)"(Y == 2)",51); + e_acsl_assert(! (X == 5),(char *)"Postcondition",(char *)"(X == 5)",49); return (X); } @@ -167,15 +167,15 @@ void m(void) if (! e_acsl_1) { e_acsl_2 = 1; } else { e_acsl_2 = X == 95; } e_acsl_assert(! e_acsl_2,(char *)"Postcondition", - (char *)"(\\old(X == 7) ==> X == 95)",57); + (char *)"(\\old(X == 7) ==> X == 95)",58); if (! e_acsl_4) { e_acsl_5 = 1; } else { e_acsl_5 = X == 7; } e_acsl_assert(! e_acsl_5,(char *)"Postcondition", - (char *)"(\\old(X == 5 && Y == 2) ==> X == 7)",61); + (char *)"(\\old(X == 5 && Y == 2) ==> X == 7)",62); if (! e_acsl_7) { e_acsl_9 = 1; } else { e_acsl_9 = (long long)X == (long long)e_acsl_8 + (long long)Y; } e_acsl_assert(! e_acsl_9,(char *)"Postcondition", - (char *)"(\\old(X == 5 && Y == 2) ==> X == \\old(X)+Y)",62); + (char *)"(\\old(X == 5 && Y == 2) ==> X == \\old(X)+Y)",63); return; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_function_contract2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c index 3768f566326..f4989f5d944 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant.c @@ -20,14 +20,14 @@ int main(void) int __retres; int x; /*@ assert 0 ≡ 0; */ ; - e_acsl_assert(! (0 == 0),(char *)"Assertion",(char *)"(0 == 0)",8); + e_acsl_assert(! (0 == 0),(char *)"Assertion",(char *)"(0 == 0)",9); x = 0; /*@ assert 0 ≢ 1; */ ; - e_acsl_assert(! (0 != 1),(char *)"Assertion",(char *)"(0 != 1)",9); + e_acsl_assert(! (0 != 1),(char *)"Assertion",(char *)"(0 != 1)",10); /*@ assert 1152921504606846975 ≡ 0xfffffffffffffff; */ ; e_acsl_assert(! ((unsigned long long)1152921504606846975 == (unsigned long long)0xfffffffffffffff), (char *)"Assertion", - (char *)"(1152921504606846975 == 0xfffffffffffffff)",10); + (char *)"(1152921504606846975 == 0xfffffffffffffff)",11); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant2.c new file mode 100644 index 00000000000..59f1fd62ccb --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_integer_constant2.c @@ -0,0 +1,88 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + /*@ assert 0 ≡ 0; */ ; + { + mpz_t e_acsl_1; + int e_acsl_2; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)0); + e_acsl_2 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_1)); + e_acsl_assert(! (e_acsl_2 == 0),(char *)"Assertion",(char *)"(0 == 0)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + } + + x = 0; + /*@ assert 0 ≢ 1; */ ; + { + mpz_t e_acsl_3; + mpz_t e_acsl_4; + int e_acsl_5; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)1); + e_acsl_5 = __gmpz_cmp((__mpz_struct const *)(e_acsl_3), + (__mpz_struct const *)(e_acsl_4)); + e_acsl_assert(! (e_acsl_5 != 0),(char *)"Assertion",(char *)"(0 != 1)", + 10); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + } + + /*@ assert 1152921504606846975 ≡ 0xfffffffffffffff; */ ; + { + mpz_t e_acsl_6; + int e_acsl_7; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_6),"1152921504606846975",10); + e_acsl_7 = __gmpz_cmp((__mpz_struct const *)(e_acsl_6), + (__mpz_struct const *)(e_acsl_6)); + e_acsl_assert(! (e_acsl_7 == 0),(char *)"Assertion", + (char *)"(1152921504606846975 == 0xfffffffffffffff)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant.c index 744b9718dfc..a7b715c6d45 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant.c @@ -30,12 +30,12 @@ int main(void) if (0 <= i) { e_acsl_1 = i < 10; } else { e_acsl_1 = 0; } e_acsl_assert(! e_acsl_1,(char *)"Invariant", - (char *)"(0 <= i && i < 10)",8); + (char *)"(0 <= i && i < 10)",9); } x += i; /*@ invariant i ≤ x; */ ; - e_acsl_assert(! (i <= x),(char *)"Invariant",(char *)"(i <= x)",10); + e_acsl_assert(! (i <= x),(char *)"Invariant",(char *)"(i <= x)",11); i ++; } } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant2.c new file mode 100644 index 00000000000..3f39dab6858 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_invariant2.c @@ -0,0 +1,100 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + { + int i; + i = 0; + while (1) { + if (! (i < 10)) { break; } + /*@ invariant 0 ≤ i ∧ i < 10; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)i); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + if (e_acsl_3 <= 0) { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)i); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)10); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = e_acsl_6 < 0; + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + else { e_acsl_7 = 0; } + e_acsl_assert(! e_acsl_7,(char *)"Invariant", + (char *)"(0 <= i && i < 10)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + x += i; + /*@ invariant i ≤ x; */ ; + { + mpz_t e_acsl_8; + mpz_t e_acsl_9; + int e_acsl_10; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)i); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)x); + e_acsl_10 = __gmpz_cmp((__mpz_struct const *)(e_acsl_8), + (__mpz_struct const *)(e_acsl_9)); + e_acsl_assert(! (e_acsl_10 <= 0),(char *)"Invariant", + (char *)"(i <= x)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + } + + i ++; + } + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt.c index 9b4ad945590..2060c89b30e 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt.c @@ -23,16 +23,16 @@ int main(void) goto L1; L1: /*@ assert X ≡ 0; */ ; - e_acsl_assert(! (X == 0),(char *)"Assertion",(char *)"(X == 0)",11); + e_acsl_assert(! (X == 0),(char *)"Assertion",(char *)"(X == 0)",12); X = 1; goto L2; L2: /*@ requires X ≡ 1; ensures X ≡ 2; */ { - e_acsl_assert(! (X == 1),(char *)"Precondition",(char *)"(X == 1)",13); + e_acsl_assert(! (X == 1),(char *)"Precondition",(char *)"(X == 1)",14); X = 2; - e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",13); + e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",14); } if (X) { @@ -41,7 +41,7 @@ int main(void) goto return_label; } __retres = 0; return_label: e_acsl_assert(! (X == 3),(char *)"Postcondition", - (char *)"(X == 3)",8); + (char *)"(X == 3)",9); return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt2.c new file mode 100644 index 00000000000..d1e77b52add --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_labeled_stmt2.c @@ -0,0 +1,116 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int X = 0; +/*@ ensures X ≡ 3; */ +int main(void) +{ + int __retres; + goto L1; + L1: + /*@ assert X ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(X == 0)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + X = 1; + goto L2; + L2: + /*@ requires X ≡ 1; + ensures X ≡ 2; */ + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)1); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Precondition", + (char *)"(X == 1)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + X = 2; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)2); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Postcondition", + (char *)"(X == 2)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + if (X) { + X = 3; + __retres = 0; + goto return_label; } + __retres = 0; + return_label: + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)3); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Postcondition", + (char *)"(X == 3)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + return (__retres); + } + +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy.c index 435d79df3ff..652481e8bc5 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy.c @@ -27,7 +27,7 @@ int main(void) if (x == 0) { e_acsl_1 = y == 1; } else { e_acsl_1 = 0; } e_acsl_assert(! e_acsl_1,(char *)"Assertion", - (char *)"(x == 0 && y == 1)",10); + (char *)"(x == 0 && y == 1)",11); } /*@ assert ¬(x ≢ 0 ∧ y ≡ 1/0); */ ; @@ -36,13 +36,13 @@ int main(void) if (x != 0) { int e_acsl_2; /*@ assert 0 ≢ 0; */ ; - e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",11); + e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",12); e_acsl_2 = 1 / 0; e_acsl_3 = y == e_acsl_2; } else { e_acsl_3 = 0; } e_acsl_assert(! (! e_acsl_3),(char *)"Assertion", - (char *)"(!(x != 0 && y == 1/0))",11); + (char *)"(!(x != 0 && y == 1/0))",12); } /*@ assert y ≡ 1 ∨ x ≡ 1; */ ; @@ -50,7 +50,7 @@ int main(void) if (y == 1) { e_acsl_4 = 1; } else { e_acsl_4 = x == 1; } e_acsl_assert(! e_acsl_4,(char *)"Assertion", - (char *)"(y == 1 || x == 1)",12); + (char *)"(y == 1 || x == 1)",13); } /*@ assert x ≡ 0 ∨ y ≡ 1/0; */ ; @@ -60,12 +60,12 @@ int main(void) else { int e_acsl_5; /*@ assert 0 ≢ 0; */ ; - e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",13); + e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",14); e_acsl_5 = 1 / 0; e_acsl_6 = y == e_acsl_5; } e_acsl_assert(! e_acsl_6,(char *)"Assertion", - (char *)"(x == 0 || y == 1/0)",13); + (char *)"(x == 0 || y == 1/0)",14); } /*@ assert x ≡ 0 ⇒ y ≡ 1; */ ; @@ -73,7 +73,7 @@ int main(void) if (! (x == 0)) { e_acsl_7 = 1; } else { e_acsl_7 = y == 1; } e_acsl_assert(! e_acsl_7,(char *)"Assertion", - (char *)"(x == 0 ==> y == 1)",14); + (char *)"(x == 0 ==> y == 1)",15); } /*@ assert x ≡ 1 ⇒ y ≡ 1/0; */ ; @@ -83,12 +83,12 @@ int main(void) else { int e_acsl_8; /*@ assert 0 ≢ 0; */ ; - e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",15); + e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",16); e_acsl_8 = 1 / 0; e_acsl_9 = y == e_acsl_8; } e_acsl_assert(! e_acsl_9,(char *)"Assertion", - (char *)"(x == 1 ==> y == 1/0)",15); + (char *)"(x == 1 ==> y == 1/0)",16); } /*@ assert x≢0? x ≢ 0: y ≢ 0; */ ; @@ -96,7 +96,7 @@ int main(void) if (x != 0) { e_acsl_10 = x != 0; } else { e_acsl_10 = y != 0; } e_acsl_assert(! e_acsl_10,(char *)"Assertion", - (char *)"(x!=0? x != 0: y != 0)",16); + (char *)"(x!=0? x != 0: y != 0)",17); } /*@ assert y≢0? y ≢ 0: x ≢ 0; */ ; @@ -104,7 +104,7 @@ int main(void) if (y != 0) { e_acsl_11 = y != 0; } else { e_acsl_11 = x != 0; } e_acsl_assert(! e_acsl_11,(char *)"Assertion", - (char *)"(y!=0? y != 0: x != 0)",17); + (char *)"(y!=0? y != 0: x != 0)",18); } /*@ assert x≡1? x ≡ 18: x ≡ 0; */ ; @@ -112,7 +112,7 @@ int main(void) if (x == 1) { e_acsl_12 = x == 18; } else { e_acsl_12 = x == 0; } e_acsl_assert(! e_acsl_12,(char *)"Assertion", - (char *)"(x==1? x == 18: x == 0)",18); + (char *)"(x==1? x == 18: x == 0)",19); } /*@ assert x ≡ 2 ⇔ y ≡ 3; */ ; @@ -128,7 +128,7 @@ int main(void) } else { e_acsl_15 = 0; } e_acsl_assert(! e_acsl_15,(char *)"Assertion", - (char *)"(x == 2 <==> y == 3)",21); + (char *)"(x == 2 <==> y == 3)",22); } /*@ assert x ≡ 0 ⇔ y ≡ 1; */ ; @@ -144,7 +144,7 @@ int main(void) } else { e_acsl_18 = 0; } e_acsl_assert(! e_acsl_18,(char *)"Assertion", - (char *)"(x == 0 <==> y == 1)",22); + (char *)"(x == 0 <==> y == 1)",23); } /*@ assert ((x≢0? x: y)≢0) ≡ (x≡0); */ ; @@ -152,7 +152,7 @@ int main(void) if (x != 0) { e_acsl_19 = x; } else { e_acsl_19 = y; } e_acsl_assert(! ((e_acsl_19 != 0) == (x == 0)),(char *)"Assertion", - (char *)"(((x!=0? x: y)!=0) == (x==0))",25); + (char *)"(((x!=0? x: y)!=0) == (x==0))",26); } /*@ assert (x ≢ 0 ∧ y ≢ 0) ∨ y ≢ 0; */ ; @@ -163,7 +163,7 @@ int main(void) if (e_acsl_20) { e_acsl_21 = 1; } else { e_acsl_21 = y != 0; } e_acsl_assert(! e_acsl_21,(char *)"Assertion", - (char *)"((x != 0 && y != 0) || y != 0)",26); + (char *)"((x != 0 && y != 0) || y != 0)",27); } /*@ assert (x ≢ 0 ∨ y ≢ 0) ∧ y ≡ 1; */ ; @@ -174,7 +174,7 @@ int main(void) if (e_acsl_22) { e_acsl_23 = y == 1; } else { e_acsl_23 = 0; } e_acsl_assert(! e_acsl_23,(char *)"Assertion", - (char *)"((x != 0 || y != 0) && y == 1)",27); + (char *)"((x != 0 || y != 0) && y == 1)",28); } __retres = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy2.c new file mode 100644 index 00000000000..f93d13dec23 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_lazy2.c @@ -0,0 +1,596 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + x = 0; + y = 1; + /*@ assert x ≡ 0 ∧ y ≡ 1; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + if (e_acsl_3 == 0) { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)1); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = e_acsl_6 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + else { e_acsl_7 = 0; } + e_acsl_assert(! e_acsl_7,(char *)"Assertion", + (char *)"(x == 0 && y == 1)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert ¬(x ≢ 0 ∧ y ≡ 1/0); */ ; + { + mpz_t e_acsl_8; + mpz_t e_acsl_9; + int e_acsl_10; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + e_acsl_10 = __gmpz_cmp((__mpz_struct const *)(e_acsl_8), + (__mpz_struct const *)(e_acsl_9)); + if (e_acsl_10 != 0) { + mpz_t e_acsl_11; + mpz_t e_acsl_12; + mpz_t e_acsl_13; + int e_acsl_14; + mpz_t e_acsl_15; + int e_acsl_16; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)0); + e_acsl_14 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init((__mpz_struct *)(e_acsl_15)); + /*@ assert 0 ≢ 0; */ ; + e_acsl_assert(e_acsl_14 == 0,(char *)"Assertion",(char *)"(0 == 0)",12); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_15), + (__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + e_acsl_16 = __gmpz_cmp((__mpz_struct const *)(e_acsl_11), + (__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = e_acsl_16 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + } + else { e_acsl_17 = 0; } + e_acsl_assert(! (! e_acsl_17),(char *)"Assertion", + (char *)"(!(x != 0 && y == 1/0))",12); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + } + + /*@ assert y ≡ 1 ∨ x ≡ 1; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + int e_acsl_20; + int e_acsl_24; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + e_acsl_20 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + if (e_acsl_20 == 0) { e_acsl_24 = 1; } + else { + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)1); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_21), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_24 = e_acsl_23 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + e_acsl_assert(! e_acsl_24,(char *)"Assertion", + (char *)"(y == 1 || x == 1)",13); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + } + + /*@ assert x ≡ 0 ∨ y ≡ 1/0; */ ; + { + mpz_t e_acsl_25; + mpz_t e_acsl_26; + int e_acsl_27; + int e_acsl_34; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_26),(long)0); + e_acsl_27 = __gmpz_cmp((__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_26)); + if (e_acsl_27 == 0) { e_acsl_34 = 1; } + else { + mpz_t e_acsl_28; + mpz_t e_acsl_29; + mpz_t e_acsl_30; + int e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_28),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_29),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)0); + e_acsl_31 = __gmpz_cmp((__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_30)); + __gmpz_init((__mpz_struct *)(e_acsl_32)); + /*@ assert 0 ≢ 0; */ ; + e_acsl_assert(e_acsl_31 == 0,(char *)"Assertion",(char *)"(0 == 0)",14); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_29), + (__mpz_struct const *)(e_acsl_30)); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_28), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_34 = e_acsl_33 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_29)); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + e_acsl_assert(! e_acsl_34,(char *)"Assertion", + (char *)"(x == 0 || y == 1/0)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + } + + /*@ assert x ≡ 0 ⇒ y ≡ 1; */ ; + { + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + int e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_36),(long)0); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_35), + (__mpz_struct const *)(e_acsl_36)); + if (! (e_acsl_37 == 0)) { e_acsl_41 = 1; } + else { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)1); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + e_acsl_41 = e_acsl_40 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + } + e_acsl_assert(! e_acsl_41,(char *)"Assertion", + (char *)"(x == 0 ==> y == 1)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert x ≡ 1 ⇒ y ≡ 1/0; */ ; + { + mpz_t e_acsl_42; + mpz_t e_acsl_43; + int e_acsl_44; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_43),(long)1); + e_acsl_44 = __gmpz_cmp((__mpz_struct const *)(e_acsl_42), + (__mpz_struct const *)(e_acsl_43)); + if (! (e_acsl_44 == 0)) { e_acsl_51 = 1; } + else { + mpz_t e_acsl_45; + mpz_t e_acsl_46; + mpz_t e_acsl_47; + int e_acsl_48; + mpz_t e_acsl_49; + int e_acsl_50; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_47),(long)0); + e_acsl_48 = __gmpz_cmp((__mpz_struct const *)(e_acsl_47), + (__mpz_struct const *)(e_acsl_47)); + __gmpz_init((__mpz_struct *)(e_acsl_49)); + /*@ assert 0 ≢ 0; */ ; + e_acsl_assert(e_acsl_48 == 0,(char *)"Assertion",(char *)"(0 == 0)",16); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_49), + (__mpz_struct const *)(e_acsl_46), + (__mpz_struct const *)(e_acsl_47)); + e_acsl_50 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = e_acsl_50 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_47)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + } + e_acsl_assert(! e_acsl_51,(char *)"Assertion", + (char *)"(x == 1 ==> y == 1/0)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + } + + /*@ assert x≢0? x ≢ 0: y ≢ 0; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + int e_acsl_54; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_53),(long)0); + e_acsl_54 = __gmpz_cmp((__mpz_struct const *)(e_acsl_52), + (__mpz_struct const *)(e_acsl_53)); + if (e_acsl_54 != 0) { + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_55),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + e_acsl_61 = e_acsl_57 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + } + else { + mpz_t e_acsl_58; + mpz_t e_acsl_59; + int e_acsl_60; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_58),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)0); + e_acsl_60 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = e_acsl_60 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + } + e_acsl_assert(! e_acsl_61,(char *)"Assertion", + (char *)"(x!=0? x != 0: y != 0)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + } + + /*@ assert y≢0? y ≢ 0: x ≢ 0; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + int e_acsl_64; + int e_acsl_71; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)0); + e_acsl_64 = __gmpz_cmp((__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_63)); + if (e_acsl_64 != 0) { + mpz_t e_acsl_65; + mpz_t e_acsl_66; + int e_acsl_67; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_66),(long)0); + e_acsl_67 = __gmpz_cmp((__mpz_struct const *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_66)); + e_acsl_71 = e_acsl_67 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_66)); + } + else { + mpz_t e_acsl_68; + mpz_t e_acsl_69; + int e_acsl_70; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_69),(long)0); + e_acsl_70 = __gmpz_cmp((__mpz_struct const *)(e_acsl_68), + (__mpz_struct const *)(e_acsl_69)); + e_acsl_71 = e_acsl_70 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + __gmpz_clear((__mpz_struct *)(e_acsl_69)); + } + e_acsl_assert(! e_acsl_71,(char *)"Assertion", + (char *)"(y!=0? y != 0: x != 0)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + } + + /*@ assert x≡1? x ≡ 18: x ≡ 0; */ ; + { + mpz_t e_acsl_72; + mpz_t e_acsl_73; + int e_acsl_74; + int e_acsl_81; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_72),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)1); + e_acsl_74 = __gmpz_cmp((__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_73)); + if (e_acsl_74 == 0) { + mpz_t e_acsl_75; + mpz_t e_acsl_76; + int e_acsl_77; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_75),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_76),(long)18); + e_acsl_77 = __gmpz_cmp((__mpz_struct const *)(e_acsl_75), + (__mpz_struct const *)(e_acsl_76)); + e_acsl_81 = e_acsl_77 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + } + else { + mpz_t e_acsl_78; + mpz_t e_acsl_79; + int e_acsl_80; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_78),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_79),(long)0); + e_acsl_80 = __gmpz_cmp((__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + e_acsl_81 = e_acsl_80 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + } + e_acsl_assert(! e_acsl_81,(char *)"Assertion", + (char *)"(x==1? x == 18: x == 0)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + } + + /*@ assert x ≡ 2 ⇔ y ≡ 3; */ ; + { + mpz_t e_acsl_82; + mpz_t e_acsl_83; + int e_acsl_84; + int e_acsl_88; + int e_acsl_96; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_82),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_83),(long)2); + e_acsl_84 = __gmpz_cmp((__mpz_struct const *)(e_acsl_82), + (__mpz_struct const *)(e_acsl_83)); + if (! (e_acsl_84 == 0)) { e_acsl_88 = 1; } + else { + mpz_t e_acsl_85; + mpz_t e_acsl_86; + int e_acsl_87; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_85),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_86),(long)3); + e_acsl_87 = __gmpz_cmp((__mpz_struct const *)(e_acsl_85), + (__mpz_struct const *)(e_acsl_86)); + e_acsl_88 = e_acsl_87 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_85)); + __gmpz_clear((__mpz_struct *)(e_acsl_86)); + } + if (e_acsl_88) { + mpz_t e_acsl_89; + mpz_t e_acsl_90; + int e_acsl_91; + int e_acsl_95; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_89),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_90),(long)3); + e_acsl_91 = __gmpz_cmp((__mpz_struct const *)(e_acsl_89), + (__mpz_struct const *)(e_acsl_90)); + if (! (e_acsl_91 == 0)) { e_acsl_95 = 1; } + else { + mpz_t e_acsl_92; + mpz_t e_acsl_93; + int e_acsl_94; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_92),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_93),(long)2); + e_acsl_94 = __gmpz_cmp((__mpz_struct const *)(e_acsl_92), + (__mpz_struct const *)(e_acsl_93)); + e_acsl_95 = e_acsl_94 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_92)); + __gmpz_clear((__mpz_struct *)(e_acsl_93)); + } + e_acsl_96 = e_acsl_95; + __gmpz_clear((__mpz_struct *)(e_acsl_89)); + __gmpz_clear((__mpz_struct *)(e_acsl_90)); + } + else { e_acsl_96 = 0; } + e_acsl_assert(! e_acsl_96,(char *)"Assertion", + (char *)"(x == 2 <==> y == 3)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + __gmpz_clear((__mpz_struct *)(e_acsl_83)); + } + + /*@ assert x ≡ 0 ⇔ y ≡ 1; */ ; + { + mpz_t e_acsl_97; + mpz_t e_acsl_98; + int e_acsl_99; + int e_acsl_103; + int e_acsl_111; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_97),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_98),(long)0); + e_acsl_99 = __gmpz_cmp((__mpz_struct const *)(e_acsl_97), + (__mpz_struct const *)(e_acsl_98)); + if (! (e_acsl_99 == 0)) { e_acsl_103 = 1; } + else { + mpz_t e_acsl_100; + mpz_t e_acsl_101; + int e_acsl_102; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_100),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_101),(long)1); + e_acsl_102 = __gmpz_cmp((__mpz_struct const *)(e_acsl_100), + (__mpz_struct const *)(e_acsl_101)); + e_acsl_103 = e_acsl_102 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_100)); + __gmpz_clear((__mpz_struct *)(e_acsl_101)); + } + if (e_acsl_103) { + mpz_t e_acsl_104; + mpz_t e_acsl_105; + int e_acsl_106; + int e_acsl_110; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_104),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_105),(long)1); + e_acsl_106 = __gmpz_cmp((__mpz_struct const *)(e_acsl_104), + (__mpz_struct const *)(e_acsl_105)); + if (! (e_acsl_106 == 0)) { e_acsl_110 = 1; } + else { + mpz_t e_acsl_107; + mpz_t e_acsl_108; + int e_acsl_109; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_107),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_108),(long)0); + e_acsl_109 = __gmpz_cmp((__mpz_struct const *)(e_acsl_107), + (__mpz_struct const *)(e_acsl_108)); + e_acsl_110 = e_acsl_109 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_107)); + __gmpz_clear((__mpz_struct *)(e_acsl_108)); + } + e_acsl_111 = e_acsl_110; + __gmpz_clear((__mpz_struct *)(e_acsl_104)); + __gmpz_clear((__mpz_struct *)(e_acsl_105)); + } + else { e_acsl_111 = 0; } + e_acsl_assert(! e_acsl_111,(char *)"Assertion", + (char *)"(x == 0 <==> y == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_97)); + __gmpz_clear((__mpz_struct *)(e_acsl_98)); + } + + /*@ assert ((x≢0? x: y)≢0) ≡ (x≡0); */ ; + /*@ assert (x ≢ 0 ∧ y ≢ 0) ∨ y ≢ 0; */ ; + { + mpz_t e_acsl_112; + mpz_t e_acsl_113; + int e_acsl_114; + int e_acsl_118; + int e_acsl_122; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_112),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_113),(long)0); + e_acsl_114 = __gmpz_cmp((__mpz_struct const *)(e_acsl_112), + (__mpz_struct const *)(e_acsl_113)); + if (e_acsl_114 != 0) { + mpz_t e_acsl_115; + mpz_t e_acsl_116; + int e_acsl_117; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_115),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_116),(long)0); + e_acsl_117 = __gmpz_cmp((__mpz_struct const *)(e_acsl_115), + (__mpz_struct const *)(e_acsl_116)); + e_acsl_118 = e_acsl_117 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_115)); + __gmpz_clear((__mpz_struct *)(e_acsl_116)); + } + else { e_acsl_118 = 0; } + if (e_acsl_118) { e_acsl_122 = 1; } + else { + mpz_t e_acsl_119; + mpz_t e_acsl_120; + int e_acsl_121; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_119),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_120),(long)0); + e_acsl_121 = __gmpz_cmp((__mpz_struct const *)(e_acsl_119), + (__mpz_struct const *)(e_acsl_120)); + e_acsl_122 = e_acsl_121 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_119)); + __gmpz_clear((__mpz_struct *)(e_acsl_120)); + } + e_acsl_assert(! e_acsl_122,(char *)"Assertion", + (char *)"((x != 0 && y != 0) || y != 0)",27); + __gmpz_clear((__mpz_struct *)(e_acsl_112)); + __gmpz_clear((__mpz_struct *)(e_acsl_113)); + } + + /*@ assert (x ≢ 0 ∨ y ≢ 0) ∧ y ≡ 1; */ ; + { + mpz_t e_acsl_123; + mpz_t e_acsl_124; + int e_acsl_125; + int e_acsl_129; + int e_acsl_133; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_123),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_124),(long)0); + e_acsl_125 = __gmpz_cmp((__mpz_struct const *)(e_acsl_123), + (__mpz_struct const *)(e_acsl_124)); + if (e_acsl_125 != 0) { e_acsl_129 = 1; } + else { + mpz_t e_acsl_126; + mpz_t e_acsl_127; + int e_acsl_128; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_126),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_127),(long)0); + e_acsl_128 = __gmpz_cmp((__mpz_struct const *)(e_acsl_126), + (__mpz_struct const *)(e_acsl_127)); + e_acsl_129 = e_acsl_128 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_126)); + __gmpz_clear((__mpz_struct *)(e_acsl_127)); + } + if (e_acsl_129) { + mpz_t e_acsl_130; + mpz_t e_acsl_131; + int e_acsl_132; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_130),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_131),(long)1); + e_acsl_132 = __gmpz_cmp((__mpz_struct const *)(e_acsl_130), + (__mpz_struct const *)(e_acsl_131)); + e_acsl_133 = e_acsl_132 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_130)); + __gmpz_clear((__mpz_struct *)(e_acsl_131)); + } + else { e_acsl_133 = 0; } + e_acsl_assert(! e_acsl_133,(char *)"Assertion", + (char *)"((x != 0 || y != 0) && y == 1)",28); + __gmpz_clear((__mpz_struct *)(e_acsl_123)); + __gmpz_clear((__mpz_struct *)(e_acsl_124)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search.c index 05f90d8b635..7d5b4f12418 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search.c @@ -49,7 +49,7 @@ int search(int elt) e_acsl_end_loop1: ; e_acsl_assert(! e_acsl_1,(char *)"Precondition", (char *)"(\\forall int i; 0 <= i && i < 9 ==> A[i] <= A[i+1])", - 8); + 9); { int e_acsl_7; int e_acsl_8; @@ -105,12 +105,12 @@ int search(int elt) else { e_acsl_6 = __retres == 1; } e_acsl_assert(! e_acsl_6,(char *)"Postcondition", (char *)"(\\old(\\exists int j; (0 <= j && j < 10) && A[j] == elt) ==> \\result == 1)", - 11); + 12); if (! e_acsl_9) { e_acsl_10 = 1; } else { e_acsl_10 = __retres == 0; } e_acsl_assert(! e_acsl_10,(char *)"Postcondition", (char *)"(\\old(\\forall int j; 0 <= j && j < 10 ==> A[j] != elt) ==> \\result == 0)", - 14); + 15); return (__retres); } @@ -129,10 +129,10 @@ int main(void) found = search(36); /*@ assert found ≡ 1; */ ; - e_acsl_assert(! (found == 1),(char *)"Assertion",(char *)"(found == 1)",30); + e_acsl_assert(! (found == 1),(char *)"Assertion",(char *)"(found == 1)",31); found = search(5); /*@ assert found ≡ 0; */ ; - e_acsl_assert(! (found == 0),(char *)"Assertion",(char *)"(found == 0)",33); + e_acsl_assert(! (found == 0),(char *)"Assertion",(char *)"(found == 0)",34); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_linear_search2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot.c index 73582784dad..3999f5c0923 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot.c @@ -23,24 +23,24 @@ int main(void) x = 0; y = 1; /*@ assert x < y; */ ; - e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",8); + e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",9); /*@ requires x ≡ 0; ensures x ≥ 1; */ { - e_acsl_assert(! (x == 0),(char *)"Precondition",(char *)"(x == 0)",9); + e_acsl_assert(! (x == 0),(char *)"Precondition",(char *)"(x == 0)",10); if (x) { /*@ assert \false; */ ; - e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",12); + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",13); } else { /*@ requires x ≡ 0; ensures x ≡ 1; */ { e_acsl_assert(! (x == 0),(char *)"Precondition",(char *)"(x == 0)", - 14); + 15); x ++; e_acsl_assert(! (x == 1),(char *)"Postcondition",(char *)"(x == 1)", - 15); + 16); } if (x) { @@ -48,19 +48,19 @@ int main(void) ensures x ≡ 2; */ { e_acsl_assert(! (x == 1),(char *)"Precondition",(char *)"(x == 1)", - 18); + 19); x ++; e_acsl_assert(! (x == 2),(char *)"Postcondition", - (char *)"(x == 2)",19); + (char *)"(x == 2)",20); } } else { /*@ assert \false; */ ; - e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",22); + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",23); } } - e_acsl_assert(! (x >= 1),(char *)"Postcondition",(char *)"(x >= 1)",10); + e_acsl_assert(! (x >= 1),(char *)"Postcondition",(char *)"(x >= 1)",11); } __retres = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot2.c new file mode 100644 index 00000000000..31a322172a2 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_nested_code_annot2.c @@ -0,0 +1,166 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + x = 0; + y = 1; + /*@ assert x < y; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 < 0),(char *)"Assertion",(char *)"(x < y)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ requires x ≡ 0; + ensures x ≥ 1; */ + { + mpz_t e_acsl_19; + mpz_t e_acsl_20; + int e_acsl_21; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)0); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Precondition", + (char *)"(x == 0)",10); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + if (x) { + /*@ assert \false; */ ; + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",13); + } + else { + /*@ requires x ≡ 0; + ensures x ≡ 1; */ + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Precondition", + (char *)"(x == 0)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + x ++; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)1); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Postcondition", + (char *)"(x == 1)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + if (x) { + /*@ requires x ≡ 1; + ensures x ≡ 2; */ + { + mpz_t e_acsl_16; + mpz_t e_acsl_17; + int e_acsl_18; + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + int e_acsl_15; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)1); + e_acsl_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + e_acsl_assert(! (e_acsl_15 == 0),(char *)"Precondition", + (char *)"(x == 1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + x ++; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_17),(long)2); + e_acsl_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_17)); + e_acsl_assert(! (e_acsl_18 == 0),(char *)"Postcondition", + (char *)"(x == 2)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + } + + } + else { + /*@ assert \false; */ ; + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",23); + } + } + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)1); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_20)); + e_acsl_assert(! (e_acsl_21 >= 0),(char *)"Postcondition", + (char *)"(x >= 1)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c index 983aa7bc1ab..a0259ccfb24 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not.c @@ -21,10 +21,10 @@ int main(void) int x; x = 0; /*@ assert x ≡ 0; */ ; - e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",7); + e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",8); if (x) { /*@ assert x ≢ 0; */ ; - e_acsl_assert(! (x != 0),(char *)"Assertion",(char *)"(x != 0)",8); + e_acsl_assert(! (x != 0),(char *)"Assertion",(char *)"(x != 0)",9); } __retres = 0; return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not2.c new file mode 100644 index 00000000000..6e435729f2d --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_not2.c @@ -0,0 +1,77 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert x ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(x == 0)",8); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + if (x) { + /*@ assert x ≢ 0; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)0); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 != 0),(char *)"Assertion",(char *)"(x != 0)", + 9); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + } + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null.c index 7e91e650a5f..18d9040f32c 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null.c @@ -20,7 +20,7 @@ int main(void) int __retres; /*@ assert \null ≡ (void *)0; */ ; e_acsl_assert(! ((void *)0 == (void *)0),(char *)"Assertion", - (char *)"(\\null == (void *)0)",7); + (char *)"(\\null == (void *)0)",8); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null2.c new file mode 100644 index 00000000000..18d9040f32c --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_null2.c @@ -0,0 +1,28 @@ +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + /*@ assert \null ≡ (void *)0; */ ; + e_acsl_assert(! ((void *)0 == (void *)0),(char *)"Assertion", + (char *)"(\\null == (void *)0)",8); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants.c index 86272a7ac9e..a1c123d5f21 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants.c @@ -24,13 +24,13 @@ int main(void) int __retres; /*@ assert "toto" ≢ "titi"; */ ; e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", - (char *)"(\"toto\" != \"titi\")",9); + (char *)"(\"toto\" != \"titi\")",10); /*@ assert 'c' ≡ 'c'; */ ; e_acsl_assert(! ('c' == 'c'),(char *)"Assertion", - (char *)"(\'c\' == \'c\')",10); + (char *)"(\'c\' == \'c\')",11); /*@ assert false ≢ true; */ ; e_acsl_assert(! (false != true),(char *)"Assertion", - (char *)"(false != true)",11); + (char *)"(false != true)",12); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants2.c new file mode 100644 index 00000000000..aa133d44db2 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_other_constants2.c @@ -0,0 +1,78 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +enum bool { + false = 0, + true = 1 +}; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + /*@ assert "toto" ≢ "titi"; */ ; + e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", + (char *)"(\"toto\" != \"titi\")",10); + /*@ assert 'c' ≡ 'c'; */ ; + { + mpz_t e_acsl_1; + int e_acsl_2; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)'c'); + e_acsl_2 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_1)); + e_acsl_assert(! (e_acsl_2 == 0),(char *)"Assertion", + (char *)"(\'c\' == \'c\')",11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + } + + /*@ assert false ≢ true; */ ; + { + mpz_t e_acsl_3; + mpz_t e_acsl_4; + int e_acsl_5; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)false); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)true); + e_acsl_5 = __gmpz_cmp((__mpz_struct const *)(e_acsl_3), + (__mpz_struct const *)(e_acsl_4)); + e_acsl_assert(! (e_acsl_5 != 0),(char *)"Assertion", + (char *)"(false != true)",12); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr.c index 63a0dee5a04..179b693d8c2 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr.c @@ -27,20 +27,20 @@ int main(void) t[2] = 4; p = & x; /*@ assert *p ≡ 1; */ ; - e_acsl_assert(! (*p == 1),(char *)"Assertion",(char *)"(*p == 1)",12); + e_acsl_assert(! (*p == 1),(char *)"Assertion",(char *)"(*p == 1)",13); /*@ assert t[0] ≡ 2; */ ; - e_acsl_assert(! (t[0] == 2),(char *)"Assertion",(char *)"(t[0] == 2)",13); + e_acsl_assert(! (t[0] == 2),(char *)"Assertion",(char *)"(t[0] == 2)",14); /*@ assert t[2] ≡ 4; */ ; - e_acsl_assert(! (t[2] == 4),(char *)"Assertion",(char *)"(t[2] == 4)",14); + e_acsl_assert(! (t[2] == 4),(char *)"Assertion",(char *)"(t[2] == 4)",15); /*@ assert t[(2*sizeof(int))/sizeof((int)0x0)] ≡ 4; */ ; { int e_acsl_1; /*@ assert sizeof((int)0x0) ≢ 0; */ ; e_acsl_assert(4 == 0,(char *)"Assertion", - (char *)"(sizeof((int)0x0) == 0)",15); + (char *)"(sizeof((int)0x0) == 0)",16); e_acsl_1 = (2 * 4) / 4; e_acsl_assert(! (t[e_acsl_1] == 4),(char *)"Assertion", - (char *)"(t[(2*sizeof(int))/sizeof((int)0x0)] == 4)",15); + (char *)"(t[(2*sizeof(int))/sizeof((int)0x0)] == 4)",16); } { @@ -50,13 +50,13 @@ int main(void) if (! (i < 2)) { break; } /*@ assert t[i] ≡ i+2; */ ; e_acsl_assert(! ((long long)t[i] == (long long)i + (long long)2), - (char *)"Assertion",(char *)"(t[i] == i+2)",18); + (char *)"Assertion",(char *)"(t[i] == i+2)",19); /*@ assert t[2-i] ≡ 4-i; */ ; e_acsl_assert(! ((long long)t[(long long)2 - (long long)i] == (long long)4 - (long long)i), - (char *)"Assertion",(char *)"(t[2-i] == 4-i)",19); + (char *)"Assertion",(char *)"(t[2-i] == 4-i)",20); /*@ assert *(&t[2]-i) ≡ 4-i; */ ; e_acsl_assert(! ((long long)*(& t[2] - i) == (long long)4 - (long long)i), - (char *)"Assertion",(char *)"(*(&t[2]-i) == 4-i)",20); + (char *)"Assertion",(char *)"(*(&t[2]-i) == 4-i)",21); i ++; } } @@ -64,7 +64,7 @@ int main(void) p = & t[2]; t[2] = 5; /*@ assert *p ≡ 5; */ ; - e_acsl_assert(! (*p == 5),(char *)"Assertion",(char *)"(*p == 5)",26); + e_acsl_assert(! (*p == 5),(char *)"Assertion",(char *)"(*p == 5)",27); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr2.c new file mode 100644 index 00000000000..47597e8a9a8 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_ptr2.c @@ -0,0 +1,291 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z); + assigns \nothing; */ +extern unsigned long __gmpz_get_ui(__mpz_struct const * /*[1]*/ z); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int t[3]; + int *p; + x = 1; + t[0] = 2; + t[1] = 3; + t[2] = 4; + p = & x; + /*@ assert *p ≡ 1; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)*p); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)1); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(*p == 1)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert t[0] ≡ 2; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)t[0]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)2); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(t[0] == 2)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + /*@ assert t[2] ≡ 4; */ ; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)t[2]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)4); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Assertion", + (char *)"(t[2] == 4)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + /*@ assert t[(2*sizeof(int))/sizeof((int)0x0)] ≡ 4; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + int e_acsl_15; + mpz_t e_acsl_16; + unsigned long e_acsl_17; + mpz_t e_acsl_18; + mpz_t e_acsl_19; + int e_acsl_20; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_12)); + __gmpz_mul((__mpz_struct *)(e_acsl_12),(__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)0); + e_acsl_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + /*@ assert sizeof((int)0x0) ≢ 0; */ ; + e_acsl_assert(e_acsl_15 == 0,(char *)"Assertion", + (char *)"(sizeof((int)0x0) == 0)",16); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + e_acsl_17 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_16)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)t[e_acsl_17]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)4); + e_acsl_20 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + e_acsl_assert(! (e_acsl_20 == 0),(char *)"Assertion", + (char *)"(t[(2*sizeof(int))/sizeof((int)0x0)] == 4)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + } + + { + int i; + i = 0; + while (1) { + if (! (i < 2)) { break; } + /*@ assert t[i] ≡ i+2; */ ; + { + mpz_t e_acsl_21; + mpz_t e_acsl_22; + mpz_t e_acsl_23; + mpz_t e_acsl_24; + int e_acsl_25; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)t[i]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)i); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_23),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_24)); + __gmpz_add((__mpz_struct *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_22), + (__mpz_struct const *)(e_acsl_23)); + e_acsl_25 = __gmpz_cmp((__mpz_struct const *)(e_acsl_21), + (__mpz_struct const *)(e_acsl_24)); + e_acsl_assert(! (e_acsl_25 == 0),(char *)"Assertion", + (char *)"(t[i] == i+2)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + } + + /*@ assert t[2-i] ≡ 4-i; */ ; + { + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + unsigned long e_acsl_29; + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_26),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)i); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_sub((__mpz_struct *)(e_acsl_28), + (__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_28)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)t[e_acsl_29]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_32)); + __gmpz_sub((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_27)); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_assert(! (e_acsl_33 == 0),(char *)"Assertion", + (char *)"(t[2-i] == 4-i)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + /*@ assert *(&t[2]-i) ≡ 4-i; */ ; + { + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + mpz_t e_acsl_37; + int e_acsl_38; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_34), + (long)*(& t[2] - (long)i)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_36),(long)i); + __gmpz_init((__mpz_struct *)(e_acsl_37)); + __gmpz_sub((__mpz_struct *)(e_acsl_37), + (__mpz_struct const *)(e_acsl_35), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_38 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_37)); + e_acsl_assert(! (e_acsl_38 == 0),(char *)"Assertion", + (char *)"(*(&t[2]-i) == 4-i)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + __gmpz_clear((__mpz_struct *)(e_acsl_37)); + } + + i ++; + } + } + + p = & t[2]; + t[2] = 5; + /*@ assert *p ≡ 5; */ ; + { + mpz_t e_acsl_39; + mpz_t e_acsl_40; + int e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)*p); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_40),(long)5); + e_acsl_41 = __gmpz_cmp((__mpz_struct const *)(e_acsl_39), + (__mpz_struct const *)(e_acsl_40)); + e_acsl_assert(! (e_acsl_41 == 0),(char *)"Assertion",(char *)"(*p == 5)", + 27); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_40)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif.c index 51d4c954588..b90948b07c8 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif.c @@ -39,7 +39,7 @@ int main(void) e_acsl_end_loop1: ; e_acsl_assert(! e_acsl_1,(char *)"Assertion", (char *)"(\\forall int x; 0 <= x && x <= 1 ==> x == 0 || x == 1)", - 10); + 11); } /*@ assert ∀ int x; 0 < x ∧ x ≤ 1 ⇒ x ≡ 1; */ ; @@ -57,7 +57,7 @@ int main(void) } e_acsl_end_loop2: ; e_acsl_assert(! e_acsl_4,(char *)"Assertion", - (char *)"(\\forall int x; 0 < x && x <= 1 ==> x == 1)",11); + (char *)"(\\forall int x; 0 < x && x <= 1 ==> x == 1)",12); } /*@ assert ∀ int x; 0 < x ∧ x < 1 ⇒ \false; */ ; @@ -74,7 +74,7 @@ int main(void) } e_acsl_end_loop3: ; e_acsl_assert(! e_acsl_6,(char *)"Assertion", - (char *)"(\\forall int x; 0 < x && x < 1 ==> \\false)",12); + (char *)"(\\forall int x; 0 < x && x < 1 ==> \\false)",13); } /*@ assert ∀ int x; 0 ≤ x ∧ x < 1 ⇒ x ≡ 0; */ ; @@ -92,7 +92,7 @@ int main(void) } e_acsl_end_loop4: ; e_acsl_assert(! e_acsl_8,(char *)"Assertion", - (char *)"(\\forall int x; 0 <= x && x < 1 ==> x == 0)",13); + (char *)"(\\forall int x; 0 <= x && x < 1 ==> x == 0)",14); } /*@ @@ -127,7 +127,7 @@ int main(void) e_acsl_end_loop5: ; e_acsl_assert(! e_acsl_10,(char *)"Assertion", (char *)"(\\forall int x, int y, int z;\n ((0 <= x && x < 2) && (0 <= y && y < 5)) && (0 <= z && z <= y) ==>\n x+z <= y+1)", - 17); + 18); } /*@ assert ∃ int x; (0 ≤ x ∧ x < 10) ∧ x ≡ 5; */ ; @@ -146,7 +146,7 @@ int main(void) e_acsl_end_loop6: ; e_acsl_assert(! e_acsl_14,(char *)"Assertion", (char *)"(\\exists int x; (0 <= x && x < 10) && x == 5)", - 22); + 23); } /*@ @@ -163,7 +163,7 @@ int main(void) int e_acsl_18; int e_acsl_22; /*@ assert 2 ≢ 0; */ ; - e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",27); + e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",28); e_acsl_18 = e_acsl_17 % 2; if (! (e_acsl_18 == 0)) { e_acsl_22 = 1; } else { @@ -175,7 +175,7 @@ int main(void) { int e_acsl_21; /*@ assert 2 ≢ 0; */ ; - e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",27); + e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",28); e_acsl_21 = e_acsl_17 / 2; if (! (e_acsl_20 <= e_acsl_21)) { break; } } @@ -199,7 +199,7 @@ int main(void) e_acsl_end_loop8: ; e_acsl_assert(! e_acsl_16,(char *)"Assertion", (char *)"(\\forall int x; 0 <= x && x < 10 ==>\n (x%2 == 0 ==> (\\exists int y; (0 <= y && y <= x/2) && x == 2*y)))", - 26); + 27); } __retres = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_quantif2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result.c index 02edb2ae149..301aad4d852 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result.c @@ -25,7 +25,7 @@ int f(int x) x = 0; e_acsl_assert(! (x == (int)((long long)e_acsl_1 - (long long)e_acsl_2)), (char *)"Postcondition", - (char *)"(\\result == (int)(\\old(x)-\\old(x)))",6); + (char *)"(\\result == (int)(\\old(x)-\\old(x)))",7); return (x); } @@ -34,7 +34,7 @@ int Y = 1; int g(int x) { e_acsl_assert(! (x == Y),(char *)"Postcondition",(char *)"(\\result == Y)", - 17); + 18); return (x); } @@ -44,7 +44,7 @@ int h(void) int __retres; __retres = 0; e_acsl_assert(! (__retres == 0),(char *)"Postcondition", - (char *)"(\\result == 0)",22); + (char *)"(\\result == 0)",23); return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_result2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c index 7faad4e6e38..435d1403d56 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof.c @@ -22,10 +22,10 @@ int main(void) x = 0; /*@ assert sizeof(int) ≡ sizeof(x); */ ; e_acsl_assert(! (4 == 4),(char *)"Assertion", - (char *)"(sizeof(int) == sizeof(x))",8); + (char *)"(sizeof(int) == sizeof(x))",9); /*@ assert sizeof("totototototo") ≡ sizeof(char *); */ ; e_acsl_assert(! (4 == 4),(char *)"Assertion", - (char *)"(sizeof(\"totototototo\") == sizeof(char *))",9); + (char *)"(sizeof(\"totototototo\") == sizeof(char *))",10); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof2.c new file mode 100644 index 00000000000..d5faee6ee7b --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_sizeof2.c @@ -0,0 +1,76 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert sizeof(int) ≡ sizeof(x); */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)4); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"(sizeof(int) == sizeof(x))",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert sizeof("totototototo") ≡ sizeof(char *); */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)4); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(sizeof(\"totototototo\") == sizeof(char *))",10); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract.c index ed75ce9ea00..1673755a6de 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract.c @@ -25,24 +25,24 @@ int main(void) /*@ ensures x ≡ 1; */ { x = 1; - e_acsl_assert(! (x == 1),(char *)"Postcondition",(char *)"(x == 1)",8); + e_acsl_assert(! (x == 1),(char *)"Postcondition",(char *)"(x == 1)",9); } /*@ ensures x ≡ 2; ensures y ≡ 2; */ { x = 2; - e_acsl_assert(! (x == 2),(char *)"Postcondition",(char *)"(x == 2)",11); - e_acsl_assert(! (y == 2),(char *)"Postcondition",(char *)"(y == 2)",12); + e_acsl_assert(! (x == 2),(char *)"Postcondition",(char *)"(x == 2)",12); + e_acsl_assert(! (y == 2),(char *)"Postcondition",(char *)"(y == 2)",13); } /*@ requires x ≡ 2; */ - e_acsl_assert(! (x == 2),(char *)"Precondition",(char *)"(x == 2)",15); + e_acsl_assert(! (x == 2),(char *)"Precondition",(char *)"(x == 2)",16); x ++; /*@ requires x ≡ 3; requires y ≡ 2; */ - e_acsl_assert(! (x == 3),(char *)"Precondition",(char *)"(x == 3)",18); - e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",19); + e_acsl_assert(! (x == 3),(char *)"Precondition",(char *)"(x == 3)",19); + e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",20); x += y; /*@ behavior b1: requires x ≡ 5; @@ -55,14 +55,14 @@ int main(void) */ { - e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",23); + e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",24); e_acsl_assert(! ((long long)x == (long long)3 + (long long)y), - (char *)"Precondition",(char *)"(x == 3+y)",26); - e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",27); + (char *)"Precondition",(char *)"(x == 3+y)",27); + e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",28); x = 3; - e_acsl_assert(! (x == 3),(char *)"Postcondition",(char *)"(x == 3)",24); + e_acsl_assert(! (x == 3),(char *)"Postcondition",(char *)"(x == 3)",25); e_acsl_assert(! ((long long)x == (long long)y + (long long)1), - (char *)"Postcondition",(char *)"(x == y+1)",28); + (char *)"Postcondition",(char *)"(x == y+1)",29); } /*@ behavior b1: @@ -85,33 +85,33 @@ int main(void) if (! (x == 1)) { e_acsl_1 = 1; } else { e_acsl_1 = x == 0; } e_acsl_assert(! e_acsl_1,(char *)"Precondition", - (char *)"(x == 1 ==> x == 0)",33); + (char *)"(x == 1 ==> x == 0)",34); if (x == 3) { e_acsl_2 = y == 2; } else { e_acsl_2 = 0; } if (! e_acsl_2) { e_acsl_3 = 1; } else { e_acsl_3 = x == 3; } e_acsl_assert(! e_acsl_3,(char *)"Precondition", - (char *)"(x == 3 && y == 2 ==> x == 3)",37); + (char *)"(x == 3 && y == 2 ==> x == 3)",38); if (x == 3) { e_acsl_4 = y == 2; } else { e_acsl_4 = 0; } if (! e_acsl_4) { e_acsl_5 = 1; } else { e_acsl_5 = (long long)x + (long long)y == (long long)5; } e_acsl_assert(! e_acsl_5,(char *)"Precondition", - (char *)"(x == 3 && y == 2 ==> x+y == 5)",38); + (char *)"(x == 3 && y == 2 ==> x+y == 5)",39); x += y; } /*@ requires x ≡ 5; */ - e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",41); + e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",42); /*@ requires y ≡ 2; */ - e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",42); + e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",43); x += y; /*@ requires x ≡ 7; ensures x ≡ 7; */ { - e_acsl_assert(! (x == 7),(char *)"Precondition",(char *)"(x == 7)",45); + e_acsl_assert(! (x == 7),(char *)"Precondition",(char *)"(x == 7)",46); __retres = 0; - e_acsl_assert(! (x == 7),(char *)"Postcondition",(char *)"(x == 7)",46); + e_acsl_assert(! (x == 7),(char *)"Postcondition",(char *)"(x == 7)",47); } return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract2.c new file mode 100644 index 00000000000..fc1d31f5348 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_stmt_contract2.c @@ -0,0 +1,484 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + assigns *z1; */ +extern void __gmpz_neg(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +extern int ( /* missing proto */ __gmpz_com)(); +int main(void) +{ + int __retres; + int x; + int y; + x = -3; + y = 2; + /*@ assert -3 ≡ x; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + mpz_t e_acsl_3; + int e_acsl_4; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_2)); + __gmpz_neg((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_1)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)x); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_assert(! (e_acsl_4 == 0),(char *)"Assertion",(char *)"(-3 == x)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + } + + /*@ assert x ≡ -3; */ ; + { + mpz_t e_acsl_5; + mpz_t e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_6),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_7)); + __gmpz_neg((__mpz_struct *)(e_acsl_7),(__mpz_struct const *)(e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_5), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Assertion",(char *)"(x == -3)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ assert 0 ≢ ~0; */ ; + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + __gmpz_init((__mpz_struct *)(e_acsl_10)); + __gmpz_com(e_acsl_10,e_acsl_9); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 != 0),(char *)"Assertion",(char *)"(0 != ~0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + /*@ assert x+1 ≡ -2; */ ; + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14),(__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + __gmpz_neg((__mpz_struct *)(e_acsl_16),(__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Assertion", + (char *)"(x+1 == -2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + /*@ assert x-1 ≡ -4; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + mpz_t e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_20)); + __gmpz_sub((__mpz_struct *)(e_acsl_20),(__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_22)); + __gmpz_neg((__mpz_struct *)(e_acsl_22),(__mpz_struct const *)(e_acsl_21)); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_20), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_assert(! (e_acsl_23 == 0),(char *)"Assertion", + (char *)"(x-1 == -4)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + /*@ assert x*3 ≡ -9; */ ; + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_26)); + __gmpz_mul((__mpz_struct *)(e_acsl_26),(__mpz_struct const *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)9); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_neg((__mpz_struct *)(e_acsl_28),(__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Assertion", + (char *)"(x*3 == -9)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + /*@ assert x/3 ≡ -1; */ ; + { + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_32),(long)0); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_init((__mpz_struct *)(e_acsl_34)); + /*@ assert 3 ≢ 0; */ ; + e_acsl_assert(e_acsl_33 == 0,(char *)"Assertion",(char *)"(3 == 0)",19); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_36)); + __gmpz_neg((__mpz_struct *)(e_acsl_36),(__mpz_struct const *)(e_acsl_35)); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_assert(! (e_acsl_37 == 0),(char *)"Assertion", + (char *)"(x/3 == -1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert 0xfffffffffff/0xfffffffffff ≡ 1; */ ; + { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + mpz_t e_acsl_41; + mpz_t e_acsl_42; + int e_acsl_43; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_38),"17592186044415",10); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)0); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + /*@ assert 0xfffffffffff ≢ 0; */ ; + e_acsl_assert(e_acsl_40 == 0,(char *)"Assertion", + (char *)"(0xfffffffffff == 0)",20); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_38)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)1); + e_acsl_43 = __gmpz_cmp((__mpz_struct const *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_42)); + e_acsl_assert(! (e_acsl_43 == 0),(char *)"Assertion", + (char *)"(0xfffffffffff/0xfffffffffff == 1)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + } + + /*@ assert x%2 ≡ -1; */ ; + { + mpz_t e_acsl_44; + mpz_t e_acsl_45; + mpz_t e_acsl_46; + int e_acsl_47; + mpz_t e_acsl_48; + mpz_t e_acsl_49; + mpz_t e_acsl_50; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)0); + e_acsl_47 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_46)); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_47 == 0,(char *)"Assertion",(char *)"(2 == 0)",21); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_49),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_50)); + __gmpz_neg((__mpz_struct *)(e_acsl_50),(__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_50)); + e_acsl_assert(! (e_acsl_51 == 0),(char *)"Assertion", + (char *)"(x%2 == -1)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + /*@ assert -3%-2 ≡ -1; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + mpz_t e_acsl_54; + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)3); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_neg((__mpz_struct *)(e_acsl_53),(__mpz_struct const *)(e_acsl_52)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_55)); + __gmpz_neg((__mpz_struct *)(e_acsl_55),(__mpz_struct const *)(e_acsl_54)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_57 == 0,(char *)"Assertion",(char *)"(-2 == 0)",22); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_55)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_60)); + __gmpz_neg((__mpz_struct *)(e_acsl_60),(__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_60)); + e_acsl_assert(! (e_acsl_61 == 0),(char *)"Assertion", + (char *)"(-3%-2 == -1)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + /*@ assert 3%-2 ≡ 1; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + mpz_t e_acsl_64; + mpz_t e_acsl_65; + int e_acsl_66; + mpz_t e_acsl_67; + mpz_t e_acsl_68; + int e_acsl_69; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_64)); + __gmpz_neg((__mpz_struct *)(e_acsl_64),(__mpz_struct const *)(e_acsl_63)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)0); + e_acsl_66 = __gmpz_cmp((__mpz_struct const *)(e_acsl_64), + (__mpz_struct const *)(e_acsl_65)); + __gmpz_init((__mpz_struct *)(e_acsl_67)); + /*@ assert -2 ≢ 0; */ ; + e_acsl_assert(e_acsl_66 == 0,(char *)"Assertion",(char *)"(-2 == 0)",23); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_64)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)1); + e_acsl_69 = __gmpz_cmp((__mpz_struct const *)(e_acsl_67), + (__mpz_struct const *)(e_acsl_68)); + e_acsl_assert(! (e_acsl_69 == 0),(char *)"Assertion", + (char *)"(3%-2 == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_64)); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_67)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + /*@ assert ((x*2+(3+y))-4)+(x-y) ≡ -10; */ ; + { + mpz_t e_acsl_70; + mpz_t e_acsl_71; + mpz_t e_acsl_72; + mpz_t e_acsl_73; + mpz_t e_acsl_74; + mpz_t e_acsl_75; + mpz_t e_acsl_76; + mpz_t e_acsl_77; + mpz_t e_acsl_78; + mpz_t e_acsl_79; + mpz_t e_acsl_80; + mpz_t e_acsl_81; + mpz_t e_acsl_82; + int e_acsl_83; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_70),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_mul((__mpz_struct *)(e_acsl_72),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_74),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_75)); + __gmpz_add((__mpz_struct *)(e_acsl_75),(__mpz_struct const *)(e_acsl_73), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_76)); + __gmpz_add((__mpz_struct *)(e_acsl_76),(__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_75)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_77),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + __gmpz_sub((__mpz_struct *)(e_acsl_78),(__mpz_struct const *)(e_acsl_76), + (__mpz_struct const *)(e_acsl_77)); + __gmpz_init((__mpz_struct *)(e_acsl_79)); + __gmpz_sub((__mpz_struct *)(e_acsl_79),(__mpz_struct const *)(e_acsl_70), + (__mpz_struct const *)(e_acsl_74)); + __gmpz_init((__mpz_struct *)(e_acsl_80)); + __gmpz_add((__mpz_struct *)(e_acsl_80),(__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_81),(long)10); + __gmpz_init((__mpz_struct *)(e_acsl_82)); + __gmpz_neg((__mpz_struct *)(e_acsl_82),(__mpz_struct const *)(e_acsl_81)); + e_acsl_83 = __gmpz_cmp((__mpz_struct const *)(e_acsl_80), + (__mpz_struct const *)(e_acsl_82)); + e_acsl_assert(! (e_acsl_83 == 0),(char *)"Assertion", + (char *)"(((x*2+(3+y))-4)+(x-y) == -10)",25); + __gmpz_clear((__mpz_struct *)(e_acsl_70)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_77)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + __gmpz_clear((__mpz_struct *)(e_acsl_80)); + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + } + + /*@ assert (0≡1) ≡ !(0≡0); */ ; + /*@ assert (0≤-1) ≡ (0>0); */ ; + /*@ assert (0≥-1) ≡ (0≤0); */ ; + /*@ assert (0≢1) ≡ !(0≢0); */ ; + /*@ assert (0≢0) ≡ !(1≢0); */ ; + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c index 087319aa515..b410f351567 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true.c @@ -21,7 +21,7 @@ int main(void) int x; x = 0; /*@ assert \true; */ ; - e_acsl_assert(0,(char *)"Assertion",(char *)"(\\true)",8); + e_acsl_assert(0,(char *)"Assertion",(char *)"(\\true)",9); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true2.c new file mode 100644 index 00000000000..b410f351567 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_true2.c @@ -0,0 +1,29 @@ +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert \true; */ ; + e_acsl_assert(0,(char *)"Assertion",(char *)"(\\true)",9); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef.c index a1f81555c19..4435c8f153f 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef.c +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef.c @@ -22,7 +22,7 @@ int main(void) uint8 x; x = (unsigned char)0; /*@ assert x ≡ 0; */ ; - e_acsl_assert(! ((int)x == 0),(char *)"Assertion",(char *)"(x == 0)",10); + e_acsl_assert(! ((int)x == 0),(char *)"Assertion",(char *)"(x == 0)",11); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef2.c b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef2.c new file mode 100644 index 00000000000..a14365e8782 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/gen_typedef2.c @@ -0,0 +1,66 @@ +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +typedef unsigned char uint8; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_ui(__mpz_struct * /*[1]*/ z, unsigned long n); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + uint8 x; + x = (unsigned char)0; + /*@ assert x ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_1),(unsigned long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(x == 0)", + 11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.res.oracle new file mode 100644 index 00000000000..b74535209eb --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.1.res.oracle @@ -0,0 +1,171 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:229:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:233. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:234. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:235. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:236. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:241:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:246. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:247. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:248. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:249. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:255:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_str <- main. + Called from PROJECT_FILE.i:259. +PROJECT_FILE.i:86:[value] Function __gmpz_init_set_str: postcondition got status valid. +[value] Done for function __gmpz_init_set_str +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:261. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:263. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ ensures \valid(\old(z)); + assigns *z; */ +extern int __gmpz_init_set_str(__mpz_struct * /*[1]*/ z, char const *str, + int base); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + /*@ assert 0 ≡ 0; */ ; + { + mpz_t e_acsl_1; + int e_acsl_2; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)0); + e_acsl_2 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_1)); + e_acsl_assert(! (e_acsl_2 == 0),(char *)"Assertion",(char *)"(0 == 0)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + } + + x = 0; + /*@ assert 0 ≢ 1; */ ; + { + mpz_t e_acsl_3; + mpz_t e_acsl_4; + int e_acsl_5; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)1); + e_acsl_5 = __gmpz_cmp((__mpz_struct const *)(e_acsl_3), + (__mpz_struct const *)(e_acsl_4)); + e_acsl_assert(! (e_acsl_5 != 0),(char *)"Assertion",(char *)"(0 != 1)", + 10); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + } + + /*@ assert 1152921504606846975 ≡ 0xfffffffffffffff; */ ; + { + mpz_t e_acsl_6; + int e_acsl_7; + __gmpz_init_set_str((__mpz_struct *)(e_acsl_6),"1152921504606846975",10); + e_acsl_7 = __gmpz_cmp((__mpz_struct const *)(e_acsl_6), + (__mpz_struct const *)(e_acsl_6)); + e_acsl_assert(! (e_acsl_7 == 0),(char *)"Assertion", + (char *)"(1152921504606846975 == 0xfffffffffffffff)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle index 9dbd7d6e16a..971e93ac11c 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/integer_constant.res.oracle @@ -46,14 +46,14 @@ int main(void) int __retres; int x; /*@ assert 0 ≡ 0; */ ; - e_acsl_assert(! (0 == 0),(char *)"Assertion",(char *)"(0 == 0)",8); + e_acsl_assert(! (0 == 0),(char *)"Assertion",(char *)"(0 == 0)",9); x = 0; /*@ assert 0 ≢ 1; */ ; - e_acsl_assert(! (0 != 1),(char *)"Assertion",(char *)"(0 != 1)",9); + e_acsl_assert(! (0 != 1),(char *)"Assertion",(char *)"(0 != 1)",10); /*@ assert 1152921504606846975 ≡ 0xfffffffffffffff; */ ; e_acsl_assert(! ((unsigned long long)1152921504606846975 == (unsigned long long)0xfffffffffffffff), (char *)"Assertion", - (char *)"(1152921504606846975 == 0xfffffffffffffff)",10); + (char *)"(1152921504606846975 == 0xfffffffffffffff)",11); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.res.oracle new file mode 100644 index 00000000000..d7ea4e71a74 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.1.res.oracle @@ -0,0 +1,1169 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:233:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +PROJECT_FILE.i:252:[value] assigning non deterministic value for the first time +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:244. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:249. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:257. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:263:[value] warning: 2's complement assumed for overflow +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ [--..--] +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + { + int i; + i = 0; + while (1) { + if (! (i < 10)) { break; } + /*@ invariant 0 ≤ i ∧ i < 10; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)i); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + if (e_acsl_3 <= 0) { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)i); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)10); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = e_acsl_6 < 0; + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + else { e_acsl_7 = 0; } + e_acsl_assert(! e_acsl_7,(char *)"Invariant", + (char *)"(0 <= i && i < 10)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + x += i; + /*@ invariant i ≤ x; */ ; + { + mpz_t e_acsl_8; + mpz_t e_acsl_9; + int e_acsl_10; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)i); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)x); + e_acsl_10 = __gmpz_cmp((__mpz_struct const *)(e_acsl_8), + (__mpz_struct const *)(e_acsl_9)); + e_acsl_assert(! (e_acsl_10 <= 0),(char *)"Invariant", + (char *)"(i <= x)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + } + + i ++; + } + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.res.oracle index 1b2c432f853..774a82f7207 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/invariant.res.oracle @@ -263,12 +263,12 @@ int main(void) if (0 <= i) { e_acsl_1 = i < 10; } else { e_acsl_1 = 0; } e_acsl_assert(! e_acsl_1,(char *)"Invariant", - (char *)"(0 <= i && i < 10)",8); + (char *)"(0 <= i && i < 10)",9); } x += i; /*@ invariant i ≤ x; */ ; - e_acsl_assert(! (i <= x),(char *)"Invariant",(char *)"(i <= x)",10); + e_acsl_assert(! (i <= x),(char *)"Invariant",(char *)"(i <= x)",11); i ++; } } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.res.oracle new file mode 100644 index 00000000000..8dd2188882b --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.1.res.oracle @@ -0,0 +1,235 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization + X ∈ {0} +PROJECT_FILE.i:232:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:240. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:241. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:261. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:262. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:263. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:264. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:268. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:271. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:272. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:286. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:287. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:288. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:289. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:290. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:226:[value] Function main: postcondition got status valid. +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + X ∈ {3} + __retres ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int X = 0; +/*@ ensures X ≡ 3; */ +int main(void) +{ + int __retres; + goto L1; + L1: + /*@ assert X ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(X == 0)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + X = 1; + goto L2; + L2: + /*@ requires X ≡ 1; + ensures X ≡ 2; */ + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)1); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Precondition", + (char *)"(X == 1)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + X = 2; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)2); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Postcondition", + (char *)"(X == 2)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + if (X) { + X = 3; + __retres = 0; + goto return_label; } + __retres = 0; + return_label: + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)X); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)3); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Postcondition", + (char *)"(X == 3)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + return (__retres); + } + +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.res.oracle index a9ef5b44e1c..8f49293ac5b 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/labeled_stmt.res.oracle @@ -53,16 +53,16 @@ int main(void) goto L1; L1: /*@ assert X ≡ 0; */ ; - e_acsl_assert(! (X == 0),(char *)"Assertion",(char *)"(X == 0)",11); + e_acsl_assert(! (X == 0),(char *)"Assertion",(char *)"(X == 0)",12); X = 1; goto L2; L2: /*@ requires X ≡ 1; ensures X ≡ 2; */ { - e_acsl_assert(! (X == 1),(char *)"Precondition",(char *)"(X == 1)",13); + e_acsl_assert(! (X == 1),(char *)"Precondition",(char *)"(X == 1)",14); X = 2; - e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",13); + e_acsl_assert(! (X == 2),(char *)"Postcondition",(char *)"(X == 2)",14); } if (X) { @@ -71,7 +71,7 @@ int main(void) goto return_label; } __retres = 0; return_label: e_acsl_assert(! (X == 3),(char *)"Postcondition", - (char *)"(X == 3)",8); + (char *)"(X == 3)",9); return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.res.oracle new file mode 100644 index 00000000000..758408e9d0e --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.1.res.oracle @@ -0,0 +1,1271 @@ +:0:[e-acsl] warning: E-ACSL construct `typing of user-defined logic type' is not yet supported. + Ignoring annotation. +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:232:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:239. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:245. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:246. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:247. +[value] Done for function __gmpz_cmp +PROJECT_FILE.i:248:[value] assigning non deterministic value for the first time +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:249. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:253. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:254. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:259:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:265. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:267. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:275. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:277. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:278. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:279. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +PROJECT_FILE.i:280:[value] Assertion got status invalid (stopping propagation). +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:291. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:292. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:293. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:297:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:304. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:305. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:311. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:312. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:313. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:315. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:318. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:319. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:320. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:324:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:330. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:331. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:332. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:342. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:343. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:344. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:345. +[value] Done for function __gmpz_init +PROJECT_FILE.i:346:[value] Assertion got status invalid (stopping propagation). +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:356. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:358. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:362:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:370. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:376. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:377. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:378. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:380. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:381. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:383. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:384. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:385. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:389:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:395. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:396. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:397. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:406. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:407. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:408. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:409. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:410. +[value] Done for function __gmpz_init +PROJECT_FILE.i:411:[value] Assertion got status invalid (stopping propagation). +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:421. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:422. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:423. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:427:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:433. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:434. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:435. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:440. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:451. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:441. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:452. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:442. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:453. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:444. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:455. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:456. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:458. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:459. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:460. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:464:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:470. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:471. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:472. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:477. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:488. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:478. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:489. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:479. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:490. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:481. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:492. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:482. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:493. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:495. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:496. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:497. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:501:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:507. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:508. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:509. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:514. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:525. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:515. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:526. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:516. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:527. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:518. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:529. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:519. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:530. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:532. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:533. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:534. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:538:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:545. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:546. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:547. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:553. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:554. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:555. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:557. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:558. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:565. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:566. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:567. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:573. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:574. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:575. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:577. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:578. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:581. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:582. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:585. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:586. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:587. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:591:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:598. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:599. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:600. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:606. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:607. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:608. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:610. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:611. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:618. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:619. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:620. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:626. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:627. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:628. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:630. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:631. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:634. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:635. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:638. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:639. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:640. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:644:[value] Assertion got status valid. +PROJECT_FILE.i:646:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:653. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:654. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:655. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:660. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:661. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:662. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:664. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:665. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:673. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:674. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:675. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:677. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:678. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:680. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:682. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:683. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:687:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:694. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:695. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:696. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:702. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:703. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:704. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:706. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:707. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:713. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:714. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:715. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:717. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:718. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:721. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:723. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:724. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} + y ∈ {1} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + x = 0; + y = 1; + /*@ assert x ≡ 0 ∧ y ≡ 1; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + if (e_acsl_3 == 0) { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)1); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = e_acsl_6 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + else { e_acsl_7 = 0; } + e_acsl_assert(! e_acsl_7,(char *)"Assertion", + (char *)"(x == 0 && y == 1)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert ¬(x ≢ 0 ∧ y ≡ 1/0); */ ; + { + mpz_t e_acsl_8; + mpz_t e_acsl_9; + int e_acsl_10; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)0); + e_acsl_10 = __gmpz_cmp((__mpz_struct const *)(e_acsl_8), + (__mpz_struct const *)(e_acsl_9)); + if (e_acsl_10 != 0) { + mpz_t e_acsl_11; + mpz_t e_acsl_12; + mpz_t e_acsl_13; + int e_acsl_14; + mpz_t e_acsl_15; + int e_acsl_16; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)0); + e_acsl_14 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_init((__mpz_struct *)(e_acsl_15)); + /*@ assert 0 ≢ 0; */ ; + e_acsl_assert(e_acsl_14 == 0,(char *)"Assertion",(char *)"(0 == 0)",12); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_15), + (__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + e_acsl_16 = __gmpz_cmp((__mpz_struct const *)(e_acsl_11), + (__mpz_struct const *)(e_acsl_15)); + e_acsl_17 = e_acsl_16 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + } + else { e_acsl_17 = 0; } + e_acsl_assert(! (! e_acsl_17),(char *)"Assertion", + (char *)"(!(x != 0 && y == 1/0))",12); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + } + + /*@ assert y ≡ 1 ∨ x ≡ 1; */ ; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + int e_acsl_20; + int e_acsl_24; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)1); + e_acsl_20 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + if (e_acsl_20 == 0) { e_acsl_24 = 1; } + else { + mpz_t e_acsl_21; + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)1); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_21), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_24 = e_acsl_23 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + e_acsl_assert(! e_acsl_24,(char *)"Assertion", + (char *)"(y == 1 || x == 1)",13); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + } + + /*@ assert x ≡ 0 ∨ y ≡ 1/0; */ ; + { + mpz_t e_acsl_25; + mpz_t e_acsl_26; + int e_acsl_27; + int e_acsl_34; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_26),(long)0); + e_acsl_27 = __gmpz_cmp((__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_26)); + if (e_acsl_27 == 0) { e_acsl_34 = 1; } + else { + mpz_t e_acsl_28; + mpz_t e_acsl_29; + mpz_t e_acsl_30; + int e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_28),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_29),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)0); + e_acsl_31 = __gmpz_cmp((__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_30)); + __gmpz_init((__mpz_struct *)(e_acsl_32)); + /*@ assert 0 ≢ 0; */ ; + e_acsl_assert(e_acsl_31 == 0,(char *)"Assertion",(char *)"(0 == 0)",14); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_29), + (__mpz_struct const *)(e_acsl_30)); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_28), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_34 = e_acsl_33 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_29)); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + e_acsl_assert(! e_acsl_34,(char *)"Assertion", + (char *)"(x == 0 || y == 1/0)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + } + + /*@ assert x ≡ 0 ⇒ y ≡ 1; */ ; + { + mpz_t e_acsl_35; + mpz_t e_acsl_36; + int e_acsl_37; + int e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_36),(long)0); + e_acsl_37 = __gmpz_cmp((__mpz_struct const *)(e_acsl_35), + (__mpz_struct const *)(e_acsl_36)); + if (! (e_acsl_37 == 0)) { e_acsl_41 = 1; } + else { + mpz_t e_acsl_38; + mpz_t e_acsl_39; + int e_acsl_40; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)1); + e_acsl_40 = __gmpz_cmp((__mpz_struct const *)(e_acsl_38), + (__mpz_struct const *)(e_acsl_39)); + e_acsl_41 = e_acsl_40 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + } + e_acsl_assert(! e_acsl_41,(char *)"Assertion", + (char *)"(x == 0 ==> y == 1)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + } + + /*@ assert x ≡ 1 ⇒ y ≡ 1/0; */ ; + { + mpz_t e_acsl_42; + mpz_t e_acsl_43; + int e_acsl_44; + int e_acsl_51; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_42),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_43),(long)1); + e_acsl_44 = __gmpz_cmp((__mpz_struct const *)(e_acsl_42), + (__mpz_struct const *)(e_acsl_43)); + if (! (e_acsl_44 == 0)) { e_acsl_51 = 1; } + else { + mpz_t e_acsl_45; + mpz_t e_acsl_46; + mpz_t e_acsl_47; + int e_acsl_48; + mpz_t e_acsl_49; + int e_acsl_50; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_45),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_46),(long)1); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_47),(long)0); + e_acsl_48 = __gmpz_cmp((__mpz_struct const *)(e_acsl_47), + (__mpz_struct const *)(e_acsl_47)); + __gmpz_init((__mpz_struct *)(e_acsl_49)); + /*@ assert 0 ≢ 0; */ ; + e_acsl_assert(e_acsl_48 == 0,(char *)"Assertion",(char *)"(0 == 0)",16); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_49), + (__mpz_struct const *)(e_acsl_46), + (__mpz_struct const *)(e_acsl_47)); + e_acsl_50 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_49)); + e_acsl_51 = e_acsl_50 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_47)); + __gmpz_clear((__mpz_struct *)(e_acsl_49)); + } + e_acsl_assert(! e_acsl_51,(char *)"Assertion", + (char *)"(x == 1 ==> y == 1/0)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_42)); + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + } + + /*@ assert x≢0? x ≢ 0: y ≢ 0; */ ; + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + int e_acsl_54; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_53),(long)0); + e_acsl_54 = __gmpz_cmp((__mpz_struct const *)(e_acsl_52), + (__mpz_struct const *)(e_acsl_53)); + if (e_acsl_54 != 0) { + mpz_t e_acsl_55; + mpz_t e_acsl_56; + int e_acsl_57; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_55),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)0); + e_acsl_57 = __gmpz_cmp((__mpz_struct const *)(e_acsl_55), + (__mpz_struct const *)(e_acsl_56)); + e_acsl_61 = e_acsl_57 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + } + else { + mpz_t e_acsl_58; + mpz_t e_acsl_59; + int e_acsl_60; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_58),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)0); + e_acsl_60 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = e_acsl_60 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + } + e_acsl_assert(! e_acsl_61,(char *)"Assertion", + (char *)"(x!=0? x != 0: y != 0)",17); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + } + + /*@ assert y≢0? y ≢ 0: x ≢ 0; */ ; + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + int e_acsl_64; + int e_acsl_71; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)0); + e_acsl_64 = __gmpz_cmp((__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_63)); + if (e_acsl_64 != 0) { + mpz_t e_acsl_65; + mpz_t e_acsl_66; + int e_acsl_67; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_66),(long)0); + e_acsl_67 = __gmpz_cmp((__mpz_struct const *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_66)); + e_acsl_71 = e_acsl_67 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_66)); + } + else { + mpz_t e_acsl_68; + mpz_t e_acsl_69; + int e_acsl_70; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_69),(long)0); + e_acsl_70 = __gmpz_cmp((__mpz_struct const *)(e_acsl_68), + (__mpz_struct const *)(e_acsl_69)); + e_acsl_71 = e_acsl_70 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + __gmpz_clear((__mpz_struct *)(e_acsl_69)); + } + e_acsl_assert(! e_acsl_71,(char *)"Assertion", + (char *)"(y!=0? y != 0: x != 0)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + } + + /*@ assert x≡1? x ≡ 18: x ≡ 0; */ ; + { + mpz_t e_acsl_72; + mpz_t e_acsl_73; + int e_acsl_74; + int e_acsl_81; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_72),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_73),(long)1); + e_acsl_74 = __gmpz_cmp((__mpz_struct const *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_73)); + if (e_acsl_74 == 0) { + mpz_t e_acsl_75; + mpz_t e_acsl_76; + int e_acsl_77; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_75),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_76),(long)18); + e_acsl_77 = __gmpz_cmp((__mpz_struct const *)(e_acsl_75), + (__mpz_struct const *)(e_acsl_76)); + e_acsl_81 = e_acsl_77 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + } + else { + mpz_t e_acsl_78; + mpz_t e_acsl_79; + int e_acsl_80; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_78),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_79),(long)0); + e_acsl_80 = __gmpz_cmp((__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_79)); + e_acsl_81 = e_acsl_80 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + __gmpz_clear((__mpz_struct *)(e_acsl_79)); + } + e_acsl_assert(! e_acsl_81,(char *)"Assertion", + (char *)"(x==1? x == 18: x == 0)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_73)); + } + + /*@ assert x ≡ 2 ⇔ y ≡ 3; */ ; + { + mpz_t e_acsl_82; + mpz_t e_acsl_83; + int e_acsl_84; + int e_acsl_88; + int e_acsl_96; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_82),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_83),(long)2); + e_acsl_84 = __gmpz_cmp((__mpz_struct const *)(e_acsl_82), + (__mpz_struct const *)(e_acsl_83)); + if (! (e_acsl_84 == 0)) { e_acsl_88 = 1; } + else { + mpz_t e_acsl_85; + mpz_t e_acsl_86; + int e_acsl_87; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_85),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_86),(long)3); + e_acsl_87 = __gmpz_cmp((__mpz_struct const *)(e_acsl_85), + (__mpz_struct const *)(e_acsl_86)); + e_acsl_88 = e_acsl_87 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_85)); + __gmpz_clear((__mpz_struct *)(e_acsl_86)); + } + if (e_acsl_88) { + mpz_t e_acsl_89; + mpz_t e_acsl_90; + int e_acsl_91; + int e_acsl_95; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_89),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_90),(long)3); + e_acsl_91 = __gmpz_cmp((__mpz_struct const *)(e_acsl_89), + (__mpz_struct const *)(e_acsl_90)); + if (! (e_acsl_91 == 0)) { e_acsl_95 = 1; } + else { + mpz_t e_acsl_92; + mpz_t e_acsl_93; + int e_acsl_94; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_92),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_93),(long)2); + e_acsl_94 = __gmpz_cmp((__mpz_struct const *)(e_acsl_92), + (__mpz_struct const *)(e_acsl_93)); + e_acsl_95 = e_acsl_94 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_92)); + __gmpz_clear((__mpz_struct *)(e_acsl_93)); + } + e_acsl_96 = e_acsl_95; + __gmpz_clear((__mpz_struct *)(e_acsl_89)); + __gmpz_clear((__mpz_struct *)(e_acsl_90)); + } + else { e_acsl_96 = 0; } + e_acsl_assert(! e_acsl_96,(char *)"Assertion", + (char *)"(x == 2 <==> y == 3)",22); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + __gmpz_clear((__mpz_struct *)(e_acsl_83)); + } + + /*@ assert x ≡ 0 ⇔ y ≡ 1; */ ; + { + mpz_t e_acsl_97; + mpz_t e_acsl_98; + int e_acsl_99; + int e_acsl_103; + int e_acsl_111; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_97),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_98),(long)0); + e_acsl_99 = __gmpz_cmp((__mpz_struct const *)(e_acsl_97), + (__mpz_struct const *)(e_acsl_98)); + if (! (e_acsl_99 == 0)) { e_acsl_103 = 1; } + else { + mpz_t e_acsl_100; + mpz_t e_acsl_101; + int e_acsl_102; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_100),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_101),(long)1); + e_acsl_102 = __gmpz_cmp((__mpz_struct const *)(e_acsl_100), + (__mpz_struct const *)(e_acsl_101)); + e_acsl_103 = e_acsl_102 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_100)); + __gmpz_clear((__mpz_struct *)(e_acsl_101)); + } + if (e_acsl_103) { + mpz_t e_acsl_104; + mpz_t e_acsl_105; + int e_acsl_106; + int e_acsl_110; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_104),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_105),(long)1); + e_acsl_106 = __gmpz_cmp((__mpz_struct const *)(e_acsl_104), + (__mpz_struct const *)(e_acsl_105)); + if (! (e_acsl_106 == 0)) { e_acsl_110 = 1; } + else { + mpz_t e_acsl_107; + mpz_t e_acsl_108; + int e_acsl_109; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_107),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_108),(long)0); + e_acsl_109 = __gmpz_cmp((__mpz_struct const *)(e_acsl_107), + (__mpz_struct const *)(e_acsl_108)); + e_acsl_110 = e_acsl_109 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_107)); + __gmpz_clear((__mpz_struct *)(e_acsl_108)); + } + e_acsl_111 = e_acsl_110; + __gmpz_clear((__mpz_struct *)(e_acsl_104)); + __gmpz_clear((__mpz_struct *)(e_acsl_105)); + } + else { e_acsl_111 = 0; } + e_acsl_assert(! e_acsl_111,(char *)"Assertion", + (char *)"(x == 0 <==> y == 1)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_97)); + __gmpz_clear((__mpz_struct *)(e_acsl_98)); + } + + /*@ assert ((x≢0? x: y)≢0) ≡ (x≡0); */ ; + /*@ assert (x ≢ 0 ∧ y ≢ 0) ∨ y ≢ 0; */ ; + { + mpz_t e_acsl_112; + mpz_t e_acsl_113; + int e_acsl_114; + int e_acsl_118; + int e_acsl_122; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_112),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_113),(long)0); + e_acsl_114 = __gmpz_cmp((__mpz_struct const *)(e_acsl_112), + (__mpz_struct const *)(e_acsl_113)); + if (e_acsl_114 != 0) { + mpz_t e_acsl_115; + mpz_t e_acsl_116; + int e_acsl_117; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_115),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_116),(long)0); + e_acsl_117 = __gmpz_cmp((__mpz_struct const *)(e_acsl_115), + (__mpz_struct const *)(e_acsl_116)); + e_acsl_118 = e_acsl_117 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_115)); + __gmpz_clear((__mpz_struct *)(e_acsl_116)); + } + else { e_acsl_118 = 0; } + if (e_acsl_118) { e_acsl_122 = 1; } + else { + mpz_t e_acsl_119; + mpz_t e_acsl_120; + int e_acsl_121; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_119),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_120),(long)0); + e_acsl_121 = __gmpz_cmp((__mpz_struct const *)(e_acsl_119), + (__mpz_struct const *)(e_acsl_120)); + e_acsl_122 = e_acsl_121 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_119)); + __gmpz_clear((__mpz_struct *)(e_acsl_120)); + } + e_acsl_assert(! e_acsl_122,(char *)"Assertion", + (char *)"((x != 0 && y != 0) || y != 0)",27); + __gmpz_clear((__mpz_struct *)(e_acsl_112)); + __gmpz_clear((__mpz_struct *)(e_acsl_113)); + } + + /*@ assert (x ≢ 0 ∨ y ≢ 0) ∧ y ≡ 1; */ ; + { + mpz_t e_acsl_123; + mpz_t e_acsl_124; + int e_acsl_125; + int e_acsl_129; + int e_acsl_133; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_123),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_124),(long)0); + e_acsl_125 = __gmpz_cmp((__mpz_struct const *)(e_acsl_123), + (__mpz_struct const *)(e_acsl_124)); + if (e_acsl_125 != 0) { e_acsl_129 = 1; } + else { + mpz_t e_acsl_126; + mpz_t e_acsl_127; + int e_acsl_128; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_126),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_127),(long)0); + e_acsl_128 = __gmpz_cmp((__mpz_struct const *)(e_acsl_126), + (__mpz_struct const *)(e_acsl_127)); + e_acsl_129 = e_acsl_128 != 0; + __gmpz_clear((__mpz_struct *)(e_acsl_126)); + __gmpz_clear((__mpz_struct *)(e_acsl_127)); + } + if (e_acsl_129) { + mpz_t e_acsl_130; + mpz_t e_acsl_131; + int e_acsl_132; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_130),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_131),(long)1); + e_acsl_132 = __gmpz_cmp((__mpz_struct const *)(e_acsl_130), + (__mpz_struct const *)(e_acsl_131)); + e_acsl_133 = e_acsl_132 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_130)); + __gmpz_clear((__mpz_struct *)(e_acsl_131)); + } + else { e_acsl_133 = 0; } + e_acsl_assert(! e_acsl_133,(char *)"Assertion", + (char *)"((x != 0 || y != 0) && y == 1)",28); + __gmpz_clear((__mpz_struct *)(e_acsl_123)); + __gmpz_clear((__mpz_struct *)(e_acsl_124)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.res.oracle index 325f5cf3d15..e8508b57b9d 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/lazy.res.oracle @@ -109,7 +109,7 @@ int main(void) if (x == 0) { e_acsl_1 = y == 1; } else { e_acsl_1 = 0; } e_acsl_assert(! e_acsl_1,(char *)"Assertion", - (char *)"(x == 0 && y == 1)",10); + (char *)"(x == 0 && y == 1)",11); } /*@ assert ¬(x ≢ 0 ∧ y ≡ 1/0); */ ; @@ -118,13 +118,13 @@ int main(void) if (x != 0) { int e_acsl_2; /*@ assert 0 ≢ 0; */ ; - e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",11); + e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",12); e_acsl_2 = 1 / 0; e_acsl_3 = y == e_acsl_2; } else { e_acsl_3 = 0; } e_acsl_assert(! (! e_acsl_3),(char *)"Assertion", - (char *)"(!(x != 0 && y == 1/0))",11); + (char *)"(!(x != 0 && y == 1/0))",12); } /*@ assert y ≡ 1 ∨ x ≡ 1; */ ; @@ -132,7 +132,7 @@ int main(void) if (y == 1) { e_acsl_4 = 1; } else { e_acsl_4 = x == 1; } e_acsl_assert(! e_acsl_4,(char *)"Assertion", - (char *)"(y == 1 || x == 1)",12); + (char *)"(y == 1 || x == 1)",13); } /*@ assert x ≡ 0 ∨ y ≡ 1/0; */ ; @@ -142,12 +142,12 @@ int main(void) else { int e_acsl_5; /*@ assert 0 ≢ 0; */ ; - e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",13); + e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",14); e_acsl_5 = 1 / 0; e_acsl_6 = y == e_acsl_5; } e_acsl_assert(! e_acsl_6,(char *)"Assertion", - (char *)"(x == 0 || y == 1/0)",13); + (char *)"(x == 0 || y == 1/0)",14); } /*@ assert x ≡ 0 ⇒ y ≡ 1; */ ; @@ -155,7 +155,7 @@ int main(void) if (! (x == 0)) { e_acsl_7 = 1; } else { e_acsl_7 = y == 1; } e_acsl_assert(! e_acsl_7,(char *)"Assertion", - (char *)"(x == 0 ==> y == 1)",14); + (char *)"(x == 0 ==> y == 1)",15); } /*@ assert x ≡ 1 ⇒ y ≡ 1/0; */ ; @@ -165,12 +165,12 @@ int main(void) else { int e_acsl_8; /*@ assert 0 ≢ 0; */ ; - e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",15); + e_acsl_assert(0 == 0,(char *)"Assertion",(char *)"(0 == 0)",16); e_acsl_8 = 1 / 0; e_acsl_9 = y == e_acsl_8; } e_acsl_assert(! e_acsl_9,(char *)"Assertion", - (char *)"(x == 1 ==> y == 1/0)",15); + (char *)"(x == 1 ==> y == 1/0)",16); } /*@ assert x≢0? x ≢ 0: y ≢ 0; */ ; @@ -178,7 +178,7 @@ int main(void) if (x != 0) { e_acsl_10 = x != 0; } else { e_acsl_10 = y != 0; } e_acsl_assert(! e_acsl_10,(char *)"Assertion", - (char *)"(x!=0? x != 0: y != 0)",16); + (char *)"(x!=0? x != 0: y != 0)",17); } /*@ assert y≢0? y ≢ 0: x ≢ 0; */ ; @@ -186,7 +186,7 @@ int main(void) if (y != 0) { e_acsl_11 = y != 0; } else { e_acsl_11 = x != 0; } e_acsl_assert(! e_acsl_11,(char *)"Assertion", - (char *)"(y!=0? y != 0: x != 0)",17); + (char *)"(y!=0? y != 0: x != 0)",18); } /*@ assert x≡1? x ≡ 18: x ≡ 0; */ ; @@ -194,7 +194,7 @@ int main(void) if (x == 1) { e_acsl_12 = x == 18; } else { e_acsl_12 = x == 0; } e_acsl_assert(! e_acsl_12,(char *)"Assertion", - (char *)"(x==1? x == 18: x == 0)",18); + (char *)"(x==1? x == 18: x == 0)",19); } /*@ assert x ≡ 2 ⇔ y ≡ 3; */ ; @@ -210,7 +210,7 @@ int main(void) } else { e_acsl_15 = 0; } e_acsl_assert(! e_acsl_15,(char *)"Assertion", - (char *)"(x == 2 <==> y == 3)",21); + (char *)"(x == 2 <==> y == 3)",22); } /*@ assert x ≡ 0 ⇔ y ≡ 1; */ ; @@ -226,7 +226,7 @@ int main(void) } else { e_acsl_18 = 0; } e_acsl_assert(! e_acsl_18,(char *)"Assertion", - (char *)"(x == 0 <==> y == 1)",22); + (char *)"(x == 0 <==> y == 1)",23); } /*@ assert ((x≢0? x: y)≢0) ≡ (x≡0); */ ; @@ -234,7 +234,7 @@ int main(void) if (x != 0) { e_acsl_19 = x; } else { e_acsl_19 = y; } e_acsl_assert(! ((e_acsl_19 != 0) == (x == 0)),(char *)"Assertion", - (char *)"(((x!=0? x: y)!=0) == (x==0))",25); + (char *)"(((x!=0? x: y)!=0) == (x==0))",26); } /*@ assert (x ≢ 0 ∧ y ≢ 0) ∨ y ≢ 0; */ ; @@ -245,7 +245,7 @@ int main(void) if (e_acsl_20) { e_acsl_21 = 1; } else { e_acsl_21 = y != 0; } e_acsl_assert(! e_acsl_21,(char *)"Assertion", - (char *)"((x != 0 && y != 0) || y != 0)",26); + (char *)"((x != 0 && y != 0) || y != 0)",27); } /*@ assert (x ≢ 0 ∨ y ≢ 0) ∧ y ≡ 1; */ ; @@ -256,7 +256,7 @@ int main(void) if (e_acsl_22) { e_acsl_23 = y == 1; } else { e_acsl_23 = 0; } e_acsl_assert(! e_acsl_23,(char *)"Assertion", - (char *)"((x != 0 || y != 0) && y == 1)",27); + (char *)"((x != 0 || y != 0) && y == 1)",28); } __retres = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.res.oracle new file mode 100644 index 00000000000..90907e4ca43 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.1.res.oracle @@ -0,0 +1,1015 @@ +tests/e-acsl-runtime/linear_search.i:9:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +:0:[e-acsl] warning: missing guard for ensuring that i is a valid array index +tests/e-acsl-runtime/linear_search.i:9:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +:0:[e-acsl] warning: missing guard for ensuring that i+1 is a valid array index +tests/e-acsl-runtime/linear_search.i:11:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +:0:[e-acsl] warning: missing guard for ensuring that j is a valid array index +tests/e-acsl-runtime/linear_search.i:14:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization + A[0..9] ∈ {0} +PROJECT_FILE.i:481:[value] entering loop for the first time +PROJECT_FILE.i:484:[value] assigning non deterministic value for the first time +[value] computing for function search <- main. + Called from PROJECT_FILE.i:487. +PROJECT_FILE.i:226:[value] Function search: precondition got status unknown. +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:247. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:250. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:251. +PROJECT_FILE.i:94:[value] Function __gmpz_set: precondition got status valid. +PROJECT_FILE.i:95:[value] Function __gmpz_set: precondition got status valid. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:252. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:255:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:260. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:273. +PROJECT_FILE.i:176:[value] Function __gmpz_get_ui: precondition got status valid. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:274:[kernel] warning: accessing out of bounds index [0..4294967295]. assert e_acsl_3 < 10; +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:275. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:277. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:278. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:279:[kernel] warning: accessing out of bounds index [0..4294967295]. assert e_acsl_7 < 10; +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:279. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:282. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:283. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:284. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:294. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:295. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:297. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:298. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:299. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:304. +[value] computing for function printf <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:307. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:312. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:315. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:320:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:324. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:325. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:327. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:335. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:336:[kernel] warning: accessing out of bounds index [0..4294967295]. assert e_acsl_33 < 10; +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:336. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:337. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:338. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:339. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:340. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:350. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:351. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:352. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:353. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:354. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:355. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:361. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:371. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:372. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:373. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:376:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:380. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:381. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:391. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:392:[kernel] warning: accessing out of bounds index [0..4294967295]. assert e_acsl_17 < 10; +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:392. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:393. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:394. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:395. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:396. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:406. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:407. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:408. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:409. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:410. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:411. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:417. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:423:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:446. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:447. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:449. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:450. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:452. +[value] computing for function printf <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:460. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:461. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:462. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:464. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:465. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:467. +[value] computing for function printf <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +PROJECT_FILE.i:229:[value] Function search, behavior exists: postcondition got status unknown. +PROJECT_FILE.i:229:[value] Function search, behavior exists: postcondition got status unknown, but it is unknown if the behavior is active. +PROJECT_FILE.i:233:[value] Function search, behavior not_exists: postcondition got status unknown. +PROJECT_FILE.i:233:[value] Function search, behavior not_exists: postcondition got status unknown, but it is unknown if the behavior is active. +[value] Recording results for search +[value] Done for function search +PROJECT_FILE.i:488:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:493. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:494. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:495. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:496. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:497. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:498. +[value] Done for function __gmpz_clear +[value] computing for function search <- main. + Called from PROJECT_FILE.i:502. +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:247. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:274:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:275. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:277. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:278. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:279:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:279. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:282. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:283. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:284. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:294. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:295. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:297. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:298. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:299. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:304. +[value] computing for function printf <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:307. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:312. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:315. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:324. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:325. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:327. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:335. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:336:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:336. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:337. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:338. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:339. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:340. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:350. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:351. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:352. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:353. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:354. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:355. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:361. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:371. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:372. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:373. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:380. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:381. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_get_ui <- search <- main. + Called from PROJECT_FILE.i:391. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:392:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:392. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:393. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:394. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:395. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:396. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:406. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- search <- main. + Called from PROJECT_FILE.i:407. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- search <- main. + Called from PROJECT_FILE.i:408. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- search <- main. + Called from PROJECT_FILE.i:409. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:410. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:411. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:417. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:446. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:447. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:449. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:450. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:452. +[value] computing for function printf <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:460. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- search <- main. + Called from PROJECT_FILE.i:461. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- search <- main. + Called from PROJECT_FILE.i:462. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:464. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- search <- main. + Called from PROJECT_FILE.i:465. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:467. +[value] computing for function printf <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- search <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] Recording results for search +[value] Done for function search +PROJECT_FILE.i:503:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:508. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:509. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:510. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:511. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:512. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:513. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function search: + __retres ∈ {0; 1} + k ∈ [0..10] + e_acsl_26 ∈ {0; 1} + e_acsl_42 ∈ {0; 1} +[value] Values at end of function main: + A[0..9] ∈ [0..81] + __retres ∈ {0} + found ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(z_orig); + requires \valid(z); + assigns *z; */ +extern void __gmpz_set(__mpz_struct * /*[1]*/ z, + __mpz_struct const * /*[1]*/ z_orig); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z); + assigns \nothing; */ +extern unsigned long __gmpz_get_ui(__mpz_struct const * /*[1]*/ z); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int A[10]; +/*@ requires ∀ ℤ i; 0 ≤ i ∧ i < 9 ⇒ A[i] ≤ A[i+1]; + behavior exists: + assumes ∃ ℤ j; (0 ≤ j ∧ j < 10) ∧ A[j] ≡ elt; + ensures \result ≡ 1; + + behavior not_exists: + assumes ∀ ℤ j; 0 ≤ j ∧ j < 10 ⇒ A[j] ≢ elt; + ensures \result ≡ 0; + + +*/ +int search(int elt) +{ + int __retres; + int k; + int e_acsl_26; + int e_acsl_42; + { + int e_acsl_1; + mpz_t e_acsl_2; + e_acsl_1 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_2)); + { + mpz_t e_acsl_10; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + } + + while (1) { + { + mpz_t e_acsl_11; + int e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)9); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_11)); + if (! (e_acsl_12 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + { + unsigned long e_acsl_3; + mpz_t e_acsl_4; + mpz_t e_acsl_5; + mpz_t e_acsl_6; + unsigned long e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + e_acsl_3 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_2)); + /*@ assert e_acsl_3 < 10; + // synthesized + */ + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)A[e_acsl_3]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_6)); + __gmpz_add((__mpz_struct *)(e_acsl_6), + (__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_6)); + /*@ assert e_acsl_7 < 10; + // synthesized + */ + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)A[e_acsl_7]); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_6)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + if (! (e_acsl_9 <= 0)) { + e_acsl_1 = 0; + goto e_acsl_end_loop1; } + } + + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_14)); + __gmpz_add((__mpz_struct *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_13)); + __gmpz_set((__mpz_struct *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + } + + } + e_acsl_end_loop1: ; + e_acsl_assert(! e_acsl_1,(char *)"Precondition", + (char *)"(\\forall integer i; 0 <= i && i < 9 ==> A[i] <= A[i+1])", + 9); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + { + int e_acsl_31; + mpz_t e_acsl_32; + e_acsl_31 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_32)); + { + mpz_t e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_37),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_37)); + __gmpz_clear((__mpz_struct *)(e_acsl_37)); + } + + while (1) { + { + mpz_t e_acsl_38; + int e_acsl_39; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)10); + e_acsl_39 = __gmpz_cmp((__mpz_struct const *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_38)); + if (! (e_acsl_39 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + } + + { + unsigned long e_acsl_33; + mpz_t e_acsl_34; + mpz_t e_acsl_35; + int e_acsl_36; + e_acsl_33 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_32)); + /*@ assert e_acsl_33 < 10; + // synthesized + */ + __gmpz_init_set_si((__mpz_struct *)(e_acsl_34),(long)A[e_acsl_33]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)elt); + e_acsl_36 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + if (! (e_acsl_36 != 0)) { + e_acsl_31 = 0; + goto e_acsl_end_loop3; } + } + + { + mpz_t e_acsl_40; + mpz_t e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_40),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + __gmpz_add((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_40)); + __gmpz_set((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_40)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + } + + } + e_acsl_end_loop3: ; + e_acsl_42 = e_acsl_31; + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + { + int e_acsl_15; + mpz_t e_acsl_16; + e_acsl_15 = 0; + __gmpz_init((__mpz_struct *)(e_acsl_16)); + { + mpz_t e_acsl_21; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + } + + while (1) { + { + mpz_t e_acsl_22; + int e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)10); + e_acsl_23 = __gmpz_cmp((__mpz_struct const *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_22)); + if (! (e_acsl_23 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + } + + { + unsigned long e_acsl_17; + mpz_t e_acsl_18; + mpz_t e_acsl_19; + int e_acsl_20; + e_acsl_17 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_16)); + /*@ assert e_acsl_17 < 10; + // synthesized + */ + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)A[e_acsl_17]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)elt); + e_acsl_20 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + if (! (! (e_acsl_20 == 0))) { + e_acsl_15 = 1; + goto e_acsl_end_loop2; } + } + + { + mpz_t e_acsl_24; + mpz_t e_acsl_25; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_24),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_25)); + __gmpz_add((__mpz_struct *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_24)); + __gmpz_set((__mpz_struct *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_25)); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + } + + } + e_acsl_end_loop2: ; + e_acsl_26 = e_acsl_15; + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + } + + k = 0; + } + + while (1) { + if (! (k < 10)) { break; } + if (A[k] == elt) { + __retres = 1; + goto return_label; } + else { + if (A[k] > elt) { + __retres = 0; + goto return_label; } } + k ++; + } + __retres = 0; + return_label: + { + int e_acsl_30; + int e_acsl_46; + if (! e_acsl_26) { e_acsl_30 = 1; } + else { + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)__retres); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_28),(long)1); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_27), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_30 = e_acsl_29 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + e_acsl_assert(! e_acsl_30,(char *)"Postcondition", + (char *)"(\\old(\\exists integer j; (0 <= j && j < 10) && A[j] == elt) ==> \\result == 1)", + 12); + if (! e_acsl_42) { e_acsl_46 = 1; } + else { + mpz_t e_acsl_43; + mpz_t e_acsl_44; + int e_acsl_45; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_43),(long)__retres); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)0); + e_acsl_45 = __gmpz_cmp((__mpz_struct const *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_44)); + e_acsl_46 = e_acsl_45 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + } + e_acsl_assert(! e_acsl_46,(char *)"Postcondition", + (char *)"(\\old(\\forall integer j; 0 <= j && j < 10 ==> A[j] != elt) ==> \\result == 0)", + 15); + return (__retres); + } + +} + +int main(void) +{ + int __retres; + int found; + { int i; + i = 0; + while (1) { + if (! (i < 10)) { break; } + A[i] = i * i; + i ++; } } + + found = search(36); + /*@ assert found ≡ 1; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)found); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)1); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"(found == 1)",31); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + found = search(5); + /*@ assert found ≡ 0; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)found); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)0); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(found == 0)",34); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.res.oracle index 41a1c8f6cc9..7f9a92c4ffd 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/linear_search.res.oracle @@ -1,7 +1,7 @@ -tests/e-acsl-runtime/linear_search.i:8:[e-acsl] warning: missing guard for ensuring that i is a valid array index -tests/e-acsl-runtime/linear_search.i:8:[e-acsl] warning: missing guard for ensuring that i+1 is a valid array index -tests/e-acsl-runtime/linear_search.i:10:[e-acsl] warning: missing guard for ensuring that j is a valid array index -tests/e-acsl-runtime/linear_search.i:13:[e-acsl] warning: missing guard for ensuring that j is a valid array index +tests/e-acsl-runtime/linear_search.i:9:[e-acsl] warning: missing guard for ensuring that i is a valid array index +tests/e-acsl-runtime/linear_search.i:9:[e-acsl] warning: missing guard for ensuring that i+1 is a valid array index +tests/e-acsl-runtime/linear_search.i:11:[e-acsl] warning: missing guard for ensuring that j is a valid array index +tests/e-acsl-runtime/linear_search.i:14:[e-acsl] warning: missing guard for ensuring that j is a valid array index [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed @@ -161,7 +161,7 @@ int search(int elt) e_acsl_end_loop1: ; e_acsl_assert(! e_acsl_1,(char *)"Precondition", (char *)"(\\forall int i; 0 <= i && i < 9 ==> A[i] <= A[i+1])", - 8); + 9); { int e_acsl_7; int e_acsl_8; @@ -217,12 +217,12 @@ int search(int elt) else { e_acsl_6 = __retres == 1; } e_acsl_assert(! e_acsl_6,(char *)"Postcondition", (char *)"(\\old(\\exists int j; (0 <= j && j < 10) && A[j] == elt) ==> \\result == 1)", - 11); + 12); if (! e_acsl_9) { e_acsl_10 = 1; } else { e_acsl_10 = __retres == 0; } e_acsl_assert(! e_acsl_10,(char *)"Postcondition", (char *)"(\\old(\\forall int j; 0 <= j && j < 10 ==> A[j] != elt) ==> \\result == 0)", - 14); + 15); return (__retres); } @@ -241,10 +241,10 @@ int main(void) found = search(36); /*@ assert found ≡ 1; */ ; - e_acsl_assert(! (found == 1),(char *)"Assertion",(char *)"(found == 1)",30); + e_acsl_assert(! (found == 1),(char *)"Assertion",(char *)"(found == 1)",31); found = search(5); /*@ assert found ≡ 0; */ ; - e_acsl_assert(! (found == 0),(char *)"Assertion",(char *)"(found == 0)",33); + e_acsl_assert(! (found == 0),(char *)"Assertion",(char *)"(found == 0)",34); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.res.oracle new file mode 100644 index 00000000000..0b07fc31ec5 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.1.res.oracle @@ -0,0 +1,359 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:232:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:240. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:241. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:257. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:258. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:259. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:261. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:278. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:279. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:281. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:282. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:283. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:287. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:288. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:289. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:290. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:292. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:306. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:307. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:308. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:309. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:310. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:311. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:315. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:316. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:318. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:319. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:320. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:332. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:333. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:334. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:335. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:336. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:337. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {2} + y ∈ {1} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + x = 0; + y = 1; + /*@ assert x < y; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 < 0),(char *)"Assertion",(char *)"(x < y)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ requires x ≡ 0; + ensures x ≥ 1; */ + { + mpz_t e_acsl_19; + mpz_t e_acsl_20; + int e_acsl_21; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)0); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Precondition", + (char *)"(x == 0)",10); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + if (x) { + /*@ assert \false; */ ; + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",13); + } + else { + /*@ requires x ≡ 0; + ensures x ≡ 1; */ + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + int e_acsl_12; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Precondition", + (char *)"(x == 0)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + x ++; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)1); + e_acsl_12 = __gmpz_cmp((__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + e_acsl_assert(! (e_acsl_12 == 0),(char *)"Postcondition", + (char *)"(x == 1)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + } + + if (x) { + /*@ requires x ≡ 1; + ensures x ≡ 2; */ + { + mpz_t e_acsl_16; + mpz_t e_acsl_17; + int e_acsl_18; + { + mpz_t e_acsl_13; + mpz_t e_acsl_14; + int e_acsl_15; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)1); + e_acsl_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + e_acsl_assert(! (e_acsl_15 == 0),(char *)"Precondition", + (char *)"(x == 1)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + x ++; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_17),(long)2); + e_acsl_18 = __gmpz_cmp((__mpz_struct const *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_17)); + e_acsl_assert(! (e_acsl_18 == 0),(char *)"Postcondition", + (char *)"(x == 2)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + } + + } + else { + /*@ assert \false; */ ; + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",23); + } + } + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)1); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_20)); + e_acsl_assert(! (e_acsl_21 >= 0),(char *)"Postcondition", + (char *)"(x >= 1)",11); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.res.oracle index c514c0e8536..bf7628192eb 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/nested_code_annot.res.oracle @@ -64,24 +64,24 @@ int main(void) x = 0; y = 1; /*@ assert x < y; */ ; - e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",8); + e_acsl_assert(! (x < y),(char *)"Assertion",(char *)"(x < y)",9); /*@ requires x ≡ 0; ensures x ≥ 1; */ { - e_acsl_assert(! (x == 0),(char *)"Precondition",(char *)"(x == 0)",9); + e_acsl_assert(! (x == 0),(char *)"Precondition",(char *)"(x == 0)",10); if (x) { /*@ assert \false; */ ; - e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",12); + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",13); } else { /*@ requires x ≡ 0; ensures x ≡ 1; */ { e_acsl_assert(! (x == 0),(char *)"Precondition",(char *)"(x == 0)", - 14); + 15); x ++; e_acsl_assert(! (x == 1),(char *)"Postcondition",(char *)"(x == 1)", - 15); + 16); } if (x) { @@ -89,19 +89,19 @@ int main(void) ensures x ≡ 2; */ { e_acsl_assert(! (x == 1),(char *)"Precondition",(char *)"(x == 1)", - 18); + 19); x ++; e_acsl_assert(! (x == 2),(char *)"Postcondition", - (char *)"(x == 2)",19); + (char *)"(x == 2)",20); } } else { /*@ assert \false; */ ; - e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",22); + e_acsl_assert(1,(char *)"Assertion",(char *)"(\\false)",23); } } - e_acsl_assert(! (x >= 1),(char *)"Postcondition",(char *)"(x >= 1)",10); + e_acsl_assert(! (x >= 1),(char *)"Postcondition",(char *)"(x >= 1)",11); } __retres = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.res.oracle new file mode 100644 index 00000000000..3429f7fd6c8 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.1.res.oracle @@ -0,0 +1,119 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:230:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:235. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:236. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:238. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:240. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert x ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(x == 0)",8); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + if (x) { + /*@ assert x ≢ 0; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)0); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 != 0),(char *)"Assertion",(char *)"(x != 0)", + 9); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + } + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle index c705a23eac1..180e1b5bc29 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/not.res.oracle @@ -37,10 +37,10 @@ int main(void) int x; x = 0; /*@ assert x ≡ 0; */ ; - e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",7); + e_acsl_assert(! (x == 0),(char *)"Assertion",(char *)"(x == 0)",8); if (x) { /*@ assert x ≢ 0; */ ; - e_acsl_assert(! (x != 0),(char *)"Assertion",(char *)"(x != 0)",8); + e_acsl_assert(! (x != 0),(char *)"Assertion",(char *)"(x != 0)",9); } __retres = 0; return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.res.oracle new file mode 100644 index 00000000000..bcb43009873 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.1.res.oracle @@ -0,0 +1,43 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:228:[value] Assertion got status unknown. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:229. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + /*@ assert \null ≡ (void *)0; */ ; + e_acsl_assert(! ((void *)0 == (void *)0),(char *)"Assertion", + (char *)"(\\null == (void *)0)",8); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.res.oracle index ee3a88ffc98..bcb43009873 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/null.res.oracle @@ -35,7 +35,7 @@ int main(void) int __retres; /*@ assert \null ≡ (void *)0; */ ; e_acsl_assert(! ((void *)0 == (void *)0),(char *)"Assertion", - (char *)"(\\null == (void *)0)",7); + (char *)"(\\null == (void *)0)",8); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.res.oracle new file mode 100644 index 00000000000..89d37c1f96e --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.1.res.oracle @@ -0,0 +1,144 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:232:[value] Assertion got status unknown. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:233. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +PROJECT_FILE.i:235:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:239. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:241. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:246:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:253. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:254. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +enum bool { + false = 0, + true = 1 +}; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + /*@ assert "toto" ≢ "titi"; */ ; + e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", + (char *)"(\"toto\" != \"titi\")",10); + /*@ assert 'c' ≡ 'c'; */ ; + { + mpz_t e_acsl_1; + int e_acsl_2; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)'c'); + e_acsl_2 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_1)); + e_acsl_assert(! (e_acsl_2 == 0),(char *)"Assertion", + (char *)"(\'c\' == \'c\')",11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + } + + /*@ assert false ≢ true; */ ; + { + mpz_t e_acsl_3; + mpz_t e_acsl_4; + int e_acsl_5; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)false); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)true); + e_acsl_5 = __gmpz_cmp((__mpz_struct const *)(e_acsl_3), + (__mpz_struct const *)(e_acsl_4)); + e_acsl_assert(! (e_acsl_5 != 0),(char *)"Assertion", + (char *)"(false != true)",12); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.res.oracle index 5d414937d5a..b534280c88d 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/other_constants.res.oracle @@ -49,13 +49,13 @@ int main(void) int __retres; /*@ assert "toto" ≢ "titi"; */ ; e_acsl_assert(! ("toto" != "titi"),(char *)"Assertion", - (char *)"(\"toto\" != \"titi\")",9); + (char *)"(\"toto\" != \"titi\")",10); /*@ assert 'c' ≡ 'c'; */ ; e_acsl_assert(! ('c' == 'c'),(char *)"Assertion", - (char *)"(\'c\' == \'c\')",10); + (char *)"(\'c\' == \'c\')",11); /*@ assert false ≢ true; */ ; e_acsl_assert(! (false != true),(char *)"Assertion", - (char *)"(false != true)",11); + (char *)"(false != true)",12); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.res.oracle new file mode 100644 index 00000000000..ab7cfca5ead --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.1.res.oracle @@ -0,0 +1,820 @@ +tests/e-acsl-runtime/ptr.i:13:[e-acsl] warning: missing guard for ensuring that p is a valid memory access +:0:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index +tests/e-acsl-runtime/ptr.i:15:[e-acsl] warning: missing guard for ensuring that 2 is a valid array index +tests/e-acsl-runtime/ptr.i:16:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +:0:[e-acsl] warning: missing guard for ensuring that + (2*sizeof(int))/sizeof((int)0x0) is a valid array index +tests/e-acsl-runtime/ptr.i:19:[e-acsl] warning: missing guard for ensuring that i is a valid array index +tests/e-acsl-runtime/ptr.i:20:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +:0:[e-acsl] warning: missing guard for ensuring that 2-i is a valid array index +tests/e-acsl-runtime/ptr.i:21:[e-acsl] warning: missing guard for ensuring that 2 is a valid array index +tests/e-acsl-runtime/ptr.i:21:[e-acsl] warning: missing guard for ensuring that &t[2]-i is a valid pointer +tests/e-acsl-runtime/ptr.i:21:[e-acsl] warning: missing guard for ensuring that &t[2]-i is a valid memory access +tests/e-acsl-runtime/ptr.i:27:[e-acsl] warning: missing guard for ensuring that p is a valid memory access +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:236:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:241. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:242. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:243. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:244. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:245. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:246. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:250:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:257. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:258. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:264:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:269. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:272. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:278:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:292. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:293. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_mul <- main. + Called from PROJECT_FILE.i:294. +PROJECT_FILE.i:150:[value] Function __gmpz_mul: precondition got status valid. +PROJECT_FILE.i:151:[value] Function __gmpz_mul: precondition got status valid. +PROJECT_FILE.i:152:[value] Function __gmpz_mul: precondition got status valid. +[value] Done for function __gmpz_mul +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:295. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:297. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:298. +[value] Done for function __gmpz_init +PROJECT_FILE.i:299:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:300. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_q <- main. + Called from PROJECT_FILE.i:301. +PROJECT_FILE.i:156:[value] Function __gmpz_tdiv_q: precondition got status valid. +PROJECT_FILE.i:157:[value] Function __gmpz_tdiv_q: precondition got status valid. +PROJECT_FILE.i:158:[value] Function __gmpz_tdiv_q: precondition got status valid. +[value] Done for function __gmpz_tdiv_q +[value] computing for function __gmpz_get_ui <- main. + Called from PROJECT_FILE.i:302. +PROJECT_FILE.i:176:[value] Function __gmpz_get_ui: precondition got status valid. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:303:[kernel] warning: accessing out of bounds index [0..4294967295]. assert e_acsl_17 < 3; +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:304. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:305. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:306. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:308. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:309. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:310. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:311. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:312. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:313. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:314. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:315. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:322:[value] entering loop for the first time +PROJECT_FILE.i:325:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:332. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:333. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:334. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:335. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:336. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:337. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:338. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:339. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:340. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:342. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:346:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:356. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:358. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:359. +PROJECT_FILE.i:144:[value] Function __gmpz_sub: precondition got status valid. +PROJECT_FILE.i:145:[value] Function __gmpz_sub: precondition got status valid. +PROJECT_FILE.i:146:[value] Function __gmpz_sub: precondition got status valid. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_get_ui <- main. + Called from PROJECT_FILE.i:360. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:361:[kernel] warning: accessing out of bounds index [0..4294967295]. assert e_acsl_29 < 3; +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:361. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:362. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:363. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:364. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:365. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:366. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:367. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:370. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:371. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:372. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:376:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:384. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:385. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:386. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:387. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:388. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:389. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:391. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:392. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:393. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:394. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:325:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:332. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:333. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:334. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:335. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:336. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:337. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:338. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:339. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:340. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:342. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:346:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:356. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:358. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:359. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_get_ui <- main. + Called from PROJECT_FILE.i:360. +[value] Done for function __gmpz_get_ui +PROJECT_FILE.i:361:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:361. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:362. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:363. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:364. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:365. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:366. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:367. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:370. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:371. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:372. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:376:[value] Assertion got status unknown. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:383. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:384. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:385. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:386. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- main. + Called from PROJECT_FILE.i:387. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:388. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:389. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:391. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:392. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:393. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:394. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:398:[value] assigning non deterministic value for the first time +PROJECT_FILE.i:404:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:409. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:410. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:411. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:412. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:413. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:414. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {1} + t[0] ∈ {2} + [1] ∈ {3} + [2] ∈ {5} + p ∈ {{ &t + {8} }} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z); + assigns \nothing; */ +extern unsigned long __gmpz_get_ui(__mpz_struct const * /*[1]*/ z); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int t[3]; + int *p; + x = 1; + t[0] = 2; + t[1] = 3; + t[2] = 4; + p = & x; + /*@ assert *p ≡ 1; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)*p); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)1); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(*p == 1)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert t[0] ≡ 2; */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)t[0]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)2); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(t[0] == 2)",14); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + /*@ assert t[2] ≡ 4; */ ; + { + mpz_t e_acsl_7; + mpz_t e_acsl_8; + int e_acsl_9; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)t[2]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)4); + e_acsl_9 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_8)); + e_acsl_assert(! (e_acsl_9 == 0),(char *)"Assertion", + (char *)"(t[2] == 4)",15); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + /*@ assert t[(2*sizeof(int))/sizeof((int)0x0)] ≡ 4; */ ; + { + mpz_t e_acsl_10; + mpz_t e_acsl_11; + mpz_t e_acsl_12; + mpz_t e_acsl_13; + mpz_t e_acsl_14; + int e_acsl_15; + mpz_t e_acsl_16; + unsigned long e_acsl_17; + mpz_t e_acsl_18; + mpz_t e_acsl_19; + int e_acsl_20; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_12)); + __gmpz_mul((__mpz_struct *)(e_acsl_12),(__mpz_struct const *)(e_acsl_10), + (__mpz_struct const *)(e_acsl_11)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_14),(long)0); + e_acsl_15 = __gmpz_cmp((__mpz_struct const *)(e_acsl_13), + (__mpz_struct const *)(e_acsl_14)); + __gmpz_init((__mpz_struct *)(e_acsl_16)); + /*@ assert sizeof((int)0x0) ≢ 0; */ ; + e_acsl_assert(e_acsl_15 == 0,(char *)"Assertion", + (char *)"(sizeof((int)0x0) == 0)",16); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_16), + (__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + e_acsl_17 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_16)); + /*@ assert e_acsl_17 < 3; + // synthesized + */ + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)t[e_acsl_17]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)4); + e_acsl_20 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + e_acsl_assert(! (e_acsl_20 == 0),(char *)"Assertion", + (char *)"(t[(2*sizeof(int))/sizeof((int)0x0)] == 4)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + } + + { + int i; + i = 0; + while (1) { + if (! (i < 2)) { break; } + /*@ assert t[i] ≡ i+2; */ ; + { + mpz_t e_acsl_21; + mpz_t e_acsl_22; + mpz_t e_acsl_23; + mpz_t e_acsl_24; + int e_acsl_25; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)t[i]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)i); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_23),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_24)); + __gmpz_add((__mpz_struct *)(e_acsl_24), + (__mpz_struct const *)(e_acsl_22), + (__mpz_struct const *)(e_acsl_23)); + e_acsl_25 = __gmpz_cmp((__mpz_struct const *)(e_acsl_21), + (__mpz_struct const *)(e_acsl_24)); + e_acsl_assert(! (e_acsl_25 == 0),(char *)"Assertion", + (char *)"(t[i] == i+2)",19); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + __gmpz_clear((__mpz_struct *)(e_acsl_24)); + } + + /*@ assert t[2-i] ≡ 4-i; */ ; + { + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + unsigned long e_acsl_29; + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_26),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)i); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_sub((__mpz_struct *)(e_acsl_28), + (__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_27)); + e_acsl_29 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_28)); + /*@ assert e_acsl_29 < 3; + // synthesized + */ + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)t[e_acsl_29]); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)4); + __gmpz_init((__mpz_struct *)(e_acsl_32)); + __gmpz_sub((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_31), + (__mpz_struct const *)(e_acsl_27)); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_assert(! (e_acsl_33 == 0),(char *)"Assertion", + (char *)"(t[2-i] == 4-i)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + /*@ assert *(&t[2]-i) ≡ 4-i; */ ; + { + mpz_t e_acsl_34; + mpz_t e_acsl_35; + mpz_t e_acsl_36; + mpz_t e_acsl_37; + int e_acsl_38; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_34), + (long)*(& t[2] - (long)i)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_36),(long)i); + __gmpz_init((__mpz_struct *)(e_acsl_37)); + __gmpz_sub((__mpz_struct *)(e_acsl_37), + (__mpz_struct const *)(e_acsl_35), + (__mpz_struct const *)(e_acsl_36)); + e_acsl_38 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_37)); + e_acsl_assert(! (e_acsl_38 == 0),(char *)"Assertion", + (char *)"(*(&t[2]-i) == 4-i)",21); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_36)); + __gmpz_clear((__mpz_struct *)(e_acsl_37)); + } + + i ++; + } + } + + p = & t[2]; + t[2] = 5; + /*@ assert *p ≡ 5; */ ; + { + mpz_t e_acsl_39; + mpz_t e_acsl_40; + int e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_39),(long)*p); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_40),(long)5); + e_acsl_41 = __gmpz_cmp((__mpz_struct const *)(e_acsl_39), + (__mpz_struct const *)(e_acsl_40)); + e_acsl_assert(! (e_acsl_41 == 0),(char *)"Assertion",(char *)"(*p == 5)", + 27); + __gmpz_clear((__mpz_struct *)(e_acsl_39)); + __gmpz_clear((__mpz_struct *)(e_acsl_40)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.res.oracle index 4e9083aa159..c849ec395a2 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/ptr.res.oracle @@ -1,14 +1,14 @@ -tests/e-acsl-runtime/ptr.i:12:[e-acsl] warning: missing guard for ensuring that p is a valid memory access +tests/e-acsl-runtime/ptr.i:13:[e-acsl] warning: missing guard for ensuring that p is a valid memory access :0:[e-acsl] warning: missing guard for ensuring that 0 is a valid array index -tests/e-acsl-runtime/ptr.i:14:[e-acsl] warning: missing guard for ensuring that 2 is a valid array index +tests/e-acsl-runtime/ptr.i:15:[e-acsl] warning: missing guard for ensuring that 2 is a valid array index :0:[e-acsl] warning: missing guard for ensuring that (2*sizeof(int))/sizeof((int)0x0) is a valid array index -tests/e-acsl-runtime/ptr.i:18:[e-acsl] warning: missing guard for ensuring that i is a valid array index -tests/e-acsl-runtime/ptr.i:19:[e-acsl] warning: missing guard for ensuring that 2-i is a valid array index -tests/e-acsl-runtime/ptr.i:20:[e-acsl] warning: missing guard for ensuring that 2 is a valid array index -tests/e-acsl-runtime/ptr.i:20:[e-acsl] warning: missing guard for ensuring that &t[2]-i is a valid pointer -tests/e-acsl-runtime/ptr.i:20:[e-acsl] warning: missing guard for ensuring that &t[2]-i is a valid memory access -tests/e-acsl-runtime/ptr.i:26:[e-acsl] warning: missing guard for ensuring that p is a valid memory access +tests/e-acsl-runtime/ptr.i:19:[e-acsl] warning: missing guard for ensuring that i is a valid array index +tests/e-acsl-runtime/ptr.i:20:[e-acsl] warning: missing guard for ensuring that 2-i is a valid array index +tests/e-acsl-runtime/ptr.i:21:[e-acsl] warning: missing guard for ensuring that 2 is a valid array index +tests/e-acsl-runtime/ptr.i:21:[e-acsl] warning: missing guard for ensuring that &t[2]-i is a valid pointer +tests/e-acsl-runtime/ptr.i:21:[e-acsl] warning: missing guard for ensuring that &t[2]-i is a valid memory access +tests/e-acsl-runtime/ptr.i:27:[e-acsl] warning: missing guard for ensuring that p is a valid memory access [value] Analyzing a complete application starting at main [value] Computing initial state [value] Initial state computed @@ -134,20 +134,20 @@ int main(void) t[2] = 4; p = & x; /*@ assert *p ≡ 1; */ ; - e_acsl_assert(! (*p == 1),(char *)"Assertion",(char *)"(*p == 1)",12); + e_acsl_assert(! (*p == 1),(char *)"Assertion",(char *)"(*p == 1)",13); /*@ assert t[0] ≡ 2; */ ; - e_acsl_assert(! (t[0] == 2),(char *)"Assertion",(char *)"(t[0] == 2)",13); + e_acsl_assert(! (t[0] == 2),(char *)"Assertion",(char *)"(t[0] == 2)",14); /*@ assert t[2] ≡ 4; */ ; - e_acsl_assert(! (t[2] == 4),(char *)"Assertion",(char *)"(t[2] == 4)",14); + e_acsl_assert(! (t[2] == 4),(char *)"Assertion",(char *)"(t[2] == 4)",15); /*@ assert t[(2*sizeof(int))/sizeof((int)0x0)] ≡ 4; */ ; { int e_acsl_1; /*@ assert sizeof((int)0x0) ≢ 0; */ ; e_acsl_assert(4 == 0,(char *)"Assertion", - (char *)"(sizeof((int)0x0) == 0)",15); + (char *)"(sizeof((int)0x0) == 0)",16); e_acsl_1 = (2 * 4) / 4; e_acsl_assert(! (t[e_acsl_1] == 4),(char *)"Assertion", - (char *)"(t[(2*sizeof(int))/sizeof((int)0x0)] == 4)",15); + (char *)"(t[(2*sizeof(int))/sizeof((int)0x0)] == 4)",16); } { @@ -157,13 +157,13 @@ int main(void) if (! (i < 2)) { break; } /*@ assert t[i] ≡ i+2; */ ; e_acsl_assert(! ((long long)t[i] == (long long)i + (long long)2), - (char *)"Assertion",(char *)"(t[i] == i+2)",18); + (char *)"Assertion",(char *)"(t[i] == i+2)",19); /*@ assert t[2-i] ≡ 4-i; */ ; e_acsl_assert(! ((long long)t[(long long)2 - (long long)i] == (long long)4 - (long long)i), - (char *)"Assertion",(char *)"(t[2-i] == 4-i)",19); + (char *)"Assertion",(char *)"(t[2-i] == 4-i)",20); /*@ assert *(&t[2]-i) ≡ 4-i; */ ; e_acsl_assert(! ((long long)*(& t[2] - i) == (long long)4 - (long long)i), - (char *)"Assertion",(char *)"(*(&t[2]-i) == 4-i)",20); + (char *)"Assertion",(char *)"(*(&t[2]-i) == 4-i)",21); i ++; } } @@ -171,7 +171,7 @@ int main(void) p = & t[2]; t[2] = 5; /*@ assert *p ≡ 5; */ ; - e_acsl_assert(! (*p == 5),(char *)"Assertion",(char *)"(*p == 5)",26); + e_acsl_assert(! (*p == 5),(char *)"Assertion",(char *)"(*p == 5)",27); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.res.oracle new file mode 100644 index 00000000000..94e1ff86ff6 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.1.res.oracle @@ -0,0 +1,1413 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:228:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:233. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:236. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:94:[value] Function __gmpz_set: precondition got status valid. +PROJECT_FILE.i:95:[value] Function __gmpz_set: precondition got status valid. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:241:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:245. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:246. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:248. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:261. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_cmp +PROJECT_FILE.i:263:[value] assigning non deterministic value for the first time +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:264. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:277. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:278. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:279. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:280. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:281. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:286. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:289. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:293:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:298. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:303. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:304. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:305. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:306. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:307. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:308. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:309. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:310. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:313:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:317. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:318. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:320. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:326. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:327. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:328. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:338. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:339. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:340. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:342. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:343. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:348. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:350. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:354:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:359. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:364. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:365. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:366. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:367. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:370. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:371. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:374:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:378. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:379. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:381. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:401. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:403. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:407:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:412. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:415. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:416. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:417. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:420:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:424. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:425. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:427. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:433. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:434. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:435. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:446. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:447. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:448. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:449. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:450. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:455. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:457. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:461:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:471. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:472. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:473. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:476. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:477. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:478. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:481:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:485. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:486. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:488. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:493. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:494. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:495. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:498:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:502. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:503. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:505. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:510. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:569. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:511. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:570. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:512. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:571. +[value] Done for function __gmpz_add +PROJECT_FILE.i:515:[value] entering loop for the first time +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:572. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:573. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:574. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:518. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:527. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:528. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:557. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:529. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:558. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:530. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:559. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:531. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:560. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:532. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:561. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:533. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:562. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:534. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:535. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:545. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:546. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:547. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:548. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:549. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:550. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:579. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:582. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:583. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:584. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:588:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:593. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:596. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:597. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:598. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:601:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:605. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:606. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:608. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:614. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:615. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:616. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:626. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:627. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:628. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:629. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:630. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:631. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:636. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:638. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:642:[value] Assertion got status unknown. +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:649. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:652. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:653. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:654. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:657:[value] entering loop for the first time +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:661. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:662. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:664. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:674. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:675. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:676. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:677. +[value] Done for function __gmpz_init +PROJECT_FILE.i:678:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:679. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_r <- main. + Called from PROJECT_FILE.i:680. +PROJECT_FILE.i:162:[value] Function __gmpz_tdiv_r: precondition got status valid. +PROJECT_FILE.i:163:[value] Function __gmpz_tdiv_r: precondition got status valid. +PROJECT_FILE.i:164:[value] Function __gmpz_tdiv_r: precondition got status valid. +[value] Done for function __gmpz_tdiv_r +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:681. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:749. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:687. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:750. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:751. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:690. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:691. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:692. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:761. +[value] Done for function __gmpz_init_set_si +PROJECT_FILE.i:695:[value] entering loop for the first time +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:762. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:763. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:764. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:702. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:765. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:703. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:766. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:704. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:705. +[value] Done for function __gmpz_init +PROJECT_FILE.i:706:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:707. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_tdiv_q <- main. + Called from PROJECT_FILE.i:708. +PROJECT_FILE.i:156:[value] Function __gmpz_tdiv_q: precondition got status valid. +PROJECT_FILE.i:157:[value] Function __gmpz_tdiv_q: precondition got status valid. +PROJECT_FILE.i:158:[value] Function __gmpz_tdiv_q: precondition got status valid. +[value] Done for function __gmpz_tdiv_q +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:709. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:712. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:713. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:714. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:747. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:721. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:749. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:722. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:750. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_mul <- main. + Called from PROJECT_FILE.i:723. +PROJECT_FILE.i:150:[value] Function __gmpz_mul: precondition got status valid. +PROJECT_FILE.i:151:[value] Function __gmpz_mul: precondition got status valid. +PROJECT_FILE.i:152:[value] Function __gmpz_mul: precondition got status valid. +[value] Done for function __gmpz_mul +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:751. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:724. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:725. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:726. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:736. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:737. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:738. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_set <- main. + Called from PROJECT_FILE.i:739. +[value] Done for function __gmpz_set +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:747. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:740. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:741. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:771. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:774. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(z_orig); + requires \valid(z); + assigns *z; */ +extern void __gmpz_set(__mpz_struct * /*[1]*/ z, + __mpz_struct const * /*[1]*/ z_orig); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_mul(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_q(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_tdiv_r(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + /*@ assert ∀ ℤ x; 0 ≤ x ∧ x ≤ 1 ⇒ x ≡ 0 ∨ x ≡ 1; */ ; + { + int e_acsl_1; + mpz_t e_acsl_2; + e_acsl_1 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_2)); + { + mpz_t e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_8),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_2),(__mpz_struct const *)(e_acsl_8)); + __gmpz_clear((__mpz_struct *)(e_acsl_8)); + } + + while (1) { + { + mpz_t e_acsl_9; + int e_acsl_10; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)1); + e_acsl_10 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_9)); + if (! (e_acsl_10 <= 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + } + + { + mpz_t e_acsl_3; + int e_acsl_4; + int e_acsl_7; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)0); + e_acsl_4 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_3)); + if (e_acsl_4 == 0) { e_acsl_7 = 1; } + else { + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)1); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_7 = e_acsl_6 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + if (! e_acsl_7) { + e_acsl_1 = 0; + goto e_acsl_end_loop1; } + } + + { + mpz_t e_acsl_11; + mpz_t e_acsl_12; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_11),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_12)); + __gmpz_add((__mpz_struct *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_11)); + __gmpz_set((__mpz_struct *)(e_acsl_2), + (__mpz_struct const *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_11)); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + } + + } + e_acsl_end_loop1: ; + e_acsl_assert(! e_acsl_1,(char *)"Assertion", + (char *)"(\\forall integer x; 0 <= x && x <= 1 ==> x == 0 || x == 1)", + 11); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert ∀ ℤ x; 0 < x ∧ x ≤ 1 ⇒ x ≡ 1; */ ; + { + int e_acsl_13; + mpz_t e_acsl_14; + e_acsl_13 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_14)); + { + mpz_t e_acsl_17; + mpz_t e_acsl_18; + mpz_t e_acsl_19; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_17),(long)0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_19)); + __gmpz_add((__mpz_struct *)(e_acsl_19), + (__mpz_struct const *)(e_acsl_17), + (__mpz_struct const *)(e_acsl_18)); + __gmpz_set((__mpz_struct *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_17)); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + } + + while (1) { + { + mpz_t e_acsl_20; + int e_acsl_21; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_20),(long)1); + e_acsl_21 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_20)); + if (! (e_acsl_21 <= 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_20)); + } + + { + mpz_t e_acsl_15; + int e_acsl_16; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)1); + e_acsl_16 = __gmpz_cmp((__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + if (! (e_acsl_16 == 0)) { + e_acsl_13 = 0; + goto e_acsl_end_loop2; } + } + + { + mpz_t e_acsl_22; + mpz_t e_acsl_23; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_23)); + __gmpz_add((__mpz_struct *)(e_acsl_23), + (__mpz_struct const *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_22)); + __gmpz_set((__mpz_struct *)(e_acsl_14), + (__mpz_struct const *)(e_acsl_23)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + } + + } + e_acsl_end_loop2: ; + e_acsl_assert(! e_acsl_13,(char *)"Assertion", + (char *)"(\\forall integer x; 0 < x && x <= 1 ==> x == 1)", + 12); + __gmpz_clear((__mpz_struct *)(e_acsl_14)); + } + + /*@ assert ∀ ℤ x; 0 < x ∧ x < 1 ⇒ \false; */ ; + { + int e_acsl_24; + mpz_t e_acsl_25; + e_acsl_24 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_25)); + { + mpz_t e_acsl_26; + mpz_t e_acsl_27; + mpz_t e_acsl_28; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_26),(long)0); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_28)); + __gmpz_add((__mpz_struct *)(e_acsl_28), + (__mpz_struct const *)(e_acsl_26), + (__mpz_struct const *)(e_acsl_27)); + __gmpz_set((__mpz_struct *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_26)); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + } + + while (1) { + { + mpz_t e_acsl_29; + int e_acsl_30; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_29),(long)1); + e_acsl_30 = __gmpz_cmp((__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_29)); + if (! (e_acsl_30 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_29)); + } + + e_acsl_24 = 0; + goto e_acsl_end_loop3; + { + mpz_t e_acsl_31; + mpz_t e_acsl_32; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_32)); + __gmpz_add((__mpz_struct *)(e_acsl_32), + (__mpz_struct const *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_31)); + __gmpz_set((__mpz_struct *)(e_acsl_25), + (__mpz_struct const *)(e_acsl_32)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + } + e_acsl_end_loop3: ; + e_acsl_assert(! e_acsl_24,(char *)"Assertion", + (char *)"(\\forall integer x; 0 < x && x < 1 ==> \\false)", + 13); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + } + + /*@ assert ∀ ℤ x; 0 ≤ x ∧ x < 1 ⇒ x ≡ 0; */ ; + { + int e_acsl_33; + mpz_t e_acsl_34; + e_acsl_33 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_34)); + { + mpz_t e_acsl_37; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_37),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_37)); + __gmpz_clear((__mpz_struct *)(e_acsl_37)); + } + + while (1) { + { + mpz_t e_acsl_38; + int e_acsl_39; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)1); + e_acsl_39 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_38)); + if (! (e_acsl_39 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + } + + { + mpz_t e_acsl_35; + int e_acsl_36; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)0); + e_acsl_36 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + if (! (e_acsl_36 == 0)) { + e_acsl_33 = 0; + goto e_acsl_end_loop4; } + } + + { + mpz_t e_acsl_40; + mpz_t e_acsl_41; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_40),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_41)); + __gmpz_add((__mpz_struct *)(e_acsl_41), + (__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_40)); + __gmpz_set((__mpz_struct *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_41)); + __gmpz_clear((__mpz_struct *)(e_acsl_40)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + } + + } + e_acsl_end_loop4: ; + e_acsl_assert(! e_acsl_33,(char *)"Assertion", + (char *)"(\\forall integer x; 0 <= x && x < 1 ==> x == 0)", + 14); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + } + + /*@ + assert ∀ ℤ x, ℤ y, ℤ z; + ((0 ≤ x ∧ x < 2) ∧ (0 ≤ y ∧ y < 5)) ∧ (0 ≤ z ∧ z ≤ y) ⇒ + x+z ≤ y+1; */ ; + { + int e_acsl_42; + mpz_t e_acsl_43; + mpz_t e_acsl_44; + mpz_t e_acsl_45; + e_acsl_42 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_43)); + __gmpz_init((__mpz_struct *)(e_acsl_44)); + __gmpz_init((__mpz_struct *)(e_acsl_45)); + { + mpz_t e_acsl_59; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_59)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + } + + while (1) { + { + mpz_t e_acsl_60; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_60),(long)2); + e_acsl_61 = __gmpz_cmp((__mpz_struct const *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_60)); + if (! (e_acsl_61 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_60)); + } + + { + mpz_t e_acsl_54; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_54),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_54)); + __gmpz_clear((__mpz_struct *)(e_acsl_54)); + } + + while (1) { + { + mpz_t e_acsl_55; + int e_acsl_56; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_55),(long)5); + e_acsl_56 = __gmpz_cmp((__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_55)); + if (! (e_acsl_56 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_55)); + } + + { + mpz_t e_acsl_50; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_50),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_50)); + __gmpz_clear((__mpz_struct *)(e_acsl_50)); + } + + while (1) { + { + int e_acsl_51; + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_44)); + if (! (e_acsl_51 <= 0)) { break; } + } + + { + mpz_t e_acsl_46; + mpz_t e_acsl_47; + mpz_t e_acsl_48; + int e_acsl_49; + __gmpz_init((__mpz_struct *)(e_acsl_46)); + __gmpz_add((__mpz_struct *)(e_acsl_46), + (__mpz_struct const *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_45)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_47),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_48)); + __gmpz_add((__mpz_struct *)(e_acsl_48), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_47)); + e_acsl_49 = __gmpz_cmp((__mpz_struct const *)(e_acsl_46), + (__mpz_struct const *)(e_acsl_48)); + __gmpz_clear((__mpz_struct *)(e_acsl_46)); + __gmpz_clear((__mpz_struct *)(e_acsl_47)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + if (! (e_acsl_49 <= 0)) { + e_acsl_42 = 0; + goto e_acsl_end_loop5; } + } + + { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_53)); + __gmpz_add((__mpz_struct *)(e_acsl_53), + (__mpz_struct const *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_52)); + __gmpz_set((__mpz_struct *)(e_acsl_45), + (__mpz_struct const *)(e_acsl_53)); + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + } + + } + { + mpz_t e_acsl_57; + mpz_t e_acsl_58; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_57),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + __gmpz_add((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_57)); + __gmpz_set((__mpz_struct *)(e_acsl_44), + (__mpz_struct const *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_57)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + } + + } + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_63)); + __gmpz_add((__mpz_struct *)(e_acsl_63), + (__mpz_struct const *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_62)); + __gmpz_set((__mpz_struct *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_63)); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + } + + } + e_acsl_end_loop5: ; + e_acsl_assert(! e_acsl_42,(char *)"Assertion", + (char *)"(\\forall integer x, integer y, integer z;\n ((0 <= x && x < 2) && (0 <= y && y < 5)) && (0 <= z && z <= y) ==>\n x+z <= y+1)", + 18); + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + __gmpz_clear((__mpz_struct *)(e_acsl_45)); + } + + /*@ assert ∃ ℤ x; (0 ≤ x ∧ x < 10) ∧ x ≡ 5; */ ; + { + int e_acsl_64; + mpz_t e_acsl_65; + e_acsl_64 = 0; + __gmpz_init((__mpz_struct *)(e_acsl_65)); + { + mpz_t e_acsl_68; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_68)); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + } + + while (1) { + { + mpz_t e_acsl_69; + int e_acsl_70; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_69),(long)10); + e_acsl_70 = __gmpz_cmp((__mpz_struct const *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_69)); + if (! (e_acsl_70 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_69)); + } + + { + mpz_t e_acsl_66; + int e_acsl_67; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_66),(long)5); + e_acsl_67 = __gmpz_cmp((__mpz_struct const *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_66)); + __gmpz_clear((__mpz_struct *)(e_acsl_66)); + if (! (! (e_acsl_67 == 0))) { + e_acsl_64 = 1; + goto e_acsl_end_loop6; } + } + + { + mpz_t e_acsl_71; + mpz_t e_acsl_72; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_72)); + __gmpz_add((__mpz_struct *)(e_acsl_72), + (__mpz_struct const *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_71)); + __gmpz_set((__mpz_struct *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_72)); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + } + + } + e_acsl_end_loop6: ; + e_acsl_assert(! e_acsl_64,(char *)"Assertion", + (char *)"(\\exists integer x; (0 <= x && x < 10) && x == 5)", + 23); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + } + + /*@ + assert ∀ ℤ x; 0 ≤ x ∧ x < 10 ⇒ + (x%2 ≡ 0 ⇒ (∃ ℤ y; (0 ≤ y ∧ y ≤ x/2) ∧ x ≡ 2*y)); */ ; + { + int e_acsl_73; + mpz_t e_acsl_74; + e_acsl_73 = 1; + __gmpz_init((__mpz_struct *)(e_acsl_74)); + { + mpz_t e_acsl_94; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_94),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_94)); + __gmpz_clear((__mpz_struct *)(e_acsl_94)); + } + + while (1) { + { + mpz_t e_acsl_95; + int e_acsl_96; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_95),(long)10); + e_acsl_96 = __gmpz_cmp((__mpz_struct const *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_95)); + if (! (e_acsl_96 < 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_95)); + } + + { + mpz_t e_acsl_75; + mpz_t e_acsl_76; + int e_acsl_77; + mpz_t e_acsl_78; + int e_acsl_79; + int e_acsl_93; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_75),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_76),(long)0); + e_acsl_77 = __gmpz_cmp((__mpz_struct const *)(e_acsl_75), + (__mpz_struct const *)(e_acsl_76)); + __gmpz_init((__mpz_struct *)(e_acsl_78)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_77 == 0,(char *)"Assertion",(char *)"(2 == 0)", + 28); + __gmpz_tdiv_r((__mpz_struct *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_75)); + e_acsl_79 = __gmpz_cmp((__mpz_struct const *)(e_acsl_78), + (__mpz_struct const *)(e_acsl_76)); + if (! (e_acsl_79 == 0)) { e_acsl_93 = 1; } + else { + int e_acsl_80; + mpz_t e_acsl_81; + e_acsl_80 = 0; + __gmpz_init((__mpz_struct *)(e_acsl_81)); + { + mpz_t e_acsl_85; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_85),(long)0); + __gmpz_set((__mpz_struct *)(e_acsl_81), + (__mpz_struct const *)(e_acsl_85)); + __gmpz_clear((__mpz_struct *)(e_acsl_85)); + } + + while (1) { + { + mpz_t e_acsl_86; + mpz_t e_acsl_87; + int e_acsl_88; + mpz_t e_acsl_89; + int e_acsl_90; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_86),(long)2); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_87),(long)0); + e_acsl_88 = __gmpz_cmp((__mpz_struct const *)(e_acsl_86), + (__mpz_struct const *)(e_acsl_87)); + __gmpz_init((__mpz_struct *)(e_acsl_89)); + /*@ assert 2 ≢ 0; */ ; + e_acsl_assert(e_acsl_88 == 0,(char *)"Assertion", + (char *)"(2 == 0)",28); + __gmpz_tdiv_q((__mpz_struct *)(e_acsl_89), + (__mpz_struct const *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_86)); + e_acsl_90 = __gmpz_cmp((__mpz_struct const *)(e_acsl_81), + (__mpz_struct const *)(e_acsl_89)); + if (! (e_acsl_90 <= 0)) { break; } + __gmpz_clear((__mpz_struct *)(e_acsl_86)); + __gmpz_clear((__mpz_struct *)(e_acsl_87)); + __gmpz_clear((__mpz_struct *)(e_acsl_89)); + } + + { + mpz_t e_acsl_82; + mpz_t e_acsl_83; + int e_acsl_84; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_82),(long)2); + __gmpz_init((__mpz_struct *)(e_acsl_83)); + __gmpz_mul((__mpz_struct *)(e_acsl_83), + (__mpz_struct const *)(e_acsl_82), + (__mpz_struct const *)(e_acsl_81)); + e_acsl_84 = __gmpz_cmp((__mpz_struct const *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_83)); + __gmpz_clear((__mpz_struct *)(e_acsl_82)); + __gmpz_clear((__mpz_struct *)(e_acsl_83)); + if (! (! (e_acsl_84 == 0))) { + e_acsl_80 = 1; + goto e_acsl_end_loop7; + } + } + + { + mpz_t e_acsl_91; + mpz_t e_acsl_92; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_91),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_92)); + __gmpz_add((__mpz_struct *)(e_acsl_92), + (__mpz_struct const *)(e_acsl_81), + (__mpz_struct const *)(e_acsl_91)); + __gmpz_set((__mpz_struct *)(e_acsl_81), + (__mpz_struct const *)(e_acsl_92)); + __gmpz_clear((__mpz_struct *)(e_acsl_91)); + __gmpz_clear((__mpz_struct *)(e_acsl_92)); + } + + } + e_acsl_end_loop7: ; + e_acsl_93 = e_acsl_80; + __gmpz_clear((__mpz_struct *)(e_acsl_81)); + } + __gmpz_clear((__mpz_struct *)(e_acsl_75)); + __gmpz_clear((__mpz_struct *)(e_acsl_76)); + __gmpz_clear((__mpz_struct *)(e_acsl_78)); + if (! e_acsl_93) { + e_acsl_73 = 0; + goto e_acsl_end_loop8; } + } + + { + mpz_t e_acsl_97; + mpz_t e_acsl_98; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_97),(long)((char)1)); + __gmpz_init((__mpz_struct *)(e_acsl_98)); + __gmpz_add((__mpz_struct *)(e_acsl_98), + (__mpz_struct const *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_97)); + __gmpz_set((__mpz_struct *)(e_acsl_74), + (__mpz_struct const *)(e_acsl_98)); + __gmpz_clear((__mpz_struct *)(e_acsl_97)); + __gmpz_clear((__mpz_struct *)(e_acsl_98)); + } + + } + e_acsl_end_loop8: ; + e_acsl_assert(! e_acsl_73,(char *)"Assertion", + (char *)"(\\forall integer x; 0 <= x && x < 10 ==>\n (x%2 == 0 ==> (\\exists integer y; (0 <= y && y <= x/2) && x == 2*y)))", + 27); + __gmpz_clear((__mpz_struct *)(e_acsl_74)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.res.oracle index 59c72ba6cf5..61338efd3c8 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/quantif.res.oracle @@ -166,7 +166,7 @@ int main(void) e_acsl_end_loop1: ; e_acsl_assert(! e_acsl_1,(char *)"Assertion", (char *)"(\\forall int x; 0 <= x && x <= 1 ==> x == 0 || x == 1)", - 10); + 11); } /*@ assert ∀ int x; 0 < x ∧ x ≤ 1 ⇒ x ≡ 1; */ ; @@ -184,7 +184,7 @@ int main(void) } e_acsl_end_loop2: ; e_acsl_assert(! e_acsl_4,(char *)"Assertion", - (char *)"(\\forall int x; 0 < x && x <= 1 ==> x == 1)",11); + (char *)"(\\forall int x; 0 < x && x <= 1 ==> x == 1)",12); } /*@ assert ∀ int x; 0 < x ∧ x < 1 ⇒ \false; */ ; @@ -201,7 +201,7 @@ int main(void) } e_acsl_end_loop3: ; e_acsl_assert(! e_acsl_6,(char *)"Assertion", - (char *)"(\\forall int x; 0 < x && x < 1 ==> \\false)",12); + (char *)"(\\forall int x; 0 < x && x < 1 ==> \\false)",13); } /*@ assert ∀ int x; 0 ≤ x ∧ x < 1 ⇒ x ≡ 0; */ ; @@ -219,7 +219,7 @@ int main(void) } e_acsl_end_loop4: ; e_acsl_assert(! e_acsl_8,(char *)"Assertion", - (char *)"(\\forall int x; 0 <= x && x < 1 ==> x == 0)",13); + (char *)"(\\forall int x; 0 <= x && x < 1 ==> x == 0)",14); } /*@ @@ -254,7 +254,7 @@ int main(void) e_acsl_end_loop5: ; e_acsl_assert(! e_acsl_10,(char *)"Assertion", (char *)"(\\forall int x, int y, int z;\n ((0 <= x && x < 2) && (0 <= y && y < 5)) && (0 <= z && z <= y) ==>\n x+z <= y+1)", - 17); + 18); } /*@ assert ∃ int x; (0 ≤ x ∧ x < 10) ∧ x ≡ 5; */ ; @@ -273,7 +273,7 @@ int main(void) e_acsl_end_loop6: ; e_acsl_assert(! e_acsl_14,(char *)"Assertion", (char *)"(\\exists int x; (0 <= x && x < 10) && x == 5)", - 22); + 23); } /*@ @@ -290,7 +290,7 @@ int main(void) int e_acsl_18; int e_acsl_22; /*@ assert 2 ≢ 0; */ ; - e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",27); + e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",28); e_acsl_18 = e_acsl_17 % 2; if (! (e_acsl_18 == 0)) { e_acsl_22 = 1; } else { @@ -302,7 +302,7 @@ int main(void) { int e_acsl_21; /*@ assert 2 ≢ 0; */ ; - e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",27); + e_acsl_assert(2 == 0,(char *)"Assertion",(char *)"(2 == 0)",28); e_acsl_21 = e_acsl_17 / 2; if (! (e_acsl_20 <= e_acsl_21)) { break; } } @@ -326,7 +326,7 @@ int main(void) e_acsl_end_loop8: ; e_acsl_assert(! e_acsl_16,(char *)"Assertion", (char *)"(\\forall int x; 0 <= x && x < 10 ==>\n (x%2 == 0 ==> (\\exists int y; (0 <= y && y <= x/2) && x == 2*y)))", - 26); + 27); } __retres = 0; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.res.oracle new file mode 100644 index 00000000000..88ffb345df9 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.1.res.oracle @@ -0,0 +1,276 @@ +tests/e-acsl-runtime/result.i:7:[e-acsl] warning: missing guard for ensuring that the given integer is C-representable +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization + Y ∈ {1} +[value] computing for function f <- main. + Called from PROJECT_FILE.i:300. +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:241. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- f <- main. + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_sub <- f <- main. + Called from PROJECT_FILE.i:243. +PROJECT_FILE.i:144:[value] Function __gmpz_sub: precondition got status valid. +PROJECT_FILE.i:145:[value] Function __gmpz_sub: precondition got status valid. +PROJECT_FILE.i:146:[value] Function __gmpz_sub: precondition got status valid. +[value] Done for function __gmpz_sub +[value] computing for function __gmpz_get_ui <- f <- main. + Called from PROJECT_FILE.i:244. +PROJECT_FILE.i:176:[value] Function __gmpz_get_ui: precondition got status valid. +[value] Done for function __gmpz_get_ui +[value] computing for function __gmpz_init_set_si <- f <- main. + Called from PROJECT_FILE.i:245. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- f <- main. + Called from PROJECT_FILE.i:246. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:247. +[value] computing for function printf <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- f <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:249. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- f <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:225:[value] Function f: postcondition got status valid. +[value] Recording results for f +[value] Done for function f +[value] computing for function g <- main. + Called from PROJECT_FILE.i:301. +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:266. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- g <- main. + Called from PROJECT_FILE.i:267. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- g <- main. + Called from PROJECT_FILE.i:268. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:269. +[value] computing for function printf <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- g <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:270. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- g <- main. + Called from PROJECT_FILE.i:271. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:259:[value] Function g: postcondition got status valid. +[value] Recording results for g +[value] Done for function g +[value] computing for function h <- main. + Called from PROJECT_FILE.i:302. +[value] computing for function __gmpz_init_set_si <- h <- main. + Called from PROJECT_FILE.i:286. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- h <- main. + Called from PROJECT_FILE.i:287. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- h <- main. + Called from PROJECT_FILE.i:288. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- h <- main. + Called from PROJECT_FILE.i:289. +[value] computing for function printf <- e_acsl_assert <- h <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- h <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- h <- main. + Called from PROJECT_FILE.i:290. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- h <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:277:[value] Function h: postcondition got status valid. +[value] Recording results for h +[value] Done for function h +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function f: + x ∈ {0} + e_acsl_2 ∈ {1} + e_acsl_4 ∈ {1} +[value] Values at end of function g: + e_acsl_1[0] ∈ [--..--] or UNINITIALIZED + e_acsl_2[0] ∈ [--..--] or UNINITIALIZED + e_acsl_3 ∈ [--..--] +[value] Values at end of function h: + __retres ∈ {0} +[value] Values at end of function main: + __retres ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_sub(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ requires \valid(z); + assigns \nothing; */ +extern unsigned long __gmpz_get_ui(__mpz_struct const * /*[1]*/ z); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +/*@ ensures \result ≡ (int)(\old(x)-\old(x)); */ +int f(int x) +{ + int e_acsl_2; + int e_acsl_4; + e_acsl_4 = x; + e_acsl_2 = x; + x = 0; + { + mpz_t e_acsl_1; + mpz_t e_acsl_3; + mpz_t e_acsl_5; + unsigned long e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_3),(long)e_acsl_2); + __gmpz_init((__mpz_struct *)(e_acsl_5)); + __gmpz_sub((__mpz_struct *)(e_acsl_5),(__mpz_struct const *)(e_acsl_3), + (__mpz_struct const *)(e_acsl_3)); + e_acsl_6 = __gmpz_get_ui((__mpz_struct const *)(e_acsl_5)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)((int)e_acsl_6)); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_7)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Postcondition", + (char *)"(\\result == (int)(\\old(x)-\\old(x)))",7); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_3)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + return (x); + } + +} + +int Y = 1; +/*@ ensures \result ≡ Y; */ +int g(int x) +{ + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)Y); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Postcondition", + (char *)"(\\result == Y)",18); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + return (x); +} + +/*@ ensures \result ≡ 0; */ +int h(void) +{ + int __retres; + __retres = 0; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)__retres); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Postcondition", + (char *)"(\\result == 0)",23); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + return (__retres); + } + +} + +int main(void) +{ + int __retres; + f(1); + g(Y); + h(); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.res.oracle index 7d2c6fe77fb..9282198dea2 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/result.res.oracle @@ -70,7 +70,7 @@ int f(int x) x = 0; e_acsl_assert(! (x == (int)((long long)e_acsl_1 - (long long)e_acsl_2)), (char *)"Postcondition", - (char *)"(\\result == (int)(\\old(x)-\\old(x)))",6); + (char *)"(\\result == (int)(\\old(x)-\\old(x)))",7); return (x); } @@ -79,7 +79,7 @@ int Y = 1; int g(int x) { e_acsl_assert(! (x == Y),(char *)"Postcondition",(char *)"(\\result == Y)", - 17); + 18); return (x); } @@ -89,7 +89,7 @@ int h(void) int __retres; __retres = 0; e_acsl_assert(! (__retres == 0),(char *)"Postcondition", - (char *)"(\\result == 0)",22); + (char *)"(\\result == 0)",23); return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.res.oracle new file mode 100644 index 00000000000..ed51f0b9a66 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.1.res.oracle @@ -0,0 +1,144 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:230:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:235. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:236. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:238. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:241. +[value] Done for function __gmpz_clear +PROJECT_FILE.i:245:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:250. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:251. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:252. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:253. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert sizeof(int) ≡ sizeof(x); */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)4); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion", + (char *)"(sizeof(int) == sizeof(x))",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ assert sizeof("totototototo") ≡ sizeof(char *); */ ; + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)4); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)4); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Assertion", + (char *)"(sizeof(\"totototototo\") == sizeof(char *))",10); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle index 6e7b881a951..8409e8c59a4 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/sizeof.res.oracle @@ -43,10 +43,10 @@ int main(void) x = 0; /*@ assert sizeof(int) ≡ sizeof(x); */ ; e_acsl_assert(! (4 == 4),(char *)"Assertion", - (char *)"(sizeof(int) == sizeof(x))",8); + (char *)"(sizeof(int) == sizeof(x))",9); /*@ assert sizeof("totototototo") ≡ sizeof(char *); */ ; e_acsl_assert(! (4 == 4),(char *)"Assertion", - (char *)"(sizeof(\"totototototo\") == sizeof(char *))",9); + (char *)"(sizeof(\"totototototo\") == sizeof(char *))",10); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.res.oracle new file mode 100644 index 00000000000..b102a498963 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.1.res.oracle @@ -0,0 +1,952 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:239. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:241. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:242. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:243. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:255. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:256. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:257. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:258. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:259. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:260. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:261. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:262. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:263. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:264. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:272. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:273. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:274. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:275. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:276. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:277. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:290. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:291. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:292. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:293. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:294. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:295. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:296. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:297. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:298. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:299. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:300. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:301. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:333. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:334. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:335. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:336. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:337. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:338. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:339. +PROJECT_FILE.i:69:[value] Function __gmpz_init: postcondition got status valid. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:340. +PROJECT_FILE.i:138:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:139:[value] Function __gmpz_add: precondition got status valid. +PROJECT_FILE.i:140:[value] Function __gmpz_add: precondition got status valid. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:341. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:342. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:343. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:344. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:345. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:346. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:347. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:348. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:349. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:350. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:351. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:355. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:356. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:357. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:358. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:359. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:360. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:361. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:362. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:363. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:364. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:365. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:366. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:367. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:368. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:369. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:395. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:396. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:397. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:403. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:404. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:405. +[value] Done for function __gmpz_cmp +PROJECT_FILE.i:406:[value] assigning non deterministic value for the first time +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:407. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:408. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:410. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:411. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:412. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:417. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:418. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:419. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:421. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:422. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:430. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:431. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:432. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:434. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:435. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:437. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:439. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:444. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:445. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:446. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:448. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:449. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:459. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:460. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init <- main. + Called from PROJECT_FILE.i:461. +[value] Done for function __gmpz_init +[value] computing for function __gmpz_add <- main. + Called from PROJECT_FILE.i:462. +[value] Done for function __gmpz_add +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:463. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:464. +[value] Done for function __gmpz_cmp +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:466. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:467. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:468. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:469. +[value] Done for function __gmpz_clear +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:471. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:473. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:474. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:475. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:484. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:485. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:486. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:487. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:488. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:489. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:495. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:496. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:497. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:498. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:499. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:500. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:515. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:516. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:517. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:518. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:519. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:520. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:524. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:525. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:526. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:527. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:528. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:529. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {7} + y ∈ {2} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +/*@ ensures \valid(\old(x)); + assigns *x; */ +extern void __gmpz_init(__mpz_struct * /*[1]*/ x); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ requires \valid(z1); + requires \valid(z2); + requires \valid(z3); + assigns *z1; +*/ +extern void __gmpz_add(__mpz_struct * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2, + __mpz_struct const * /*[1]*/ z3); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + int y; + x = 0; + y = 2; + /*@ ensures x ≡ 1; */ + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + x = 1; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_1),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)1); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Postcondition", + (char *)"(x == 1)",9); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + /*@ ensures x ≡ 2; + ensures y ≡ 2; */ + { + mpz_t e_acsl_4; + mpz_t e_acsl_5; + int e_acsl_6; + mpz_t e_acsl_7; + int e_acsl_8; + x = 2; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_4),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_5),(long)2); + e_acsl_6 = __gmpz_cmp((__mpz_struct const *)(e_acsl_4), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_6 == 0),(char *)"Postcondition", + (char *)"(x == 2)",12); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_7),(long)y); + e_acsl_8 = __gmpz_cmp((__mpz_struct const *)(e_acsl_7), + (__mpz_struct const *)(e_acsl_5)); + e_acsl_assert(! (e_acsl_8 == 0),(char *)"Postcondition", + (char *)"(y == 2)",13); + __gmpz_clear((__mpz_struct *)(e_acsl_4)); + __gmpz_clear((__mpz_struct *)(e_acsl_5)); + __gmpz_clear((__mpz_struct *)(e_acsl_7)); + } + + /*@ requires x ≡ 2; */ + { + mpz_t e_acsl_9; + mpz_t e_acsl_10; + int e_acsl_11; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_9),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_10),(long)2); + e_acsl_11 = __gmpz_cmp((__mpz_struct const *)(e_acsl_9), + (__mpz_struct const *)(e_acsl_10)); + e_acsl_assert(! (e_acsl_11 == 0),(char *)"Precondition", + (char *)"(x == 2)",16); + __gmpz_clear((__mpz_struct *)(e_acsl_9)); + __gmpz_clear((__mpz_struct *)(e_acsl_10)); + x ++; + } + + /*@ requires x ≡ 3; + requires y ≡ 2; */ + { + mpz_t e_acsl_12; + mpz_t e_acsl_13; + int e_acsl_14; + mpz_t e_acsl_15; + mpz_t e_acsl_16; + int e_acsl_17; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_12),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_13),(long)3); + e_acsl_14 = __gmpz_cmp((__mpz_struct const *)(e_acsl_12), + (__mpz_struct const *)(e_acsl_13)); + e_acsl_assert(! (e_acsl_14 == 0),(char *)"Precondition", + (char *)"(x == 3)",19); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_15),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_16),(long)2); + e_acsl_17 = __gmpz_cmp((__mpz_struct const *)(e_acsl_15), + (__mpz_struct const *)(e_acsl_16)); + e_acsl_assert(! (e_acsl_17 == 0),(char *)"Precondition", + (char *)"(y == 2)",20); + __gmpz_clear((__mpz_struct *)(e_acsl_12)); + __gmpz_clear((__mpz_struct *)(e_acsl_13)); + __gmpz_clear((__mpz_struct *)(e_acsl_15)); + __gmpz_clear((__mpz_struct *)(e_acsl_16)); + x += y; + } + + /*@ behavior b1: + requires x ≡ 5; + ensures x ≡ 3; + + behavior b2: + requires x ≡ 3+y; + requires y ≡ 2; + ensures x ≡ y+1; + + */ + { + mpz_t e_acsl_27; + mpz_t e_acsl_28; + int e_acsl_29; + mpz_t e_acsl_30; + mpz_t e_acsl_31; + mpz_t e_acsl_32; + int e_acsl_33; + { + mpz_t e_acsl_18; + mpz_t e_acsl_19; + int e_acsl_20; + mpz_t e_acsl_21; + mpz_t e_acsl_22; + mpz_t e_acsl_23; + int e_acsl_24; + mpz_t e_acsl_25; + int e_acsl_26; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_18),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_19),(long)5); + e_acsl_20 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_19)); + e_acsl_assert(! (e_acsl_20 == 0),(char *)"Precondition", + (char *)"(x == 5)",24); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_21),(long)3); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_22),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_23)); + __gmpz_add((__mpz_struct *)(e_acsl_23), + (__mpz_struct const *)(e_acsl_21), + (__mpz_struct const *)(e_acsl_22)); + e_acsl_24 = __gmpz_cmp((__mpz_struct const *)(e_acsl_18), + (__mpz_struct const *)(e_acsl_23)); + e_acsl_assert(! (e_acsl_24 == 0),(char *)"Precondition", + (char *)"(x == 3+y)",27); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_25),(long)2); + e_acsl_26 = __gmpz_cmp((__mpz_struct const *)(e_acsl_22), + (__mpz_struct const *)(e_acsl_25)); + e_acsl_assert(! (e_acsl_26 == 0),(char *)"Precondition", + (char *)"(y == 2)",28); + __gmpz_clear((__mpz_struct *)(e_acsl_18)); + __gmpz_clear((__mpz_struct *)(e_acsl_19)); + __gmpz_clear((__mpz_struct *)(e_acsl_21)); + __gmpz_clear((__mpz_struct *)(e_acsl_22)); + __gmpz_clear((__mpz_struct *)(e_acsl_23)); + __gmpz_clear((__mpz_struct *)(e_acsl_25)); + x = 3; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_27),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_28),(long)3); + e_acsl_29 = __gmpz_cmp((__mpz_struct const *)(e_acsl_27), + (__mpz_struct const *)(e_acsl_28)); + e_acsl_assert(! (e_acsl_29 == 0),(char *)"Postcondition", + (char *)"(x == 3)",25); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_30),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_31),(long)1); + __gmpz_init((__mpz_struct *)(e_acsl_32)); + __gmpz_add((__mpz_struct *)(e_acsl_32),(__mpz_struct const *)(e_acsl_30), + (__mpz_struct const *)(e_acsl_31)); + e_acsl_33 = __gmpz_cmp((__mpz_struct const *)(e_acsl_27), + (__mpz_struct const *)(e_acsl_32)); + e_acsl_assert(! (e_acsl_33 == 0),(char *)"Postcondition", + (char *)"(x == y+1)",29); + __gmpz_clear((__mpz_struct *)(e_acsl_27)); + __gmpz_clear((__mpz_struct *)(e_acsl_28)); + __gmpz_clear((__mpz_struct *)(e_acsl_30)); + __gmpz_clear((__mpz_struct *)(e_acsl_31)); + __gmpz_clear((__mpz_struct *)(e_acsl_32)); + } + + /*@ behavior b1: + assumes x ≡ 1; + requires x ≡ 0; + + behavior b2: + assumes x ≡ 3; + assumes y ≡ 2; + requires x ≡ 3; + requires x+y ≡ 5; + + */ + { + mpz_t e_acsl_34; + mpz_t e_acsl_35; + int e_acsl_36; + int e_acsl_40; + mpz_t e_acsl_41; + int e_acsl_42; + int e_acsl_46; + int e_acsl_50; + int e_acsl_51; + int e_acsl_55; + int e_acsl_61; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_34),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_35),(long)1); + e_acsl_36 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_35)); + if (! (e_acsl_36 == 0)) { e_acsl_40 = 1; } + else { + mpz_t e_acsl_37; + mpz_t e_acsl_38; + int e_acsl_39; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_37),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_38),(long)0); + e_acsl_39 = __gmpz_cmp((__mpz_struct const *)(e_acsl_37), + (__mpz_struct const *)(e_acsl_38)); + e_acsl_40 = e_acsl_39 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_37)); + __gmpz_clear((__mpz_struct *)(e_acsl_38)); + } + e_acsl_assert(! e_acsl_40,(char *)"Precondition", + (char *)"(x == 1 ==> x == 0)",34); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_41),(long)3); + e_acsl_42 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_41)); + if (e_acsl_42 == 0) { + mpz_t e_acsl_43; + mpz_t e_acsl_44; + int e_acsl_45; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_43),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_44),(long)2); + e_acsl_45 = __gmpz_cmp((__mpz_struct const *)(e_acsl_43), + (__mpz_struct const *)(e_acsl_44)); + e_acsl_46 = e_acsl_45 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_43)); + __gmpz_clear((__mpz_struct *)(e_acsl_44)); + } + else { e_acsl_46 = 0; } + if (! e_acsl_46) { e_acsl_50 = 1; } + else { + mpz_t e_acsl_47; + mpz_t e_acsl_48; + int e_acsl_49; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_47),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_48),(long)3); + e_acsl_49 = __gmpz_cmp((__mpz_struct const *)(e_acsl_47), + (__mpz_struct const *)(e_acsl_48)); + e_acsl_50 = e_acsl_49 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_47)); + __gmpz_clear((__mpz_struct *)(e_acsl_48)); + } + e_acsl_assert(! e_acsl_50,(char *)"Precondition", + (char *)"(x == 3 && y == 2 ==> x == 3)",38); + e_acsl_51 = __gmpz_cmp((__mpz_struct const *)(e_acsl_34), + (__mpz_struct const *)(e_acsl_41)); + if (e_acsl_51 == 0) { + mpz_t e_acsl_52; + mpz_t e_acsl_53; + int e_acsl_54; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_52),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_53),(long)2); + e_acsl_54 = __gmpz_cmp((__mpz_struct const *)(e_acsl_52), + (__mpz_struct const *)(e_acsl_53)); + e_acsl_55 = e_acsl_54 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_52)); + __gmpz_clear((__mpz_struct *)(e_acsl_53)); + } + else { e_acsl_55 = 0; } + if (! e_acsl_55) { e_acsl_61 = 1; } + else { + mpz_t e_acsl_56; + mpz_t e_acsl_57; + mpz_t e_acsl_58; + mpz_t e_acsl_59; + int e_acsl_60; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_56),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_57),(long)y); + __gmpz_init((__mpz_struct *)(e_acsl_58)); + __gmpz_add((__mpz_struct *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_56), + (__mpz_struct const *)(e_acsl_57)); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_59),(long)5); + e_acsl_60 = __gmpz_cmp((__mpz_struct const *)(e_acsl_58), + (__mpz_struct const *)(e_acsl_59)); + e_acsl_61 = e_acsl_60 == 0; + __gmpz_clear((__mpz_struct *)(e_acsl_56)); + __gmpz_clear((__mpz_struct *)(e_acsl_57)); + __gmpz_clear((__mpz_struct *)(e_acsl_58)); + __gmpz_clear((__mpz_struct *)(e_acsl_59)); + } + e_acsl_assert(! e_acsl_61,(char *)"Precondition", + (char *)"(x == 3 && y == 2 ==> x+y == 5)",39); + __gmpz_clear((__mpz_struct *)(e_acsl_34)); + __gmpz_clear((__mpz_struct *)(e_acsl_35)); + __gmpz_clear((__mpz_struct *)(e_acsl_41)); + x += y; + } + + /*@ requires x ≡ 5; */ + { + mpz_t e_acsl_62; + mpz_t e_acsl_63; + int e_acsl_64; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_62),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_63),(long)5); + e_acsl_64 = __gmpz_cmp((__mpz_struct const *)(e_acsl_62), + (__mpz_struct const *)(e_acsl_63)); + e_acsl_assert(! (e_acsl_64 == 0),(char *)"Precondition", + (char *)"(x == 5)",42); + __gmpz_clear((__mpz_struct *)(e_acsl_62)); + __gmpz_clear((__mpz_struct *)(e_acsl_63)); + /*@ requires y ≡ 2; */ + { + mpz_t e_acsl_65; + mpz_t e_acsl_66; + int e_acsl_67; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_65),(long)y); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_66),(long)2); + e_acsl_67 = __gmpz_cmp((__mpz_struct const *)(e_acsl_65), + (__mpz_struct const *)(e_acsl_66)); + e_acsl_assert(! (e_acsl_67 == 0),(char *)"Precondition", + (char *)"(y == 2)",43); + __gmpz_clear((__mpz_struct *)(e_acsl_65)); + __gmpz_clear((__mpz_struct *)(e_acsl_66)); + x += y; + } + } + + /*@ requires x ≡ 7; + ensures x ≡ 7; */ + { + mpz_t e_acsl_71; + mpz_t e_acsl_72; + int e_acsl_73; + { + mpz_t e_acsl_68; + mpz_t e_acsl_69; + int e_acsl_70; + __gmpz_init_set_si((__mpz_struct *)(e_acsl_68),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_69),(long)7); + e_acsl_70 = __gmpz_cmp((__mpz_struct const *)(e_acsl_68), + (__mpz_struct const *)(e_acsl_69)); + e_acsl_assert(! (e_acsl_70 == 0),(char *)"Precondition", + (char *)"(x == 7)",46); + __gmpz_clear((__mpz_struct *)(e_acsl_68)); + __gmpz_clear((__mpz_struct *)(e_acsl_69)); + __retres = 0; + } + + __gmpz_init_set_si((__mpz_struct *)(e_acsl_71),(long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_72),(long)7); + e_acsl_73 = __gmpz_cmp((__mpz_struct const *)(e_acsl_71), + (__mpz_struct const *)(e_acsl_72)); + e_acsl_assert(! (e_acsl_73 == 0),(char *)"Postcondition", + (char *)"(x == 7)",47); + __gmpz_clear((__mpz_struct *)(e_acsl_71)); + __gmpz_clear((__mpz_struct *)(e_acsl_72)); + } + + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.res.oracle index 3b6b3ba44d0..4037f3db267 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/stmt_contract.res.oracle @@ -109,24 +109,24 @@ int main(void) /*@ ensures x ≡ 1; */ { x = 1; - e_acsl_assert(! (x == 1),(char *)"Postcondition",(char *)"(x == 1)",8); + e_acsl_assert(! (x == 1),(char *)"Postcondition",(char *)"(x == 1)",9); } /*@ ensures x ≡ 2; ensures y ≡ 2; */ { x = 2; - e_acsl_assert(! (x == 2),(char *)"Postcondition",(char *)"(x == 2)",11); - e_acsl_assert(! (y == 2),(char *)"Postcondition",(char *)"(y == 2)",12); + e_acsl_assert(! (x == 2),(char *)"Postcondition",(char *)"(x == 2)",12); + e_acsl_assert(! (y == 2),(char *)"Postcondition",(char *)"(y == 2)",13); } /*@ requires x ≡ 2; */ - e_acsl_assert(! (x == 2),(char *)"Precondition",(char *)"(x == 2)",15); + e_acsl_assert(! (x == 2),(char *)"Precondition",(char *)"(x == 2)",16); x ++; /*@ requires x ≡ 3; requires y ≡ 2; */ - e_acsl_assert(! (x == 3),(char *)"Precondition",(char *)"(x == 3)",18); - e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",19); + e_acsl_assert(! (x == 3),(char *)"Precondition",(char *)"(x == 3)",19); + e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",20); x += y; /*@ behavior b1: requires x ≡ 5; @@ -139,14 +139,14 @@ int main(void) */ { - e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",23); + e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",24); e_acsl_assert(! ((long long)x == (long long)3 + (long long)y), - (char *)"Precondition",(char *)"(x == 3+y)",26); - e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",27); + (char *)"Precondition",(char *)"(x == 3+y)",27); + e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",28); x = 3; - e_acsl_assert(! (x == 3),(char *)"Postcondition",(char *)"(x == 3)",24); + e_acsl_assert(! (x == 3),(char *)"Postcondition",(char *)"(x == 3)",25); e_acsl_assert(! ((long long)x == (long long)y + (long long)1), - (char *)"Postcondition",(char *)"(x == y+1)",28); + (char *)"Postcondition",(char *)"(x == y+1)",29); } /*@ behavior b1: @@ -169,33 +169,33 @@ int main(void) if (! (x == 1)) { e_acsl_1 = 1; } else { e_acsl_1 = x == 0; } e_acsl_assert(! e_acsl_1,(char *)"Precondition", - (char *)"(x == 1 ==> x == 0)",33); + (char *)"(x == 1 ==> x == 0)",34); if (x == 3) { e_acsl_2 = y == 2; } else { e_acsl_2 = 0; } if (! e_acsl_2) { e_acsl_3 = 1; } else { e_acsl_3 = x == 3; } e_acsl_assert(! e_acsl_3,(char *)"Precondition", - (char *)"(x == 3 && y == 2 ==> x == 3)",37); + (char *)"(x == 3 && y == 2 ==> x == 3)",38); if (x == 3) { e_acsl_4 = y == 2; } else { e_acsl_4 = 0; } if (! e_acsl_4) { e_acsl_5 = 1; } else { e_acsl_5 = (long long)x + (long long)y == (long long)5; } e_acsl_assert(! e_acsl_5,(char *)"Precondition", - (char *)"(x == 3 && y == 2 ==> x+y == 5)",38); + (char *)"(x == 3 && y == 2 ==> x+y == 5)",39); x += y; } /*@ requires x ≡ 5; */ - e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",41); + e_acsl_assert(! (x == 5),(char *)"Precondition",(char *)"(x == 5)",42); /*@ requires y ≡ 2; */ - e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",42); + e_acsl_assert(! (y == 2),(char *)"Precondition",(char *)"(y == 2)",43); x += y; /*@ requires x ≡ 7; ensures x ≡ 7; */ { - e_acsl_assert(! (x == 7),(char *)"Precondition",(char *)"(x == 7)",45); + e_acsl_assert(! (x == 7),(char *)"Precondition",(char *)"(x == 7)",46); __retres = 0; - e_acsl_assert(! (x == 7),(char *)"Postcondition",(char *)"(x == 7)",46); + e_acsl_assert(! (x == 7),(char *)"Postcondition",(char *)"(x == 7)",47); } return (__retres); diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.res.oracle new file mode 100644 index 00000000000..d34c2d496a5 --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.1.res.oracle @@ -0,0 +1,45 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:230:[value] Assertion got status valid. +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:231. +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + int x; + x = 0; + /*@ assert \true; */ ; + e_acsl_assert(0,(char *)"Assertion",(char *)"(\\true)",9); + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle index b2673c5ef42..d34c2d496a5 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/true.res.oracle @@ -37,7 +37,7 @@ int main(void) int x; x = 0; /*@ assert \true; */ ; - e_acsl_assert(0,(char *)"Assertion",(char *)"(\\true)",8); + e_acsl_assert(0,(char *)"Assertion",(char *)"(\\true)",9); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.err.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.err.oracle new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.res.oracle new file mode 100644 index 00000000000..14858ea0cba --- /dev/null +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.1.res.oracle @@ -0,0 +1,109 @@ +[value] Analyzing a complete application starting at main +[value] Computing initial state +[value] Initial state computed +[value] Values of globals at initialization +PROJECT_FILE.i:231:[value] Assertion got status valid. +[value] computing for function __gmpz_init_set_ui <- main. + Called from PROJECT_FILE.i:236. +PROJECT_FILE.i:78:[value] Function __gmpz_init_set_ui: postcondition got status valid. +[value] Done for function __gmpz_init_set_ui +[value] computing for function __gmpz_init_set_si <- main. + Called from PROJECT_FILE.i:237. +PROJECT_FILE.i:82:[value] Function __gmpz_init_set_si: postcondition got status valid. +[value] Done for function __gmpz_init_set_si +[value] computing for function __gmpz_cmp <- main. + Called from PROJECT_FILE.i:238. +PROJECT_FILE.i:119:[value] Function __gmpz_cmp: precondition got status valid. +PROJECT_FILE.i:120:[value] Function __gmpz_cmp: precondition got status valid. +[value] Done for function __gmpz_cmp +[value] computing for function e_acsl_assert <- main. + Called from PROJECT_FILE.i:239. +[value] computing for function printf <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:219. +[value] Done for function printf +[value] computing for function exit <- e_acsl_assert <- main. + Called from PROJECT_FILE.i:221. +PROJECT_FILE.i:207:[value] Function exit: postcondition got status invalid. +[value] Done for function exit +[value] Recording results for e_acsl_assert +[value] Done for function e_acsl_assert +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:240. +PROJECT_FILE.i:111:[value] Function __gmpz_clear: precondition got status valid. +[value] Done for function __gmpz_clear +[value] computing for function __gmpz_clear <- main. + Called from PROJECT_FILE.i:241. +[value] Done for function __gmpz_clear +[value] Recording results for main +[value] done for function main +[value] ====== VALUES COMPUTED ====== +[value] Values at end of function e_acsl_assert: +[value] Values at end of function main: + __retres ∈ {0} + x ∈ {0} +/* Generated by Frama-C */ +struct __anonstruct___mpz_struct_1 { + int _mp_alloc ; + int _mp_size ; + unsigned long *_mp_d ; +}; +typedef struct __anonstruct___mpz_struct_1 __mpz_struct; +typedef __mpz_struct mpz_t[1]; +typedef unsigned char uint8; +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_ui(__mpz_struct * /*[1]*/ z, unsigned long n); +/*@ ensures \valid(\old(z)); + assigns *z; + assigns *z \from n; */ +extern void __gmpz_init_set_si(__mpz_struct * /*[1]*/ z, long n); +/*@ requires \valid(x); + assigns *x; */ +extern void __gmpz_clear(__mpz_struct * /*[1]*/ x); +/*@ requires \valid(z1); + requires \valid(z2); + assigns \nothing; */ +extern int __gmpz_cmp(__mpz_struct const * /*[1]*/ z1, + __mpz_struct const * /*[1]*/ z2); +/*@ terminates \false; + ensures \false; + assigns \nothing; */ +extern void exit(int status); +/*@ assigns \nothing; */ +extern int printf(char const * , ...); +void e_acsl_assert(int predicate, char *kind, char *pred_txt, int line) +{ + if (predicate) { + printf("%s failed at line %d.\nThe failing predicate is:\n%s.\n",kind, + line,pred_txt); + exit(1); + } + return; +} + +int main(void) +{ + int __retres; + uint8 x; + x = (unsigned char)0; + /*@ assert x ≡ 0; */ ; + { + mpz_t e_acsl_1; + mpz_t e_acsl_2; + int e_acsl_3; + __gmpz_init_set_ui((__mpz_struct *)(e_acsl_1),(unsigned long)x); + __gmpz_init_set_si((__mpz_struct *)(e_acsl_2),(long)0); + e_acsl_3 = __gmpz_cmp((__mpz_struct const *)(e_acsl_1), + (__mpz_struct const *)(e_acsl_2)); + e_acsl_assert(! (e_acsl_3 == 0),(char *)"Assertion",(char *)"(x == 0)", + 11); + __gmpz_clear((__mpz_struct *)(e_acsl_1)); + __gmpz_clear((__mpz_struct *)(e_acsl_2)); + } + + __retres = 0; + return (__retres); +} + + diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.res.oracle b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.res.oracle index cca67e6c4ea..7f34ec04e35 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.res.oracle +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/oracle/typedef.res.oracle @@ -38,7 +38,7 @@ int main(void) uint8 x; x = (unsigned char)0; /*@ assert x ≡ 0; */ ; - e_acsl_assert(! ((int)x == 0),(char *)"Assertion",(char *)"(x == 0)",10); + e_acsl_assert(! ((int)x == 0),(char *)"Assertion",(char *)"(x == 0)",11); __retres = 0; return (__retres); } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/other_constants.i b/src/plugins/e-acsl/tests/e-acsl-runtime/other_constants.i index f0637465796..53506aef6a1 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/other_constants.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/other_constants.i @@ -1,6 +1,7 @@ /* run.config COMMENT: non integer constants EXECNOW: LOG gen_other_constants.c BIN gen_other_constants.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/other_constants.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_other_constants.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_other_constants.out ./tests/e-acsl-runtime/result/gen_other_constants.c -lgmp && ./tests/e-acsl-runtime/result/gen_other_constants.out + EXECNOW: LOG gen_other_constants2.c BIN gen_other_constants2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/other_constants.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_other_constants2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_other_constants2.out ./tests/e-acsl-runtime/result/gen_other_constants2.c -lgmp && ./tests/e-acsl-runtime/result/gen_other_constants2.out */ enum bool { false, true }; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/ptr.i b/src/plugins/e-acsl/tests/e-acsl-runtime/ptr.i index 1a6cc97205d..bbeded7a8bf 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/ptr.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/ptr.i @@ -1,6 +1,7 @@ /* run.config COMMENT: pointers and pointer arithmetic EXECNOW: LOG gen_ptr.c BIN gen_ptr.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/ptr.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_ptr.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_ptr.out ./tests/e-acsl-runtime/result/gen_ptr.c -lgmp && ./tests/e-acsl-runtime/result/gen_ptr.out + EXECNOW: LOG gen_ptr2.c BIN gen_ptr2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/ptr.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_ptr2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_ptr2.out ./tests/e-acsl-runtime/result/gen_ptr2.c -lgmp && ./tests/e-acsl-runtime/result/gen_ptr2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/quantif.i b/src/plugins/e-acsl/tests/e-acsl-runtime/quantif.i index 65be6f23cf0..d35beb4c1ab 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/quantif.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/quantif.i @@ -1,6 +1,7 @@ /* run.config COMMENT: quantifiers EXECNOW: LOG gen_quantif.c BIN gen_quantif.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/quantif.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_quantif.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_quantif.out ./tests/e-acsl-runtime/result/gen_quantif.c -lgmp && ./tests/e-acsl-runtime/result/gen_quantif.out + EXECNOW: LOG gen_quantif2.c BIN gen_quantif2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_quantif2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_quantif2.out ./tests/e-acsl-runtime/result/gen_quantif2.c -lgmp && ./tests/e-acsl-runtime/result/gen_quantif2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/result.i b/src/plugins/e-acsl/tests/e-acsl-runtime/result.i index 7998cedb9d0..18e0b59fd83 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/result.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/result.i @@ -1,6 +1,7 @@ /* run.config COMMENT: \result EXECNOW: LOG gen_result.c BIN gen_result.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/result.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_result.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_result.out ./tests/e-acsl-runtime/result/gen_result.c -lgmp && ./tests/e-acsl-runtime/result/gen_result.out + EXECNOW: LOG gen_result2.c BIN gen_result2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_result2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_result2.out ./tests/e-acsl-runtime/result/gen_result2.c -lgmp && ./tests/e-acsl-runtime/result/gen_result2.out */ /*@ ensures \result == (int)(x - x); */ diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i b/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i index caa836209c6..31c48a7c5ff 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/sizeof.i @@ -1,6 +1,7 @@ /* run.config COMMENT: sizeof EXECNOW: LOG gen_sizeof.c BIN gen_sizeof.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/sizeof.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_sizeof.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_sizeof.out ./tests/e-acsl-runtime/result/gen_sizeof.c -lgmp && ./tests/e-acsl-runtime/result/gen_sizeof.out + EXECNOW: LOG gen_sizeof2.c BIN gen_sizeof2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/sizeof.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_sizeof2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_sizeof2.out ./tests/e-acsl-runtime/result/gen_sizeof2.c -lgmp && ./tests/e-acsl-runtime/result/gen_sizeof2.out */ int main(void) { diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/stmt_contract.i b/src/plugins/e-acsl/tests/e-acsl-runtime/stmt_contract.i index 2ab3759592a..d891e1bed69 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/stmt_contract.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/stmt_contract.i @@ -1,6 +1,7 @@ /* run.config COMMENT: stmt contract EXECNOW: LOG gen_stmt_contract.c BIN gen_stmt_contract.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/stmt_contract.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_stmt_contract.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_stmt_contract.out ./tests/e-acsl-runtime/result/gen_stmt_contract.c -lgmp && ./tests/e-acsl-runtime/result/gen_stmt_contract.out + EXECNOW: LOG gen_stmt_contract2.c BIN gen_stmt_contract2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/arith.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_stmt_contract2.c > /dev/null && gcc -pedantic -Wno-long-long -o ./tests/e-acsl-runtime/result/gen_stmt_contract2.out ./tests/e-acsl-runtime/result/gen_stmt_contract2.c -lgmp && ./tests/e-acsl-runtime/result/gen_stmt_contract2.out */ int main(void) { int x = 0, y = 2; diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/test_config b/src/plugins/e-acsl/tests/e-acsl-runtime/test_config index adc00e63922..6add24d4144 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/test_config +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/test_config @@ -1 +1,2 @@ OPT: -e-acsl -then-on e-acsl -check -print -val +OPT: -e-acsl -e-acsl-gmp-only -then-on e-acsl -check -print -val diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/true.i b/src/plugins/e-acsl/tests/e-acsl-runtime/true.i index ab45a435f5d..266b8915cd3 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/true.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/true.i @@ -1,10 +1,11 @@ /* run.config COMMENT: assert \true EXECNOW: LOG gen_true.c BIN gen_true.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/true.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_true.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_true.out ./tests/e-acsl-runtime/result/gen_true.c && ./tests/e-acsl-runtime/result/gen_true.out + EXECNOW: LOG gen_true2.c BIN gen_true2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/true.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_true2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_true2.out ./tests/e-acsl-runtime/result/gen_true2.c && ./tests/e-acsl-runtime/result/gen_true2.out */ int main(void) { int x = 0; - // /*@ assert \true == 0; */ // not yet implemented + ///*@ assert \true == 0; */ // \true as a term: not yet implemented /*@ assert \true; */ return 0; } diff --git a/src/plugins/e-acsl/tests/e-acsl-runtime/typedef.i b/src/plugins/e-acsl/tests/e-acsl-runtime/typedef.i index 3bb307b0378..096dd94d635 100644 --- a/src/plugins/e-acsl/tests/e-acsl-runtime/typedef.i +++ b/src/plugins/e-acsl/tests/e-acsl-runtime/typedef.i @@ -1,6 +1,7 @@ /* run.config COMMENT: typedef (from a Bernard's bug report) EXECNOW: LOG gen_typedef.c BIN gen_typedef.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/typedef.i -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_typedef.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_typedef.out ./tests/e-acsl-runtime/result/gen_typedef.c -lgmp && ./tests/e-acsl-runtime/result/gen_typedef.out + EXECNOW: LOG gen_typedef2.c BIN gen_typedef2.out FRAMAC_SHARE=./share @frama-c@ ./tests/e-acsl-runtime/typedef.i -e-acsl-gmp-only -e-acsl -then-on e-acsl -print -ocode ./tests/e-acsl-runtime/result/gen_typedef2.c > /dev/null && gcc -pedantic -o ./tests/e-acsl-runtime/result/gen_typedef2.out ./tests/e-acsl-runtime/result/gen_typedef2.c -lgmp && ./tests/e-acsl-runtime/result/gen_typedef2.out */ typedef unsigned char uint8; diff --git a/src/plugins/e-acsl/typing.ml b/src/plugins/e-acsl/typing.ml index 7e2859479b4..86991795d93 100644 --- a/src/plugins/e-acsl/typing.ml +++ b/src/plugins/e-acsl/typing.ml @@ -26,7 +26,17 @@ open Cil_datatype module BI = My_bigint -let is_representable n _k _s = BI.ge n BI.min_int64 && BI.le n BI.max_int64 +let is_representable n k _s = + (* [TODO] these two different behaviors seem to be quite strange here... *) + if Options.Gmp_only.get () then + match k with + | IBool | IChar | ISChar | IUChar | IInt | IUInt | IShort | IUShort + | ILong | IULong -> + true + | ILongLong | IULongLong -> + false + else + BI.ge n BI.min_int64 && BI.le n BI.max_int64 (******************************************************************************) (** Type Definitions: Intervals *) @@ -120,14 +130,27 @@ module Term_env = Make_env(Term) module Logic_var_env = Make_env(Logic_var) let typ_of_term t = - try - let ty = Term_env.find t in - typ_of_eacsl_typ ty - with Not_found -> Options.fatal "untyped term %a" Term.pretty t + if Options.Gmp_only.get () then + match t.term_type with + | Linteger -> Mpz.t + | Ctype ty when isIntegralType ty -> Mpz.t + | Ctype ty -> ty + | Ltype _ -> Error.not_yet "typing of user-defined logic type" + | Lvar _ -> Error.not_yet "type variable" + | Lreal -> Error.not_yet "real numbers" + | Larrow _ -> Error.not_yet "functional type" + else + try + let ty = Term_env.find t in + typ_of_eacsl_typ ty + with Not_found -> + Options.fatal "untyped term %a" Term.pretty t let unsafe_set_term t ty = - assert (not (Term_env.mem t)); - Term_env.add t (eacsl_typ_of_typ ty) + if not (Options.Gmp_only.get ()) then begin + assert (not (Term_env.mem t)); + Term_env.add t (eacsl_typ_of_typ ty) + end let clear () = Term_env.clear (); @@ -365,12 +388,14 @@ let rec type_predicate_named p = match p.content with | Psubtype _ -> Error.not_yet "subtyping relation" (* Jessie specific *) | Pinitialized _ -> Error.not_yet "\\initialized" -let type_term t = ignore (type_term t) +let type_term t = if not (Options.Gmp_only.get ()) then ignore (type_term t) let type_named_predicate p = - Options.debug ~level:2 "typing predicate %a" d_predicate_named p; - clear (); - type_predicate_named p + if not (Options.Gmp_only.get ()) then begin + Options.debug ~level:2 "typing predicate %a" d_predicate_named p; + clear (); + type_predicate_named p + end (******************************************************************************) (** Subtyping *) @@ -416,10 +441,12 @@ C-representable@]"; (* Convert the C integer into a mpz. Remember: very long integer constants have been temporary converted into strings *) - assert (Options.verify - (isIntegralType ty || is_mpz_string) - "how to convert %a to an integer?" - d_type ty); + (* possible to get a non integralType (or Mpz.t) with a non-one in the + case of \null *) + let e = + if isIntegralType ty || is_mpz_string then e + else mkCast e longType (* \null *) + in mk_mpz e end else if isIntegralType ctx then do_int_ctx ty diff --git a/src/plugins/e-acsl/visit.ml b/src/plugins/e-acsl/visit.ml index b2f6c834827..3e1b176fe7e 100644 --- a/src/plugins/e-acsl/visit.ml +++ b/src/plugins/e-acsl/visit.ml @@ -578,6 +578,24 @@ class e_acsl_visitor prj generate = object (self) method private reset_env () = function_env := Env.empty (self :> Visitor.frama_c_visitor) + method vfile f = + (* copy the options used during the visit in the new project: it is the + right place to do this: it is still before visiting, but after + that the visitor internals reset all of them :-(. *) + let cur = Project.current () in + let must_copy = not (Project.equal cur prj) in + let selection = + State_selection.of_list [ Options.Gmp_only.self; Options.Check.self ] + in + if must_copy then Project.copy ~selection ~src:cur prj; + ChangeDoChildrenPost + (f, + fun f -> + (* reset them at the end to be observationally equivalent to a standard + visitor. *) + if must_copy then Project.clear ~selection ~project:prj (); + f) + method vglob_aux g = if !first_global then begin first_global := false; @@ -742,11 +760,8 @@ class e_acsl_visitor prj generate = object (self) end let do_visit ?(prj=Project.current ()) generate = - let vis = - Extlib.try_finally - ~finally:Typing.clear - (new e_acsl_visitor prj) - generate + let vis = + Extlib.try_finally ~finally:Typing.clear (new e_acsl_visitor prj) generate in first_global := true; (* explicit type annotation in order to check that no new method is -- GitLab